Merge "Fix the issue that App crash on startForeground" into nyc-dev

am: 0df1ca8ab3

* commit '0df1ca8ab34e543b74ed8170bf12c2d5b6eda3a6':
  Fix the issue that App crash on startForeground

Change-Id: Id900ecfa8cef9cd0135edd8f9ece9e0fac89ab3b
This commit is contained in:
Wang Le
2016-05-10 20:39:01 +00:00
committed by android-build-merger

View File

@@ -441,7 +441,7 @@ final class ServiceRecord extends Binder {
Notification localForegroundNoti = _foregroundNoti;
try {
if (localForegroundNoti.getSmallIcon() == null) {
// It is not correct for the caller to supply a notification
// It is not correct for the caller to not supply a notification
// icon, but this used to be able to slip through, so for
// those dirty apps we will create a notification clearly
// blaming the app.
@@ -458,8 +458,8 @@ final class ServiceRecord extends Binder {
}
Context ctx = null;
try {
ctx = ams.mContext.createPackageContext(
appInfo.packageName, 0);
ctx = ams.mContext.createPackageContextAsUser(
appInfo.packageName, 0, new UserHandle(userId));
Notification.Builder notiBuilder = new Notification.Builder(ctx);