diff options
Diffstat (limited to 'services/java/com/android/server/NotificationManagerService.java')
| -rwxr-xr-x | services/java/com/android/server/NotificationManagerService.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index af49135..5f0187c 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -79,6 +79,9 @@ import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; import java.io.File; + +import com.android.internal.app.ThemeUtils; + import java.io.FileDescriptor; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -122,6 +125,7 @@ public class NotificationManagerService extends INotificationManager.Stub private static final boolean ENABLE_BLOCKED_TOASTS = true; final Context mContext; + Context mUiContext; final IActivityManager mAm; final IBinder mForegroundToken = new Binder(); @@ -533,6 +537,13 @@ public class NotificationManagerService extends INotificationManager.Stub } }; + private BroadcastReceiver mThemeChangeReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + mUiContext = null; + } + }; + private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -766,6 +777,7 @@ public class NotificationManagerService extends INotificationManager.Stub ledObserver.observe(); QuietHoursSettingsObserver qhObserver = new QuietHoursSettingsObserver(mHandler); qhObserver.observe(); + ThemeUtils.registerThemeChangeReceiver(mContext, mThemeChangeReceiver); } void systemReady() { @@ -1634,6 +1646,13 @@ public class NotificationManagerService extends INotificationManager.Stub return -1; } + private Context getUiContext() { + if (mUiContext == null) { + mUiContext = ThemeUtils.createUiContext(mContext); + } + return mUiContext != null ? mUiContext : mContext; + } + private void updateNotificationPulse() { synchronized (mNotificationList) { updateLightsLocked(); |
