summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy/java
diff options
context:
space:
mode:
authorRobin Lee <rgl@google.com>2014-11-26 12:09:33 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-26 12:09:33 +0000
commite07f2c01afbc2d38ce7252a9bbc55fae4b5ea1e6 (patch)
tree9e3dd2af8fc313a14da7f391a3358243723b4264 /services/devicepolicy/java
parent3c96a2b8fe4b52a8617e84c8aced43326d964f55 (diff)
parenta7ffed86fce0a0cab8915bd6a727605959f08bb7 (diff)
downloadframeworks_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.java12
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();