Loading core/api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -513,7 +513,7 @@ package android.app.admin { method @RequiresPermission(android.Manifest.permission.FORCE_DEVICE_POLICY_MANAGER_LOGS) public long forceSecurityLogs(); method public void forceUpdateUserSetupComplete(int); method @NonNull public java.util.Set<java.lang.String> getDefaultCrossProfilePackages(); method public int getDeviceOwnerType(@NonNull android.content.ComponentName); method @Deprecated public int getDeviceOwnerType(@NonNull android.content.ComponentName); method @Nullable public String getDevicePolicyManagementRoleHolderUpdaterPackage(); method @NonNull public java.util.Set<java.lang.String> getDisallowedSystemApps(@NonNull android.content.ComponentName, int, @NonNull String); method public long getLastBugReportRequestTime(); Loading core/java/android/app/admin/DevicePolicyManager.java +23 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,12 @@ public class DevicePolicyManager { public static final String DEPRECATE_USERMANAGERINTERNAL_DEVICEPOLICY_FLAG = "deprecate_usermanagerinternal_devicepolicy"; /** @hide */ public static final boolean DEPRECATE_USERMANAGERINTERNAL_DEVICEPOLICY_DEFAULT = false; public static final boolean DEPRECATE_USERMANAGERINTERNAL_DEVICEPOLICY_DEFAULT = true; /** @hide */ public static final String ADD_ISFINANCED_DEVICE_FLAG = "add-isfinanced-device"; /** @hide */ public static final boolean ADD_ISFINANCED_FEVICE_DEFAULT = true; private static String TAG = "DevicePolicyManager"; Loading Loading @@ -15425,10 +15430,13 @@ public class DevicePolicyManager { * * @throws IllegalStateException When admin is not the device owner or there is no device owner. * * @deprecated Use type-specific APIs (e.g. {@link #isFinancedDevice}). * @hide */ @TestApi @DeviceOwnerType @Deprecated // TODO(b/259908270): remove public int getDeviceOwnerType(@NonNull ComponentName admin) { throwIfParentInstance("getDeviceOwnerType"); if (mService != null) { Loading @@ -15441,6 +15449,20 @@ public class DevicePolicyManager { return DEVICE_OWNER_TYPE_DEFAULT; } /** * {@code true} if this device is financed. * @hide */ @RequiresPermission(anyOf = { android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS }) public boolean isFinancedDevice() { return isDeviceManaged() && getDeviceOwnerType(getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } /** * Called by device owner or profile owner of an organization-owned managed profile to * enable or disable USB data signaling for the device. When disabled, USB data connections packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledByAdminControllerFactory.java +7 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.ParentalControlsUtilsInternal; import android.os.UserHandle; import android.os.UserManager; import android.provider.DeviceConfig; import android.text.TextUtils; /** Loading Loading @@ -82,6 +83,12 @@ public final class ActionDisabledByAdminControllerFactory { private static boolean isFinancedDevice(Context context) { DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); // TODO(b/259908270): remove if (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, DevicePolicyManager.ADD_ISFINANCED_DEVICE_FLAG, DevicePolicyManager.ADD_ISFINANCED_FEVICE_DEFAULT)) { return dpm.isFinancedDevice(); } return dpm.isDeviceManaged() && dpm.getDeviceOwnerType( dpm.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } Loading packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooterUtils.java +15 −7 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Looper; import android.os.UserManager; import android.provider.DeviceConfig; import android.provider.Settings; import android.text.SpannableStringBuilder; import android.text.method.LinkMovementMethod; Loading Loading @@ -770,13 +771,6 @@ public class QSSecurityFooterUtils implements DialogInterface.OnClickListener { } } private boolean isFinancedDevice() { return mSecurityController.isDeviceManaged() && mSecurityController.getDeviceOwnerType( mSecurityController.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } protected class VpnSpan extends ClickableSpan { @Override public void onClick(View widget) { Loading @@ -797,4 +791,18 @@ public class QSSecurityFooterUtils implements DialogInterface.OnClickListener { return 314159257; // prime } } // TODO(b/259908270): remove and inline direct call to mSecurityController.isFinancedDevice() private boolean isFinancedDevice() { if (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, DevicePolicyManager.ADD_ISFINANCED_DEVICE_FLAG, DevicePolicyManager.ADD_ISFINANCED_FEVICE_DEFAULT)) { return mSecurityController.isFinancedDevice(); } else { return mSecurityController.isDeviceManaged() && mSecurityController.getDeviceOwnerType( mSecurityController.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } } } packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +16 −4 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import android.os.Message; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.provider.DeviceConfig; import android.text.TextUtils; import android.text.format.Formatter; import android.view.View; Loading Loading @@ -413,14 +414,25 @@ public class KeyguardIndicationController { private CharSequence getDisclosureText(@Nullable CharSequence organizationName) { final Resources packageResources = mContext.getResources(); // TODO(b/259908270): remove and inline boolean isFinanced; if (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, DevicePolicyManager.ADD_ISFINANCED_DEVICE_FLAG, DevicePolicyManager.ADD_ISFINANCED_FEVICE_DEFAULT)) { isFinanced = mDevicePolicyManager.isFinancedDevice(); } else { isFinanced = mDevicePolicyManager.isDeviceManaged() && mDevicePolicyManager.getDeviceOwnerType( mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } if (organizationName == null) { return mDevicePolicyManager.getResources().getString( KEYGUARD_MANAGEMENT_DISCLOSURE, () -> packageResources.getString(R.string.do_disclosure_generic)); } else if (mDevicePolicyManager.isDeviceManaged() && mDevicePolicyManager.getDeviceOwnerType( mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED) { } else if (isFinanced) { return packageResources.getString(R.string.do_financed_disclosure_with_name, organizationName); } else { Loading Loading
core/api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -513,7 +513,7 @@ package android.app.admin { method @RequiresPermission(android.Manifest.permission.FORCE_DEVICE_POLICY_MANAGER_LOGS) public long forceSecurityLogs(); method public void forceUpdateUserSetupComplete(int); method @NonNull public java.util.Set<java.lang.String> getDefaultCrossProfilePackages(); method public int getDeviceOwnerType(@NonNull android.content.ComponentName); method @Deprecated public int getDeviceOwnerType(@NonNull android.content.ComponentName); method @Nullable public String getDevicePolicyManagementRoleHolderUpdaterPackage(); method @NonNull public java.util.Set<java.lang.String> getDisallowedSystemApps(@NonNull android.content.ComponentName, int, @NonNull String); method public long getLastBugReportRequestTime(); Loading
core/java/android/app/admin/DevicePolicyManager.java +23 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,12 @@ public class DevicePolicyManager { public static final String DEPRECATE_USERMANAGERINTERNAL_DEVICEPOLICY_FLAG = "deprecate_usermanagerinternal_devicepolicy"; /** @hide */ public static final boolean DEPRECATE_USERMANAGERINTERNAL_DEVICEPOLICY_DEFAULT = false; public static final boolean DEPRECATE_USERMANAGERINTERNAL_DEVICEPOLICY_DEFAULT = true; /** @hide */ public static final String ADD_ISFINANCED_DEVICE_FLAG = "add-isfinanced-device"; /** @hide */ public static final boolean ADD_ISFINANCED_FEVICE_DEFAULT = true; private static String TAG = "DevicePolicyManager"; Loading Loading @@ -15425,10 +15430,13 @@ public class DevicePolicyManager { * * @throws IllegalStateException When admin is not the device owner or there is no device owner. * * @deprecated Use type-specific APIs (e.g. {@link #isFinancedDevice}). * @hide */ @TestApi @DeviceOwnerType @Deprecated // TODO(b/259908270): remove public int getDeviceOwnerType(@NonNull ComponentName admin) { throwIfParentInstance("getDeviceOwnerType"); if (mService != null) { Loading @@ -15441,6 +15449,20 @@ public class DevicePolicyManager { return DEVICE_OWNER_TYPE_DEFAULT; } /** * {@code true} if this device is financed. * @hide */ @RequiresPermission(anyOf = { android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS }) public boolean isFinancedDevice() { return isDeviceManaged() && getDeviceOwnerType(getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } /** * Called by device owner or profile owner of an organization-owned managed profile to * enable or disable USB data signaling for the device. When disabled, USB data connections
packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledByAdminControllerFactory.java +7 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.ParentalControlsUtilsInternal; import android.os.UserHandle; import android.os.UserManager; import android.provider.DeviceConfig; import android.text.TextUtils; /** Loading Loading @@ -82,6 +83,12 @@ public final class ActionDisabledByAdminControllerFactory { private static boolean isFinancedDevice(Context context) { DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); // TODO(b/259908270): remove if (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, DevicePolicyManager.ADD_ISFINANCED_DEVICE_FLAG, DevicePolicyManager.ADD_ISFINANCED_FEVICE_DEFAULT)) { return dpm.isFinancedDevice(); } return dpm.isDeviceManaged() && dpm.getDeviceOwnerType( dpm.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } Loading
packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooterUtils.java +15 −7 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Looper; import android.os.UserManager; import android.provider.DeviceConfig; import android.provider.Settings; import android.text.SpannableStringBuilder; import android.text.method.LinkMovementMethod; Loading Loading @@ -770,13 +771,6 @@ public class QSSecurityFooterUtils implements DialogInterface.OnClickListener { } } private boolean isFinancedDevice() { return mSecurityController.isDeviceManaged() && mSecurityController.getDeviceOwnerType( mSecurityController.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } protected class VpnSpan extends ClickableSpan { @Override public void onClick(View widget) { Loading @@ -797,4 +791,18 @@ public class QSSecurityFooterUtils implements DialogInterface.OnClickListener { return 314159257; // prime } } // TODO(b/259908270): remove and inline direct call to mSecurityController.isFinancedDevice() private boolean isFinancedDevice() { if (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, DevicePolicyManager.ADD_ISFINANCED_DEVICE_FLAG, DevicePolicyManager.ADD_ISFINANCED_FEVICE_DEFAULT)) { return mSecurityController.isFinancedDevice(); } else { return mSecurityController.isDeviceManaged() && mSecurityController.getDeviceOwnerType( mSecurityController.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } } }
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +16 −4 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import android.os.Message; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.provider.DeviceConfig; import android.text.TextUtils; import android.text.format.Formatter; import android.view.View; Loading Loading @@ -413,14 +414,25 @@ public class KeyguardIndicationController { private CharSequence getDisclosureText(@Nullable CharSequence organizationName) { final Resources packageResources = mContext.getResources(); // TODO(b/259908270): remove and inline boolean isFinanced; if (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, DevicePolicyManager.ADD_ISFINANCED_DEVICE_FLAG, DevicePolicyManager.ADD_ISFINANCED_FEVICE_DEFAULT)) { isFinanced = mDevicePolicyManager.isFinancedDevice(); } else { isFinanced = mDevicePolicyManager.isDeviceManaged() && mDevicePolicyManager.getDeviceOwnerType( mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED; } if (organizationName == null) { return mDevicePolicyManager.getResources().getString( KEYGUARD_MANAGEMENT_DISCLOSURE, () -> packageResources.getString(R.string.do_disclosure_generic)); } else if (mDevicePolicyManager.isDeviceManaged() && mDevicePolicyManager.getDeviceOwnerType( mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED) { } else if (isFinanced) { return packageResources.getString(R.string.do_financed_disclosure_with_name, organizationName); } else { Loading