summaryrefslogtreecommitdiff
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorPavel Grafov <pgrafov@google.com>2020-05-07 11:01:58 +0100
committerPavel Grafov <pgrafov@google.com>2020-05-10 17:31:55 +0100
commitf89d3f9f6459b4a3a871116a2242b81fd56ac06e (patch)
treee9d7aaebc899f523b6e3647899b98c2da40facd4 /services/devicepolicy
parent83dd0adecb9c7ae6ae4e0747e6dd75d86334a13f (diff)
Make notification match the mocks.
* Now it is of nice blue colour, lighter in night theme. * Uses suitcase icon instead of warning sign. * Shows "Work profile" instead of "Android system" as the source. note: I reused a string for "Work profile", which has the same content, but different purpose. This is not ideal, but we are way past the deadline. Bug: 155612405 Test: manual, with TestDPC Change-Id: I8298401742085b1738de384e3fe0e612a8142607
Diffstat (limited to 'services/devicepolicy')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 966694ad346c..e44f86232315 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -16150,18 +16150,24 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
? R.string.personal_apps_suspension_tomorrow_text
: R.string.personal_apps_suspension_text);
final boolean ongoing = notificationState == PROFILE_OFF_DEADLINE_REACHED;
+ final int color = mContext.getColor(R.color.personal_apps_suspension_notification_color);
+ final Bundle extras = new Bundle();
+ // TODO: Create a separate string for this.
+ extras.putString(Notification.EXTRA_SUBSTITUTE_APP_NAME,
+ mContext.getString(R.string.notification_work_profile_content_description));
final Notification notification =
new Notification.Builder(mContext, SystemNotificationChannels.DEVICE_ADMIN)
- .setSmallIcon(android.R.drawable.stat_sys_warning)
+ .setSmallIcon(R.drawable.ic_corp_badge_no_background)
.setOngoing(ongoing)
.setAutoCancel(false)
.setContentTitle(mContext.getString(
R.string.personal_apps_suspension_title))
.setContentText(text)
.setStyle(new Notification.BigTextStyle().bigText(text))
- .setColor(mContext.getColor(R.color.system_notification_accent_color))
+ .setColor(color)
.addAction(turnProfileOnButton)
+ .addExtras(extras)
.build();
mInjector.getNotificationManager().notify(
SystemMessage.NOTE_PERSONAL_APPS_SUSPENDED, notification);