diff options
Diffstat (limited to 'services/java/com/android/server/connectivity/Tethering.java')
| -rw-r--r-- | services/java/com/android/server/connectivity/Tethering.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java index e4a7ead..8f154b1 100644 --- a/services/java/com/android/server/connectivity/Tethering.java +++ b/services/java/com/android/server/connectivity/Tethering.java @@ -47,6 +47,7 @@ import android.os.UserHandle; import android.provider.Settings; import android.util.Log; +import com.android.internal.app.ThemeUtils; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneConstants; import com.android.internal.util.IState; @@ -74,6 +75,7 @@ import java.util.Set; public class Tethering extends INetworkManagementEventObserver.Stub { private Context mContext; + private Context mUiContext; private final static String TAG = "Tethering"; private final static boolean DBG = true; private final static boolean VDBG = false; @@ -158,6 +160,13 @@ public class Tethering extends INetworkManagementEventObserver.Stub { filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); mContext.registerReceiver(mStateReceiver, filter); + ThemeUtils.registerThemeChangeReceiver(mContext, new BroadcastReceiver() { + @Override + public void onReceive(Context content, Intent intent) { + mUiContext = null; + } + }); + filter = new IntentFilter(); filter.addAction(Intent.ACTION_MEDIA_SHARED); filter.addAction(Intent.ACTION_MEDIA_UNSHARED); @@ -478,12 +487,19 @@ public class Tethering extends INetworkManagementEventObserver.Stub { mTetheredNotification.defaults &= ~Notification.DEFAULT_SOUND; mTetheredNotification.flags = Notification.FLAG_ONGOING_EVENT; mTetheredNotification.tickerText = title; - mTetheredNotification.setLatestEventInfo(mContext, title, message, pi); + mTetheredNotification.setLatestEventInfo(getUiContext(), title, message, pi); notificationManager.notifyAsUser(null, mTetheredNotification.icon, mTetheredNotification, UserHandle.ALL); } + private Context getUiContext() { + if (mUiContext == null) { + mUiContext = ThemeUtils.createUiContext(mContext); + } + return mUiContext != null ? mUiContext : mContext; + } + private void clearTetheredNotification() { NotificationManager notificationManager = (NotificationManager)mContext.getSystemService(Context.NOTIFICATION_SERVICE); |
