Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e615e69 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Factor some RestrictedLockUtils out of SettingLib

Also make the new lib only use system-apis.

This allows mainline module to use the new
RestrictedLockUtilsSettingLib.

Unfortunately the whole RestrictedLockUtils would have caused to much
new system-api. Hence it was split into RestrictedLockUtils and
RestrictedLockUtilsInternal. This caused a lot of trivial code changes.

Bug: 110953302
Test: Built
Change-Id: I693b3bf56f3be71f0790776e3aad5694717786ef
parent 0f9755bc
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -515,9 +515,11 @@ package android.app.admin {
    method public android.content.ComponentName getDeviceOwnerComponentOnAnyUser();
    method public java.lang.String getDeviceOwnerNameOnAnyUser();
    method public java.lang.CharSequence getDeviceOwnerOrganizationName();
    method public int getDeviceOwnerUserId();
    method public java.util.List<java.lang.String> getPermittedAccessibilityServices(int);
    method public java.util.List<java.lang.String> getPermittedInputMethodsForCurrentUser();
    method public android.content.ComponentName getProfileOwner() throws java.lang.IllegalArgumentException;
    method public android.content.ComponentName getProfileOwnerAsUser(int);
    method public java.lang.String getProfileOwnerNameAsUser(int) throws java.lang.IllegalArgumentException;
    method public int getUserProvisioningState();
    method public boolean isDeviceManaged();
@@ -539,6 +541,7 @@ package android.app.admin {
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_LABEL = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_LABEL";
    field public static final java.lang.String EXTRA_PROVISIONING_ORGANIZATION_NAME = "android.app.extra.PROVISIONING_ORGANIZATION_NAME";
    field public static final java.lang.String EXTRA_PROVISIONING_SUPPORT_URL = "android.app.extra.PROVISIONING_SUPPORT_URL";
    field public static final java.lang.String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";
    field public static final int STATE_USER_PROFILE_COMPLETE = 4; // 0x4
    field public static final int STATE_USER_SETUP_COMPLETE = 2; // 0x2
    field public static final int STATE_USER_SETUP_FINALIZED = 3; // 0x3
@@ -933,6 +936,7 @@ package android.content {
    method public abstract void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle);
    method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle);
    method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public void startActivityAsUser(android.content.Intent, android.os.UserHandle);
    field public static final java.lang.String BACKUP_SERVICE = "backup";
    field public static final java.lang.String CONTEXTHUB_SERVICE = "contexthub";
    field public static final java.lang.String EUICC_CARD_SERVICE = "euicc_card";
@@ -998,6 +1002,7 @@ package android.content {
    field public static final java.lang.String EXTRA_REMOTE_CALLBACK = "android.intent.extra.REMOTE_CALLBACK";
    field public static final java.lang.String EXTRA_RESULT_NEEDED = "android.intent.extra.RESULT_NEEDED";
    field public static final java.lang.String EXTRA_UNKNOWN_INSTANT_APP = "android.intent.extra.UNKNOWN_INSTANT_APP";
    field public static final java.lang.String EXTRA_USER_ID = "android.intent.extra.USER_ID";
    field public static final java.lang.String EXTRA_VERIFICATION_BUNDLE = "android.intent.extra.VERIFICATION_BUNDLE";
  }

@@ -4095,10 +4100,12 @@ package android.os {
    method public boolean isSystem();
    method public static int myUserId();
    method public static android.os.UserHandle of(int);
    field public static final int USER_NULL = -10000; // 0xffffd8f0
  }

  public class UserManager {
    method public void clearSeedAccountData();
    method public int[] getProfileIds(int, boolean);
    method public java.lang.String getSeedAccountName();
    method public android.os.PersistableBundle getSeedAccountOptions();
    method public java.lang.String getSeedAccountType();
@@ -4372,6 +4379,7 @@ package android.provider {

  public final class Settings {
    field public static final java.lang.String ACTION_ENTERPRISE_PRIVACY_SETTINGS = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
    field public static final java.lang.String ACTION_SHOW_ADMIN_SUPPORT_DETAILS = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
  }

  public static final class Settings.Global extends android.provider.Settings.NameValueTable {
+0 −1
Original line number Diff line number Diff line
@@ -1018,7 +1018,6 @@ Landroid/os/UserHandle;->PER_USER_RANGE:I
Landroid/os/UserHandle;->USER_ALL:I
Landroid/os/UserHandle;->USER_CURRENT:I
Landroid/os/UserHandle;->USER_CURRENT_OR_SELF:I
Landroid/os/UserHandle;->USER_NULL:I
Landroid/os/UserHandle;->USER_OWNER:I
Landroid/os/UserHandle;->USER_SERIAL_SYSTEM:I
Landroid/os/UserHandle;->USER_SYSTEM:I
+1 −1
Original line number Diff line number Diff line
@@ -4744,7 +4744,7 @@ public class Activity extends ContextThemeWrapper
    /**
     * @hide Implement to provide correct calling token.
     */
    @UnsupportedAppUsage
    @Override
    public void startActivityAsUser(Intent intent, UserHandle user) {
        startActivityAsUser(intent, null, user);
    }
+8 −7
Original line number Diff line number Diff line
@@ -1205,7 +1205,7 @@ public class DevicePolicyManager {
     * @see #createAdminSupportIntent(String)
     * @hide
     */
    @TestApi
    @TestApi @SystemApi
    public static final String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";

    /**
@@ -5142,10 +5142,10 @@ public class DevicePolicyManager {
     * @return ID of the user who runs device owner, or {@link UserHandle#USER_NULL} if there's
     * no device owner.
     *
     * <p>Requires the MANAGE_USERS permission.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    @SystemApi
    public int getDeviceOwnerUserId() {
        if (mService != null) {
            try {
@@ -5565,12 +5565,13 @@ public class DevicePolicyManager {
     * @see #getProfileOwner()
     * @hide
     */
    @UnsupportedAppUsage
    public @Nullable ComponentName getProfileOwnerAsUser(final int userId)
            throws IllegalArgumentException {
    @RequiresPermission(value = android.Manifest.permission.INTERACT_ACROSS_USERS,
            conditional = true)
    @SystemApi
    public @Nullable ComponentName getProfileOwnerAsUser(final int userId) {
        if (mService != null) {
            try {
                return mService.getProfileOwner(userId);
                return mService.getProfileOwnerAsUser(userId);
            } catch (RemoteException re) {
                throw re.rethrowFromSystemServer();
            }
+1 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ interface IDevicePolicyManager {
    int getDeviceOwnerUserId();

    boolean setProfileOwner(in ComponentName who, String ownerName, int userHandle);
    ComponentName getProfileOwnerAsUser(int userHandle);
    ComponentName getProfileOwner(int userHandle);
    String getProfileOwnerName(int userHandle);
    void setProfileEnabled(in ComponentName who);
Loading