diff options
| author | 2013-05-03 12:07:51 -0700 | |
|---|---|---|
| committer | 2013-05-03 12:07:51 -0700 | |
| commit | ca92a4c38f8b4763cd72690091b3a5bbbd7c973a (patch) | |
| tree | fcbb423bb59c25e1b3801bcc70499b36e77dd185 | |
| parent | 856a5a860e11a85f8fbb1ad07f6ef444abeafbaf (diff) | |
Fix issue #8798662: NPE in...
...com.android.server.am.ServiceRecord.postNotification()
Change-Id: I3403bc50eb95d410183fc60ef252775a688b6290
| -rw-r--r-- | services/java/com/android/server/am/ServiceRecord.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/services/java/com/android/server/am/ServiceRecord.java b/services/java/com/android/server/am/ServiceRecord.java index fccaab56a9e1..9fdd293f8382 100644 --- a/services/java/com/android/server/am/ServiceRecord.java +++ b/services/java/com/android/server/am/ServiceRecord.java @@ -371,15 +371,15 @@ class ServiceRecord extends Binder { return; } try { - if (foregroundNoti.icon == 0) { + if (localForegroundNoti.icon == 0) { // It is not correct for the caller to supply a notification // icon, but this used to be able to slip through, so for // those dirty apps give it the app's icon. - foregroundNoti.icon = appInfo.icon; + localForegroundNoti.icon = appInfo.icon; // Do not allow apps to present a sneaky invisible content view either. - foregroundNoti.contentView = null; - foregroundNoti.bigContentView = null; + localForegroundNoti.contentView = null; + localForegroundNoti.bigContentView = null; CharSequence appName = appInfo.loadLabel( ams.mContext.getPackageManager()); if (appName == null) { @@ -395,7 +395,7 @@ class ServiceRecord extends Binder { appInfo.packageName, null)); PendingIntent pi = PendingIntent.getActivity(ams.mContext, 0, runningIntent, PendingIntent.FLAG_UPDATE_CURRENT); - foregroundNoti.setLatestEventInfo(ctx, + localForegroundNoti.setLatestEventInfo(ctx, ams.mContext.getString( com.android.internal.R.string .app_running_notification_title, @@ -406,10 +406,10 @@ class ServiceRecord extends Binder { appName), pi); } catch (PackageManager.NameNotFoundException e) { - foregroundNoti.icon = 0; + localForegroundNoti.icon = 0; } } - if (foregroundNoti.icon == 0) { + if (localForegroundNoti.icon == 0) { // Notifications whose icon is 0 are defined to not show // a notification, silently ignoring it. We don't want to // just ignore it, we want to prevent the service from |