Methods Summary |
---|
public void | clearFailedAttempts()
mFailedAttempts = 0;
|
public int | getBatteryLevel()
return mBatteryLevel;
|
private java.lang.CharSequence | getDefaultPlmn()
return mContext.getResources().getText(
R.string.lockscreen_carrier_default);
|
public int | getFailedAttempts()
return mFailedAttempts;
|
public SimCard.State | getSimState()
return mSimState;
|
public java.lang.CharSequence | getTelephonyPlmn()
return mTelephonyPlmn;
|
private java.lang.CharSequence | getTelephonyPlmnFrom(android.content.Intent intent)
if (intent.getBooleanExtra(EXTRA_SHOW_PLMN, false)) {
final String plmn = intent.getStringExtra(EXTRA_PLMN);
if (plmn != null) {
return plmn;
} else {
return getDefaultPlmn();
}
}
return null;
|
public java.lang.CharSequence | getTelephonySpn()
return mTelephonySpn;
|
private java.lang.CharSequence | getTelephonySpnFrom(android.content.Intent intent)
if (intent.getBooleanExtra(EXTRA_SHOW_SPN, false)) {
final String spn = intent.getStringExtra(EXTRA_SPN);
if (spn != null) {
return spn;
}
}
return null;
|
private void | handleBatteryUpdate(int pluggedInStatus, int batteryLevel)Handle {@link #MSG_BATTERY_UPDATE}
if (DEBUG) Log.d(TAG, "handleBatteryUpdate");
final boolean pluggedIn = isPluggedIn(pluggedInStatus);
if (isBatteryUpdateInteresting(pluggedIn, batteryLevel)) {
mBatteryLevel = batteryLevel;
mDevicePluggedIn = pluggedIn;
for (int i = 0; i < mInfoCallbacks.size(); i++) {
mInfoCallbacks.get(i).onRefreshBatteryInfo(
shouldShowBatteryInfo(), pluggedIn, batteryLevel);
}
}
// shut down gracefully if our battery is critically low and we are not powered
if (batteryLevel == 0 &&
pluggedInStatus != BATTERY_STATUS_CHARGING &&
pluggedInStatus != BATTERY_STATUS_UNKNOWN) {
ShutdownThread.shutdownAfterDisablingRadio(mContext, false);
}
|
private void | handleCarrierInfoUpdate()Handle {@link #MSG_CARRIER_INFO_UPDATE}
if (DEBUG) Log.d(TAG, "handleCarrierInfoUpdate: plmn = " + mTelephonyPlmn
+ ", spn = " + mTelephonySpn);
for (int i = 0; i < mInfoCallbacks.size(); i++) {
mInfoCallbacks.get(i).onRefreshCarrierInfo(mTelephonyPlmn, mTelephonySpn);
}
|
private void | handleConfigurationChange()Handle {@link #MSG_CONFIGURATION_CHANGED}
if (DEBUG) Log.d(TAG, "handleConfigurationChange");
final boolean inPortrait = queryInPortrait();
if (mInPortrait != inPortrait) {
mInPortrait = inPortrait;
for (int i = 0; i < mConfigurationChangeCallbacks.size(); i++) {
mConfigurationChangeCallbacks.get(i).onOrientationChange(inPortrait);
}
}
final boolean keyboardOpen = queryKeyboardOpen();
if (mKeyboardOpen != keyboardOpen) {
mKeyboardOpen = keyboardOpen;
for (int i = 0; i < mConfigurationChangeCallbacks.size(); i++) {
mConfigurationChangeCallbacks.get(i).onKeyboardChange(keyboardOpen);
}
}
|
private void | handleSimStateChange(com.android.internal.policy.impl.KeyguardUpdateMonitor$SimArgs simArgs)Handle {@link #MSG_SIM_STATE_CHANGE}
final SimCard.State state = simArgs.simState;
if (DEBUG) {
Log.d(TAG, "handleSimStateChange: intentValue = " + simArgs + " "
+ "state resolved to " + state.toString());
}
if (state != SimCard.State.UNKNOWN && state != mSimState) {
mSimState = state;
for (int i = 0; i < mSimStateCallbacks.size(); i++) {
mSimStateCallbacks.get(i).onSimStateChanged(state);
}
}
|
private void | handleTimeUpdate()Handle {@link #MSG_TIME_UPDATE}
if (DEBUG) Log.d(TAG, "handleTimeUpdate");
for (int i = 0; i < mInfoCallbacks.size(); i++) {
mInfoCallbacks.get(i).onTimeChanged();
}
|
private boolean | isBatteryUpdateInteresting(boolean pluggedIn, int batteryLevel)
// change in plug is always interesting
if (mDevicePluggedIn != pluggedIn) {
return true;
}
// change in battery level while plugged in
if (pluggedIn && mBatteryLevel != batteryLevel) {
return true;
}
if (!pluggedIn) {
// not plugged in and going below threshold
if (batteryLevel < LOW_BATTERY_THRESHOLD
&& mBatteryLevel >= LOW_BATTERY_THRESHOLD) {
return true;
}
// not plugged in and going above threshold (sounds impossible, but, meh...)
if (mBatteryLevel < LOW_BATTERY_THRESHOLD
&& batteryLevel >= LOW_BATTERY_THRESHOLD) {
return true;
}
}
return false;
|
public boolean | isDevicePluggedIn()
return mDevicePluggedIn;
|
public boolean | isDeviceProvisioned()
return mDeviceProvisioned;
|
public boolean | isInPortrait()
return mInPortrait;
|
public boolean | isKeyboardOpen()
return mKeyboardOpen;
|
private boolean | isPluggedIn(int status)
return status == BATTERY_STATUS_CHARGING || status == BATTERY_STATUS_FULL;
|
boolean | queryInPortrait()What is the current orientation?
final Configuration configuration = mContext.getResources().getConfiguration();
return configuration.orientation == Configuration.ORIENTATION_PORTRAIT;
|
boolean | queryKeyboardOpen()Is the (hard) keyboard currently open?
final Configuration configuration = mContext.getResources().getConfiguration();
return configuration.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO;
|
public void | registerConfigurationChangeCallback(com.android.internal.policy.impl.KeyguardUpdateMonitor$ConfigurationChangeCallback callback)Register to receive notifications about configuration changes.
mConfigurationChangeCallbacks.add(callback);
|
public void | registerInfoCallback(com.android.internal.policy.impl.KeyguardUpdateMonitor$InfoCallback callback)Register to receive notifications about general keyguard information
(see {@link InfoCallback}.
mInfoCallbacks.add(callback);
|
public void | registerSimStateCallback(com.android.internal.policy.impl.KeyguardUpdateMonitor$SimStateCallback callback)Register to be notified of sim state changes.
mSimStateCallbacks.add(callback);
|
public void | removeCallback(java.lang.Object observer)Remove the given observer from being registered from any of the kinds
of callbacks.
mConfigurationChangeCallbacks.remove(observer);
mInfoCallbacks.remove(observer);
mSimStateCallbacks.remove(observer);
|
public void | reportFailedAttempt()
mFailedAttempts++;
|
public void | reportSimPinUnlocked()Report that the user succesfully entered the sim pin so we
have the information earlier than waiting for the intent
broadcast from the telephony code.
mSimState = SimCard.State.READY;
|
public boolean | shouldShowBatteryInfo()
return mDevicePluggedIn || mBatteryLevel < LOW_BATTERY_THRESHOLD;
|