summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorAlex Chau <alexchau@google.com>2015-06-30 14:54:15 +0100
committerAlex Chau <alexchau@google.com>2015-06-30 15:19:55 +0100
commit7ce2bd2161405cef9740a6f14d586a8964dad3e0 (patch)
treeb599dec0994ab2445c81ec2fd55bba7417c1b1b8 /services/devicepolicy
parentf62f4c94a36f5c2f7ad3c70316dc585ea3fd721a (diff)
downloadframeworks_base-7ce2bd2161405cef9740a6f14d586a8964dad3e0.zip
frameworks_base-7ce2bd2161405cef9740a6f14d586a8964dad3e0.tar.gz
frameworks_base-7ce2bd2161405cef9740a6f14d586a8964dad3e0.tar.bz2
Clear "profile wiped" notification when a new porfile is created
Make use of ACTION_MANAGED_PROFILE_ADDED to clear the notification. Bug: 22186884 Change-Id: I08514ebc308f2e2fb61f837500e2ba712ccf8703
Diffstat (limited to 'services/devicepolicy')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 0670cd2..5040bd0 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -390,6 +390,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
} else if (Intent.ACTION_PACKAGE_REMOVED.equals(action)
&& !intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
handlePackagesChanged(intent.getData().getSchemeSpecificPart(), userHandle);
+ } else if (Intent.ACTION_MANAGED_PROFILE_ADDED.equals(action)) {
+ clearWipeProfileNotification();
}
}
};
@@ -1067,6 +1069,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
filter.addAction(Intent.ACTION_PACKAGE_ADDED);
filter.addDataScheme("package");
context.registerReceiverAsUser(mReceiver, UserHandle.ALL, filter, null, mHandler);
+ filter = new IntentFilter();
+ filter.addAction(Intent.ACTION_MANAGED_PROFILE_ADDED);
+ context.registerReceiverAsUser(mReceiver, UserHandle.ALL, filter, null, mHandler);
LocalServices.addService(DevicePolicyManagerInternal.class, mLocalService);
}
@@ -3409,6 +3414,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
getNotificationManager().notify(PROFILE_WIPED_NOTIFICATION_ID, notification);
}
+ private void clearWipeProfileNotification() {
+ getNotificationManager().cancel(PROFILE_WIPED_NOTIFICATION_ID);
+ }
+
@Override
public void getRemoveWarning(ComponentName comp, final RemoteCallback result, int userHandle) {
if (!mHasFeature) {