diff options
| author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-11-20 21:17:17 +0000 |
|---|---|---|
| committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-11-24 14:09:39 +0000 |
| commit | ad3c9416092f09213d32eee8b59287766eae5d19 (patch) | |
| tree | 0bc1e318ca15560299c662e37c6c4fedf0bcf1e6 /services/java/com/android/server/connectivity/Tethering.java | |
| parent | 7d114fb838017d86ece76e18a7e1b0d8534595fa (diff) | |
| download | frameworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.zip frameworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.tar.gz frameworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.tar.bz2 | |
Squashed commit of the theme engine support.
Updated 4.2 support for the old T-Mobile theme engine, as usual
needs the provider and switcher apps installed as well.
I'm finally dropping the 400+ commit history on this, since everybody
else keeps picking it up from CM as a single patch anyway... But
for the record, nothing of this would be possible without Josh, Ed,
and the rest of the TMo guys who wrote and maintained it until 2.2:
amit chabra <amit.chabra@t-mobile.com>
Amit Kohli <amit.kohli@t-mobile.com>
Chris Cogar <chriscogar@t-mobile.com>
Dirk Sigurdson <dirk.sigurdson@t-mobile.com>
Ed Carrigan <edward.carrigan@t-mobile.com>
Gaurav Sharma <gaurav.sharma3@t-mobile.com>
Hui Feng <hui.feng@t-mobile.com>
John Ritz <john.ritz1@t-mobile.com>
Josh Guilfoyle <josh.guilfoyle@t-mobile.com>
Mark Roberts <mark.roberts48@t-mobile.com>
Pankaj Kumar <Pankaj.kumar6@t-mobile.com>
Samuel Cheung <samuel.cheung@t-mobile.com>
Sergey Ten <sergey.ten6@t-mobile.com>
Change-Id: I7148d51be48f28a2dc4bdf9ec9018f04b268ffc4
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); |
