Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6395,6 +6395,7 @@ package android.app.admin { method public boolean isBackupServiceEnabled(android.content.ComponentName); method public deprecated boolean isCallerApplicationRestrictionsManagingPackage(); method public boolean isDeviceOwnerApp(java.lang.String); method public boolean isEphemeralUser(android.content.ComponentName); method public boolean isLockTaskPermitted(java.lang.String); method public boolean isLogoutEnabled(); method public boolean isManagedProfile(android.content.ComponentName); core/java/android/app/admin/DevicePolicyManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -6360,6 +6360,21 @@ public class DevicePolicyManager { } } /** * Checks if the profile owner is running in an ephemeral user. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @return whether the profile owner is running in an ephemeral user. */ public boolean isEphemeralUser(@NonNull ComponentName admin) { throwIfParentInstance("isEphemeralUser"); try { return mService.isEphemeralUser(admin); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Retrieves the application restrictions for a given target application running in the calling * user. Loading core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,7 @@ interface IDevicePolicyManager { IApplicationThread caller, IBinder token, in Intent service, IServiceConnection connection, int flags, int targetUserId); List<UserHandle> getBindDeviceAdminTargetUsers(in ComponentName admin); boolean isEphemeralUser(in ComponentName admin); long getLastSecurityLogRetrievalTime(); long getLastBugReportRequestTime(); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +16 −0 Original line number Diff line number Diff line Loading @@ -8540,6 +8540,22 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } } @Override public boolean isEphemeralUser(ComponentName who) { Preconditions.checkNotNull(who, "ComponentName is null"); synchronized (this) { getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); } final int callingUserId = mInjector.userHandleGetCallingUserId(); final long id = mInjector.binderClearCallingIdentity(); try { return mInjector.getUserManager().isUserEphemeral(callingUserId); } finally { mInjector.binderRestoreCallingIdentity(id); } } @Override public Bundle getApplicationRestrictions(ComponentName who, String callerPackage, String packageName) { Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6395,6 +6395,7 @@ package android.app.admin { method public boolean isBackupServiceEnabled(android.content.ComponentName); method public deprecated boolean isCallerApplicationRestrictionsManagingPackage(); method public boolean isDeviceOwnerApp(java.lang.String); method public boolean isEphemeralUser(android.content.ComponentName); method public boolean isLockTaskPermitted(java.lang.String); method public boolean isLogoutEnabled(); method public boolean isManagedProfile(android.content.ComponentName);
core/java/android/app/admin/DevicePolicyManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -6360,6 +6360,21 @@ public class DevicePolicyManager { } } /** * Checks if the profile owner is running in an ephemeral user. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @return whether the profile owner is running in an ephemeral user. */ public boolean isEphemeralUser(@NonNull ComponentName admin) { throwIfParentInstance("isEphemeralUser"); try { return mService.isEphemeralUser(admin); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Retrieves the application restrictions for a given target application running in the calling * user. Loading
core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,7 @@ interface IDevicePolicyManager { IApplicationThread caller, IBinder token, in Intent service, IServiceConnection connection, int flags, int targetUserId); List<UserHandle> getBindDeviceAdminTargetUsers(in ComponentName admin); boolean isEphemeralUser(in ComponentName admin); long getLastSecurityLogRetrievalTime(); long getLastBugReportRequestTime(); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +16 −0 Original line number Diff line number Diff line Loading @@ -8540,6 +8540,22 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } } @Override public boolean isEphemeralUser(ComponentName who) { Preconditions.checkNotNull(who, "ComponentName is null"); synchronized (this) { getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); } final int callingUserId = mInjector.userHandleGetCallingUserId(); final long id = mInjector.binderClearCallingIdentity(); try { return mInjector.getUserManager().isUserEphemeral(callingUserId); } finally { mInjector.binderRestoreCallingIdentity(id); } } @Override public Bundle getApplicationRestrictions(ComponentName who, String callerPackage, String packageName) { Loading