diff options
author | Robin Lee <rgl@google.com> | 2014-11-25 19:10:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-25 19:11:00 +0000 |
commit | 692e4933f01f5f7d0c16dcbcd96127897d054511 (patch) | |
tree | 2ca85a61ca4a1306b25ba0f345719ae0b3d271af | |
parent | ee6606519d22805c1caf23a3c75cde9fc97b34eb (diff) | |
parent | 80559f4aadb3419eecdf6bf61945af584cd2aa8a (diff) | |
download | frameworks_base-692e4933f01f5f7d0c16dcbcd96127897d054511.zip frameworks_base-692e4933f01f5f7d0c16dcbcd96127897d054511.tar.gz frameworks_base-692e4933f01f5f7d0c16dcbcd96127897d054511.tar.bz2 |
Merge "DevicePolicy: Don't warn about managed profile CAs" into lmp-mr1-dev
-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 6331dfe..b0d87e9 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -96,7 +96,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; @@ -1645,12 +1644,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 { @@ -1666,8 +1671,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( @@ -1675,6 +1678,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return; } + // Build and show a warning notification int smallIconId; String contentText; final String ownerName = getDeviceOwnerName(); |