Loading policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +38 −15 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.database.ContentObserver; import static android.os.BatteryManager.BATTERY_STATUS_CHARGING; import static android.os.BatteryManager.BATTERY_STATUS_FULL; import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; import android.media.AudioManager; import android.os.Handler; import android.os.Message; import android.provider.Settings; Loading Loading @@ -94,6 +95,7 @@ public class KeyguardUpdateMonitor { private static final int MSG_BATTERY_UPDATE = 302; private static final int MSG_CARRIER_INFO_UPDATE = 303; private static final int MSG_SIM_STATE_CHANGE = 304; private static final int MSG_RINGER_MODE_CHANGED = 305; /** Loading Loading @@ -160,6 +162,9 @@ public class KeyguardUpdateMonitor { case MSG_SIM_STATE_CHANGE: handleSimStateChange((SimArgs) msg.obj); break; case MSG_RINGER_MODE_CHANGED: handleRingerModeChange(msg.arg1); break; } } }; Loading Loading @@ -217,6 +222,7 @@ public class KeyguardUpdateMonitor { filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED); filter.addAction(SPN_STRINGS_UPDATED_ACTION); filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION); context.registerReceiver(new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { Loading Loading @@ -246,11 +252,21 @@ public class KeyguardUpdateMonitor { mHandler.sendMessage(mHandler.obtainMessage( MSG_SIM_STATE_CHANGE, new SimArgs(intent))); } else if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) { mHandler.sendMessage(mHandler.obtainMessage(MSG_RINGER_MODE_CHANGED, intent.getIntExtra(AudioManager.EXTRA_RINGER_MODE, -1), 0)); } } }, filter); } protected void handleRingerModeChange(int mode) { if (DEBUG) Log.d(TAG, "handleRingerModeChange(" + mode + ")"); for (int i = 0; i < mInfoCallbacks.size(); i++) { mInfoCallbacks.get(i).onRingerModeChanged(mode); } } /** * Handle {@link #MSG_CONFIGURATION_CHANGED} */ Loading Loading @@ -443,7 +459,7 @@ public class KeyguardUpdateMonitor { } /** * Callback for general information releveant to lock screen. * Callback for general information relevant to lock screen. */ interface InfoCallback { void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn, int batteryLevel); Loading @@ -455,6 +471,13 @@ public class KeyguardUpdateMonitor { * @param spn The service provider name. May be null if it shouldn't be displayed. */ void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn); /** * Called when the ringer mode changes. * @param state the current ringer state, as defined in * {@link AudioManager#RINGER_MODE_CHANGED_ACTION} */ void onRingerModeChanged(int state); } /** Loading policy/com/android/internal/policy/impl/LockScreen.java +10 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import android.os.SystemProperties; import java.util.Date; import java.io.File; import java.text.SimpleDateFormat; /** * The screen within {@link LockPatternKeyguardView} that shows general Loading Loading @@ -577,4 +576,13 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM public void cleanUp() { mUpdateMonitor.removeCallback(this); } /** {@inheritDoc} */ public void onRingerModeChanged(int state) { boolean silent = AudioManager.RINGER_MODE_SILENT == state; if (silent != mSilentMode) { mSilentMode = silent; updateRightTabResources(); } } } policy/com/android/internal/policy/impl/UnlockScreen.java +12 −7 Original line number Diff line number Diff line Loading @@ -368,6 +368,11 @@ class UnlockScreen extends LinearLayoutWithDefaultTouchRecepient mCarrier.setText(LockScreen.getCarrierString(plmn, spn)); } /** {@inheritDoc} */ public void onRingerModeChanged(int state) { // not currently used } // ---------- SimStateCallback /** {@inheritDoc} */ Loading Loading
policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +38 −15 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.database.ContentObserver; import static android.os.BatteryManager.BATTERY_STATUS_CHARGING; import static android.os.BatteryManager.BATTERY_STATUS_FULL; import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; import android.media.AudioManager; import android.os.Handler; import android.os.Message; import android.provider.Settings; Loading Loading @@ -94,6 +95,7 @@ public class KeyguardUpdateMonitor { private static final int MSG_BATTERY_UPDATE = 302; private static final int MSG_CARRIER_INFO_UPDATE = 303; private static final int MSG_SIM_STATE_CHANGE = 304; private static final int MSG_RINGER_MODE_CHANGED = 305; /** Loading Loading @@ -160,6 +162,9 @@ public class KeyguardUpdateMonitor { case MSG_SIM_STATE_CHANGE: handleSimStateChange((SimArgs) msg.obj); break; case MSG_RINGER_MODE_CHANGED: handleRingerModeChange(msg.arg1); break; } } }; Loading Loading @@ -217,6 +222,7 @@ public class KeyguardUpdateMonitor { filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED); filter.addAction(SPN_STRINGS_UPDATED_ACTION); filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION); context.registerReceiver(new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { Loading Loading @@ -246,11 +252,21 @@ public class KeyguardUpdateMonitor { mHandler.sendMessage(mHandler.obtainMessage( MSG_SIM_STATE_CHANGE, new SimArgs(intent))); } else if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) { mHandler.sendMessage(mHandler.obtainMessage(MSG_RINGER_MODE_CHANGED, intent.getIntExtra(AudioManager.EXTRA_RINGER_MODE, -1), 0)); } } }, filter); } protected void handleRingerModeChange(int mode) { if (DEBUG) Log.d(TAG, "handleRingerModeChange(" + mode + ")"); for (int i = 0; i < mInfoCallbacks.size(); i++) { mInfoCallbacks.get(i).onRingerModeChanged(mode); } } /** * Handle {@link #MSG_CONFIGURATION_CHANGED} */ Loading Loading @@ -443,7 +459,7 @@ public class KeyguardUpdateMonitor { } /** * Callback for general information releveant to lock screen. * Callback for general information relevant to lock screen. */ interface InfoCallback { void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn, int batteryLevel); Loading @@ -455,6 +471,13 @@ public class KeyguardUpdateMonitor { * @param spn The service provider name. May be null if it shouldn't be displayed. */ void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn); /** * Called when the ringer mode changes. * @param state the current ringer state, as defined in * {@link AudioManager#RINGER_MODE_CHANGED_ACTION} */ void onRingerModeChanged(int state); } /** Loading
policy/com/android/internal/policy/impl/LockScreen.java +10 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import android.os.SystemProperties; import java.util.Date; import java.io.File; import java.text.SimpleDateFormat; /** * The screen within {@link LockPatternKeyguardView} that shows general Loading Loading @@ -577,4 +576,13 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM public void cleanUp() { mUpdateMonitor.removeCallback(this); } /** {@inheritDoc} */ public void onRingerModeChanged(int state) { boolean silent = AudioManager.RINGER_MODE_SILENT == state; if (silent != mSilentMode) { mSilentMode = silent; updateRightTabResources(); } } }
policy/com/android/internal/policy/impl/UnlockScreen.java +12 −7 Original line number Diff line number Diff line Loading @@ -368,6 +368,11 @@ class UnlockScreen extends LinearLayoutWithDefaultTouchRecepient mCarrier.setText(LockScreen.getCarrierString(plmn, spn)); } /** {@inheritDoc} */ public void onRingerModeChanged(int state) { // not currently used } // ---------- SimStateCallback /** {@inheritDoc} */ Loading