diff options
author | Robin Lee <rgl@google.com> | 2014-11-26 12:09:33 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-26 12:09:33 +0000 |
commit | e07f2c01afbc2d38ce7252a9bbc55fae4b5ea1e6 (patch) | |
tree | 9e3dd2af8fc313a14da7f391a3358243723b4264 /services/devicepolicy/java | |
parent | 3c96a2b8fe4b52a8617e84c8aced43326d964f55 (diff) | |
parent | a7ffed86fce0a0cab8915bd6a727605959f08bb7 (diff) | |
download | frameworks_base-e07f2c01afbc2d38ce7252a9bbc55fae4b5ea1e6.zip frameworks_base-e07f2c01afbc2d38ce7252a9bbc55fae4b5ea1e6.tar.gz frameworks_base-e07f2c01afbc2d38ce7252a9bbc55fae4b5ea1e6.tar.bz2 |
am a7ffed86: am cc19e8b8: am 692e4933: Merge "DevicePolicy: Don\'t warn about managed profile CAs" into lmp-mr1-dev
* commit 'a7ffed86fce0a0cab8915bd6a727605959f08bb7':
DevicePolicy: Don't warn about managed profile CAs
Diffstat (limited to 'services/devicepolicy/java')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 8cf34c9..f3d92e5 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -97,7 +97,6 @@ import com.android.internal.util.FastXmlSerializer; import com.android.internal.util.JournaledFile; import com.android.internal.util.XmlUtils; import com.android.internal.widget.LockPatternUtils; -import com.android.org.conscrypt.TrustedCertificateStore; import com.android.server.LocalServices; import com.android.server.SystemService; import com.android.server.devicepolicy.DevicePolicyManagerService.ActiveAdmin.TrustAgentInfo; @@ -1646,12 +1645,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } private void manageNotification(UserHandle userHandle) { + final UserInfo userInfo = mUserManager.getUserInfo(userHandle.getIdentifier()); + + // Inactive users or managed profiles shouldn't provoke a warning if (!mUserManager.isUserRunning(userHandle)) { return; } + if (userInfo == null || userInfo.isManagedProfile()) { + return; + } + // Call out to KeyChain to check for user-added CAs boolean hasCert = false; - final long id = Binder.clearCallingIdentity(); try { KeyChainConnection kcs = KeyChain.bindAsUser(mContext, userHandle); try { @@ -1667,8 +1672,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Thread.currentThread().interrupt(); } catch (RuntimeException e) { Log.e(LOG_TAG, "Could not connect to KeyChain service", e); - } finally { - Binder.restoreCallingIdentity(id); } if (!hasCert) { getNotificationManager().cancelAsUser( @@ -1676,6 +1679,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return; } + // Build and show a warning notification int smallIconId; String contentText; final String ownerName = getDeviceOwnerName(); |