Methods Summary |
---|
public static int | convertCallState(Phone.State state)Convert the {@link State} enum into the TelephonyManager.CALL_STATE_* constants
for the public API.
switch (state) {
case RINGING:
return TelephonyManager.CALL_STATE_RINGING;
case OFFHOOK:
return TelephonyManager.CALL_STATE_OFFHOOK;
default:
return TelephonyManager.CALL_STATE_IDLE;
}
|
public static Phone.State | convertCallState(int state)Convert the TelephonyManager.CALL_STATE_* constants into the {@link State} enum
for the public API.
switch (state) {
case TelephonyManager.CALL_STATE_RINGING:
return Phone.State.RINGING;
case TelephonyManager.CALL_STATE_OFFHOOK:
return Phone.State.OFFHOOK;
default:
return Phone.State.IDLE;
}
|
public static int | convertDataActivityState(Phone.DataActivityState state)Convert the {@link DataState} enum into the TelephonyManager.DATA_* constants
for the public API.
switch (state) {
case DATAIN:
return TelephonyManager.DATA_ACTIVITY_IN;
case DATAOUT:
return TelephonyManager.DATA_ACTIVITY_OUT;
case DATAINANDOUT:
return TelephonyManager.DATA_ACTIVITY_INOUT;
default:
return TelephonyManager.DATA_ACTIVITY_NONE;
}
|
public static Phone.DataActivityState | convertDataActivityState(int state)Convert the TelephonyManager.DATA_* constants into the {@link DataState} enum
for the public API.
switch (state) {
case TelephonyManager.DATA_ACTIVITY_IN:
return Phone.DataActivityState.DATAIN;
case TelephonyManager.DATA_ACTIVITY_OUT:
return Phone.DataActivityState.DATAOUT;
case TelephonyManager.DATA_ACTIVITY_INOUT:
return Phone.DataActivityState.DATAINANDOUT;
default:
return Phone.DataActivityState.NONE;
}
|
public static int | convertDataState(Phone.DataState state)Convert the {@link DataState} enum into the TelephonyManager.DATA_* constants
for the public API.
switch (state) {
case CONNECTING:
return TelephonyManager.DATA_CONNECTING;
case CONNECTED:
return TelephonyManager.DATA_CONNECTED;
case SUSPENDED:
return TelephonyManager.DATA_SUSPENDED;
default:
return TelephonyManager.DATA_DISCONNECTED;
}
|
public static Phone.DataState | convertDataState(int state)Convert the TelephonyManager.DATA_* constants into {@link DataState} enum
for the public API.
switch (state) {
case TelephonyManager.DATA_CONNECTING:
return Phone.DataState.CONNECTING;
case TelephonyManager.DATA_CONNECTED:
return Phone.DataState.CONNECTED;
case TelephonyManager.DATA_SUSPENDED:
return Phone.DataState.SUSPENDED;
default:
return Phone.DataState.DISCONNECTED;
}
|
private void | log(java.lang.String s)
Log.d(LOG_TAG, "[PhoneNotifier] " + s);
|
public void | notifyCallForwardingChanged(Phone sender)
try {
mRegistry.notifyCallForwardingChanged(sender.getCallForwardingIndicator());
} catch (RemoteException ex) {
// system process is dead
}
|
public void | notifyCellLocation(Phone sender)
Bundle data = new Bundle();
sender.getCellLocation().fillInNotifierBundle(data);
try {
mRegistry.notifyCellLocation(data);
} catch (RemoteException ex) {
// system process is dead
}
|
public void | notifyDataActivity(Phone sender)
try {
mRegistry.notifyDataActivity(convertDataActivityState(sender.getDataActivityState()));
} catch (RemoteException ex) {
// system process is dead
}
|
public void | notifyDataConnection(Phone sender, java.lang.String reason)
try {
mRegistry.notifyDataConnection(convertDataState(sender.getDataConnectionState()),
sender.isDataConnectivityPossible(), reason, sender.getActiveApn(),
sender.getInterfaceName(null));
} catch (RemoteException ex) {
// system process is dead
}
|
public void | notifyDataConnectionFailed(Phone sender, java.lang.String reason)
try {
mRegistry.notifyDataConnectionFailed(reason);
} catch (RemoteException ex) {
// system process is dead
}
|
public void | notifyMessageWaitingChanged(Phone sender)
try {
mRegistry.notifyMessageWaitingChanged(sender.getMessageWaitingIndicator());
} catch (RemoteException ex) {
// system process is dead
}
|
public void | notifyPhoneState(Phone sender)
Call ringingCall = sender.getRingingCall();
String incomingNumber = "";
if (ringingCall != null && ringingCall.getEarliestConnection() != null){
incomingNumber = ringingCall.getEarliestConnection().getAddress();
}
try {
mRegistry.notifyCallState(convertCallState(sender.getState()), incomingNumber);
} catch (RemoteException ex) {
// system process is dead
}
|
public void | notifyServiceState(Phone sender)
try {
mRegistry.notifyServiceState(sender.getServiceState());
} catch (RemoteException ex) {
// system process is dead
}
|
public void | notifySignalStrength(Phone sender)
try {
mRegistry.notifySignalStrength(sender.getSignalStrengthASU());
} catch (RemoteException ex) {
// system process is dead
}
|