Loading core/java/android/accounts/AccountManagerService.java +19 −2 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import com.android.internal.R; import com.android.internal.app.ThemeUtils; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.TelephonyIntents; Loading @@ -90,6 +91,7 @@ public class AccountManagerService private static final int DATABASE_VERSION = 4; private final Context mContext; private Context mUiContext; private final PackageManager mPackageManager; Loading Loading @@ -155,6 +157,12 @@ public class AccountManagerService private static AtomicReference<AccountManagerService> sThis = new AtomicReference<AccountManagerService>(); private BroadcastReceiver mThemeChangeReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { mUiContext = null; } }; private static final boolean isDebuggableMonkeyBuild = SystemProperties.getBoolean("ro.monkey", false); private static final Account[] EMPTY_ACCOUNT_ARRAY = new Account[]{}; Loading Loading @@ -226,6 +234,8 @@ public class AccountManagerService mAuthenticatorCache = new AccountAuthenticatorCache(mContext); mAuthenticatorCache.setListener(this, null /* Handler */); ThemeUtils.registerThemeChangeReceiver(mContext, mThemeChangeReceiver); sThis.set(this); validateAccounts(); Loading Loading @@ -988,7 +998,7 @@ public class AccountManagerService final int index = titleAndSubtitle.indexOf('\n'); final String title = titleAndSubtitle.substring(0, index); final String subtitle = titleAndSubtitle.substring(index + 1); n.setLatestEventInfo(mContext, n.setLatestEventInfo(getUiContext(), title, subtitle, PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)); ((NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE)) Loading Loading @@ -1768,7 +1778,7 @@ public class AccountManagerService 0 /* when */); final String notificationTitleFormat = mContext.getText(R.string.notification_title).toString(); n.setLatestEventInfo(mContext, n.setLatestEventInfo(getUiContext(), String.format(notificationTitleFormat, account.name), message, PendingIntent.getActivity( mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)); Loading @@ -1790,6 +1800,13 @@ public class AccountManagerService } } private Context getUiContext() { if (mUiContext == null) { mUiContext = ThemeUtils.createUiContext(mContext); } return mUiContext != null ? mUiContext : mContext; } /** Succeeds if any of the specified permissions are granted. */ private void checkBinderPermission(String... permissions) { final int uid = Binder.getCallingUid(); Loading telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +20 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.util.EventLog; import android.util.Log; import android.util.TimeUtils; import com.android.internal.app.ThemeUtils; import com.android.internal.telephony.CommandException; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.DataConnectionTracker; Loading Loading @@ -140,6 +141,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker { */ private Notification mNotification; private Context mUiContext; /** Wake lock used while setting time of day. */ private PowerManager.WakeLock mWakeLock; private static final String WAKELOCK_TAG = "ServiceStateTracker"; Loading Loading @@ -176,6 +179,12 @@ final class GsmServiceStateTracker extends ServiceStateTracker { } }; private BroadcastReceiver mThemeChangeReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { mUiContext = null; } }; private ContentObserver mAutoTimeObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange) { Loading Loading @@ -226,6 +235,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker { IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_LOCALE_CHANGED); phone.getContext().registerReceiver(mIntentReceiver, filter); ThemeUtils.registerThemeChangeReceiver(phone.getContext(), mThemeChangeReceiver); } public void dispose() { Loading Loading @@ -1361,6 +1372,14 @@ final class GsmServiceStateTracker extends ServiceStateTracker { return a*10 + b; } private Context getUiContext() { Context mainContext = phone.getContext(); if (mUiContext == null) { mUiContext = ThemeUtils.createUiContext(mainContext); } return mUiContext != null ? mUiContext : mainContext; } /** * @return The current GPRS state. IN_SERVICE is the same as "attached" * and OUT_OF_SERVICE is the same as detached. Loading Loading @@ -1678,7 +1697,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { Log.d(LOG_TAG, "[DSAC DEB] " + "put notification " + title + " / " +details); mNotification.tickerText = title; mNotification.setLatestEventInfo(context, title, details, mNotification.setLatestEventInfo(getUiContext(), title, details, mNotification.contentIntent); NotificationManager notificationManager = (NotificationManager) Loading Loading
core/java/android/accounts/AccountManagerService.java +19 −2 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import com.android.internal.R; import com.android.internal.app.ThemeUtils; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.TelephonyIntents; Loading @@ -90,6 +91,7 @@ public class AccountManagerService private static final int DATABASE_VERSION = 4; private final Context mContext; private Context mUiContext; private final PackageManager mPackageManager; Loading Loading @@ -155,6 +157,12 @@ public class AccountManagerService private static AtomicReference<AccountManagerService> sThis = new AtomicReference<AccountManagerService>(); private BroadcastReceiver mThemeChangeReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { mUiContext = null; } }; private static final boolean isDebuggableMonkeyBuild = SystemProperties.getBoolean("ro.monkey", false); private static final Account[] EMPTY_ACCOUNT_ARRAY = new Account[]{}; Loading Loading @@ -226,6 +234,8 @@ public class AccountManagerService mAuthenticatorCache = new AccountAuthenticatorCache(mContext); mAuthenticatorCache.setListener(this, null /* Handler */); ThemeUtils.registerThemeChangeReceiver(mContext, mThemeChangeReceiver); sThis.set(this); validateAccounts(); Loading Loading @@ -988,7 +998,7 @@ public class AccountManagerService final int index = titleAndSubtitle.indexOf('\n'); final String title = titleAndSubtitle.substring(0, index); final String subtitle = titleAndSubtitle.substring(index + 1); n.setLatestEventInfo(mContext, n.setLatestEventInfo(getUiContext(), title, subtitle, PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)); ((NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE)) Loading Loading @@ -1768,7 +1778,7 @@ public class AccountManagerService 0 /* when */); final String notificationTitleFormat = mContext.getText(R.string.notification_title).toString(); n.setLatestEventInfo(mContext, n.setLatestEventInfo(getUiContext(), String.format(notificationTitleFormat, account.name), message, PendingIntent.getActivity( mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)); Loading @@ -1790,6 +1800,13 @@ public class AccountManagerService } } private Context getUiContext() { if (mUiContext == null) { mUiContext = ThemeUtils.createUiContext(mContext); } return mUiContext != null ? mUiContext : mContext; } /** Succeeds if any of the specified permissions are granted. */ private void checkBinderPermission(String... permissions) { final int uid = Binder.getCallingUid(); Loading
telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +20 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.util.EventLog; import android.util.Log; import android.util.TimeUtils; import com.android.internal.app.ThemeUtils; import com.android.internal.telephony.CommandException; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.DataConnectionTracker; Loading Loading @@ -140,6 +141,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker { */ private Notification mNotification; private Context mUiContext; /** Wake lock used while setting time of day. */ private PowerManager.WakeLock mWakeLock; private static final String WAKELOCK_TAG = "ServiceStateTracker"; Loading Loading @@ -176,6 +179,12 @@ final class GsmServiceStateTracker extends ServiceStateTracker { } }; private BroadcastReceiver mThemeChangeReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { mUiContext = null; } }; private ContentObserver mAutoTimeObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange) { Loading Loading @@ -226,6 +235,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker { IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_LOCALE_CHANGED); phone.getContext().registerReceiver(mIntentReceiver, filter); ThemeUtils.registerThemeChangeReceiver(phone.getContext(), mThemeChangeReceiver); } public void dispose() { Loading Loading @@ -1361,6 +1372,14 @@ final class GsmServiceStateTracker extends ServiceStateTracker { return a*10 + b; } private Context getUiContext() { Context mainContext = phone.getContext(); if (mUiContext == null) { mUiContext = ThemeUtils.createUiContext(mainContext); } return mUiContext != null ? mUiContext : mainContext; } /** * @return The current GPRS state. IN_SERVICE is the same as "attached" * and OUT_OF_SERVICE is the same as detached. Loading Loading @@ -1678,7 +1697,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { Log.d(LOG_TAG, "[DSAC DEB] " + "put notification " + title + " / " +details); mNotification.tickerText = title; mNotification.setLatestEventInfo(context, title, details, mNotification.setLatestEventInfo(getUiContext(), title, details, mNotification.contentIntent); NotificationManager notificationManager = (NotificationManager) Loading