diff options
author | Pavel Grafov <pgrafov@google.com> | 2020-05-01 10:48:27 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-05-01 10:48:27 +0000 |
commit | 9bdf540561969b32b6552b46c5aef092761e2f2c (patch) | |
tree | b7ae415ba7c6002d84981822785ff40f9e356518 /services/devicepolicy | |
parent | ef2f027b68bc26ac38cc72f572f802a0e31fb347 (diff) | |
parent | 35c0f0508cdcc1423603b4d40ba481c96fab87ce (diff) |
Merge "Add button to personal apps suspension notification" into rvc-dev
Diffstat (limited to 'services/devicepolicy')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index d81f31ac4f17..3323fa4b53e3 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -16134,6 +16134,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { final PendingIntent pendingIntent = mInjector.pendingIntentGetBroadcast(mContext, 0 /* requestCode */, intent, PendingIntent.FLAG_UPDATE_CURRENT); + final String buttonText = + mContext.getString(R.string.personal_apps_suspended_turn_profile_on); + final Notification.Action turnProfileOnButton = + new Notification.Action.Builder(null /* icon */, buttonText, pendingIntent).build(); + final String text = mContext.getString( notificationState == PROFILE_OFF_DEADLINE_WARNING ? R.string.personal_apps_suspension_tomorrow_text @@ -16144,11 +16149,13 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { new Notification.Builder(mContext, SystemNotificationChannels.DEVICE_ADMIN) .setSmallIcon(android.R.drawable.stat_sys_warning) .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)) - .setContentIntent(pendingIntent) + .addAction(turnProfileOnButton) .build(); mInjector.getNotificationManager().notify( SystemMessage.NOTE_PERSONAL_APPS_SUSPENDED, notification); |