diff options
author | Danny Baumann <dannybaumann@web.de> | 2012-04-11 13:47:45 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2012-05-02 14:53:43 +0200 |
commit | a750cb3e114d402079f71aefb037511e53a47085 (patch) | |
tree | 5928458900c6e58052974bc94e960031b5989cb9 /services/java/com/android/server/DeviceStorageMonitorService.java | |
parent | 0521546b7df7186d21b0a43571171ae3c30b634f (diff) | |
download | frameworks_base-a750cb3e114d402079f71aefb037511e53a47085.zip frameworks_base-a750cb3e114d402079f71aefb037511e53a47085.tar.gz frameworks_base-a750cb3e114d402079f71aefb037511e53a47085.tar.bz2 |
Applying theming to more framework items.
All dialogs and notifications should be covered now.
Change-Id: If93f81991361165a00b5b1b03ffc323e3ab42c0b
Diffstat (limited to 'services/java/com/android/server/DeviceStorageMonitorService.java')
-rw-r--r-- | services/java/com/android/server/DeviceStorageMonitorService.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/services/java/com/android/server/DeviceStorageMonitorService.java b/services/java/com/android/server/DeviceStorageMonitorService.java index d056cf6..1568b1b 100644 --- a/services/java/com/android/server/DeviceStorageMonitorService.java +++ b/services/java/com/android/server/DeviceStorageMonitorService.java @@ -16,10 +16,13 @@ package com.android.server; +import com.android.internal.app.ThemeUtils; import com.android.server.am.ActivityManagerService; + import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; +import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; @@ -76,6 +79,7 @@ class DeviceStorageMonitorService extends Binder { private boolean mLowMemFlag=false; private boolean mMemFullFlag=false; private Context mContext; + private Context mUiContext; private ContentResolver mContentResolver; private long mTotalMemory; // on /data/data private StatFs mDataFileStats; @@ -302,6 +306,14 @@ class DeviceStorageMonitorService extends Binder { mLastReportedFreeMemTime = 0; mContext = context; mContentResolver = mContext.getContentResolver(); + + ThemeUtils.registerThemeChangeReceiver(mContext, new BroadcastReceiver() { + @Override + public void onReceive(Context content, Intent intent) { + mUiContext = null; + } + }); + //create StatFs object mDataFileStats = new StatFs(DATA_PATH); mSystemFileStats = new StatFs(SYSTEM_PATH); @@ -349,7 +361,7 @@ class DeviceStorageMonitorService extends Binder { notification.icon = com.android.internal.R.drawable.stat_notify_disk_full; notification.tickerText = title; notification.flags |= Notification.FLAG_NO_CLEAR; - notification.setLatestEventInfo(mContext, title, details, intent); + notification.setLatestEventInfo(getUiContext(), title, details, intent); mNotificationMgr.notify(LOW_MEMORY_NOTIFICATION_ID, notification); mContext.sendStickyBroadcast(mStorageLowIntent); } @@ -394,4 +406,11 @@ class DeviceStorageMonitorService extends Binder { // force an early check postCheckMemoryMsg(true, 0); } + + private Context getUiContext() { + if (mUiContext == null) { + mUiContext = ThemeUtils.createUiContext(mContext); + } + return mUiContext != null ? mUiContext : mContext; + } } |