From e952e69b3177d3324696901a644160d4b24423be Mon Sep 17 00:00:00 2001 From: AdrianoC Date: Mon, 26 Mar 2012 21:10:20 +0200 Subject: Fix wrong 'USB debugging connected' notify color Change-Id: I8ad4ce8652325e2e10dd529a934c8928ee0b149c --- services/java/com/android/server/NotificationManagerService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index a2bfe78..2d3efa0 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -1819,7 +1819,14 @@ public class NotificationManagerService extends INotificationManager.Stub PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0); - mAdbNotification.setLatestEventInfo(mContext, title, message, pi); + try { + //The service context doesn't contain the style needed to skin the notification in the Status Bar + Context c = mContext.createPackageContext("com.android.systemui",Context.CONTEXT_RESTRICTED); + mAdbNotification.setLatestEventInfo(c, title, message, pi); + } catch(Exception ex) { + //Program would NEVER follow this path. If so we use the current context + mAdbNotification.setLatestEventInfo(mContext, title, message, pi); + } mAdbNotificationShown = true; mAdbNotificationIsUsb = !networkEnabled; -- cgit v1.1