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 4239e55..db19cfd 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.SystemProperties; import android.provider.Settings; import android.util.Log; +import com.android.internal.app.ThemeUtils; import com.android.internal.telephony.Phone; import com.android.internal.util.HierarchicalState; import com.android.internal.util.HierarchicalStateMachine; @@ -69,6 +70,7 @@ import java.util.Set; public class Tethering extends INetworkManagementEventObserver.Stub { private Context mContext; + private Context mUiContext; private final String TAG = "Tethering"; private boolean mBooted = false; @@ -148,6 +150,13 @@ public class Tethering extends INetworkManagementEventObserver.Stub { filter.addAction(Intent.ACTION_BOOT_COMPLETED); 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); @@ -422,11 +431,18 @@ 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.notify(mTetheredNotification.icon, mTetheredNotification); } + 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); |