diff options
author | Benjamin Franz <bfranz@google.com> | 2015-04-22 11:43:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-22 11:43:03 +0000 |
commit | 07ba37a713212e603be3098f1035f2b736fae679 (patch) | |
tree | f19355915b13ad4a5e67d6c347db541a810e8b19 | |
parent | 6d6290d2821c6b1e497e4990c5d42aee1dbc8a29 (diff) | |
parent | 837f1035a608d2d36aef5fb448ec1fbd1d927f5f (diff) | |
download | frameworks_base-07ba37a713212e603be3098f1035f2b736fae679.zip frameworks_base-07ba37a713212e603be3098f1035f2b736fae679.tar.gz frameworks_base-07ba37a713212e603be3098f1035f2b736fae679.tar.bz2 |
Merge "Recover status bar enabled state for all users"
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 8486705..dc7fad6 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -1646,6 +1646,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { syncDeviceCapabilitiesLocked(policy); updateMaximumTimeToLockLocked(policy); updateLockTaskPackagesLocked(policy, userHandle); + if (!policy.mStatusBarEnabledState) { + setStatusBarEnabledStateInternal(policy.mStatusBarEnabledState, userHandle); + } } private void updateLockTaskPackagesLocked(DevicePolicyData policy, int userId) { @@ -1720,7 +1723,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (!mHasFeature) { return; } - DevicePolicyData policy = getUserData(UserHandle.USER_OWNER); + getUserData(UserHandle.USER_OWNER); loadDeviceOwner(); cleanUpOldUsers(); // Register an observer for watching for user setup complete. @@ -1736,11 +1739,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { updateScreenCaptureDisabledInWindowManager(userHandle, getScreenCaptureDisabled(null, userHandle)); } - - if (mDeviceOwner != null && mDeviceOwner.hasDeviceOwner() - && !policy.mStatusBarEnabledState) { - setStatusBarEnabledStateInternal(STATUS_BAR_DISABLE_MASK, UserHandle.USER_OWNER); - } } private void cleanUpOldUsers() { @@ -5911,22 +5909,20 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { DevicePolicyData policy = getUserData(userId); if (policy.mStatusBarEnabledState != enabled) { policy.mStatusBarEnabledState = enabled; - setStatusBarEnabledStateInternal( - enabled ? StatusBarManager.DISABLE_NONE : STATUS_BAR_DISABLE_MASK, - userId); + setStatusBarEnabledStateInternal(enabled, userId); saveSettingsLocked(userId); } } } - private void setStatusBarEnabledStateInternal(int flags, int userId) { + private void setStatusBarEnabledStateInternal(boolean enabled, int userId) { long ident = Binder.clearCallingIdentity(); try { IStatusBarService statusBarService = IStatusBarService.Stub.asInterface( ServiceManager.checkService(Context.STATUS_BAR_SERVICE)); if (statusBarService != null) { - statusBarService.disableForUser(flags, mToken, - mDeviceOwner.getDeviceOwnerPackageName(), userId); + int flags = enabled ? StatusBarManager.DISABLE_NONE : STATUS_BAR_DISABLE_MASK; + statusBarService.disableForUser(flags, mToken, mContext.getPackageName(), userId); } } catch (RemoteException e) { Slog.e(LOG_TAG, "Failed to disable the status bar", e); |