From 279544c35ae50c2e06b1d5559ff31e86a93e5a21 Mon Sep 17 00:00:00 2001 From: luozhanwei Date: Wed, 5 Apr 2017 13:30:53 +0800 Subject: [PATCH] Fix the notification issue shown on startForeground Install single APP in any user space except Owner user. The APP will show a notification when call startForeground in Service Component with Notification which without SmallIcon. But when you click the notificaiton ,you can't go to the InstalledAppDetails Activity. Bug:https://code.google.com/p/android/issues/detail?id=330486 Change-Id: I9545c37bf1a36515813cbf1124c82c1c0fc3ad21 Signed-off-by: luozhanwei --- services/core/java/com/android/server/am/ServiceRecord.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java index 71c7fd348fb3d..2e74eb9fa3649 100644 --- a/services/core/java/com/android/server/am/ServiceRecord.java +++ b/services/core/java/com/android/server/am/ServiceRecord.java @@ -493,8 +493,9 @@ final class ServiceRecord extends Binder { Settings.ACTION_APPLICATION_DETAILS_SETTINGS); runningIntent.setData(Uri.fromParts("package", appInfo.packageName, null)); - PendingIntent pi = PendingIntent.getActivity(ams.mContext, 0, - runningIntent, PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent pi = PendingIntent.getActivityAsUser(ams.mContext, 0, + runningIntent, PendingIntent.FLAG_UPDATE_CURRENT, null, + UserHandle.of(userId)); notiBuilder.setColor(ams.mContext.getColor( com.android.internal .R.color.system_notification_accent_color));