diff options
author | Evan Charlton <evanc@google.com> | 2014-04-24 13:56:19 -0700 |
---|---|---|
committer | Evan Charlton <evanc@google.com> | 2014-04-24 13:56:19 -0700 |
commit | 5e78e76ad7e33cf25082c815bfba2ab08a214af8 (patch) | |
tree | 06e60fcd030c366cd9aad14b2210f6f555f7a642 /telephony | |
parent | 58f54dc59d779091bacdb707d9faf60a4f6c4781 (diff) | |
parent | 806047caca937d8e3d067b5fb6d5264fd3731904 (diff) | |
download | frameworks_base-5e78e76ad7e33cf25082c815bfba2ab08a214af8.zip frameworks_base-5e78e76ad7e33cf25082c815bfba2ab08a214af8.tar.gz frameworks_base-5e78e76ad7e33cf25082c815bfba2ab08a214af8.tar.bz2 |
resolved conflicts for merge of 806047ca to master-nova
Change-Id: I6754198919b952bd733733572f64a316cb41b101
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/DataConnectionRealTimeInfo.java | 1 | ||||
-rw-r--r-- | telephony/java/android/telephony/PhoneStateListener.java | 113 |
2 files changed, 62 insertions, 52 deletions
diff --git a/telephony/java/android/telephony/DataConnectionRealTimeInfo.java b/telephony/java/android/telephony/DataConnectionRealTimeInfo.java index 4a9ae39..96069213 100644 --- a/telephony/java/android/telephony/DataConnectionRealTimeInfo.java +++ b/telephony/java/android/telephony/DataConnectionRealTimeInfo.java @@ -23,6 +23,7 @@ import android.os.Parcelable; * Data connection real time information * * TODO: How to handle multiple subscriptions? + * @hide */ public class DataConnectionRealTimeInfo implements Parcelable { private long mTime; // Time the info was collected since boot in nanos; diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index 7c5c648..59ec6f5 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -18,6 +18,7 @@ package android.telephony; import android.os.Bundle; import android.os.Handler; +import android.os.Looper; import android.os.Message; import android.telephony.ServiceState; import android.telephony.SignalStrength; @@ -199,7 +200,67 @@ public class PhoneStateListener { */ public static final int LISTEN_DATA_CONNECTION_REAL_TIME_INFO = 0x00002000; + private final Handler mHandler; + public PhoneStateListener() { + this(Looper.myLooper()); + } + + /** @hide */ + public PhoneStateListener(Looper looper) { + mHandler = new Handler(looper) { + public void handleMessage(Message msg) { + //Rlog.d("TelephonyRegistry", "what=0x" + Integer.toHexString(msg.what) + // + " msg=" + msg); + switch (msg.what) { + case LISTEN_SERVICE_STATE: + PhoneStateListener.this.onServiceStateChanged((ServiceState)msg.obj); + break; + case LISTEN_SIGNAL_STRENGTH: + PhoneStateListener.this.onSignalStrengthChanged(msg.arg1); + break; + case LISTEN_MESSAGE_WAITING_INDICATOR: + PhoneStateListener.this.onMessageWaitingIndicatorChanged(msg.arg1 != 0); + break; + case LISTEN_CALL_FORWARDING_INDICATOR: + PhoneStateListener.this.onCallForwardingIndicatorChanged(msg.arg1 != 0); + break; + case LISTEN_CELL_LOCATION: + PhoneStateListener.this.onCellLocationChanged((CellLocation)msg.obj); + break; + case LISTEN_CALL_STATE: + PhoneStateListener.this.onCallStateChanged(msg.arg1, (String)msg.obj); + break; + case LISTEN_DATA_CONNECTION_STATE: + PhoneStateListener.this.onDataConnectionStateChanged(msg.arg1, msg.arg2); + PhoneStateListener.this.onDataConnectionStateChanged(msg.arg1); + break; + case LISTEN_DATA_ACTIVITY: + PhoneStateListener.this.onDataActivity(msg.arg1); + break; + case LISTEN_SIGNAL_STRENGTHS: + PhoneStateListener.this.onSignalStrengthsChanged((SignalStrength)msg.obj); + break; + case LISTEN_OTASP_CHANGED: + PhoneStateListener.this.onOtaspChanged(msg.arg1); + break; + case LISTEN_CELL_INFO: + PhoneStateListener.this.onCellInfoChanged((List<CellInfo>)msg.obj); + break; + case LISTEN_PRECISE_CALL_STATE: + PhoneStateListener.this.onPreciseCallStateChanged((PreciseCallState)msg.obj); + break; + case LISTEN_PRECISE_DATA_CONNECTION_STATE: + PhoneStateListener.this.onPreciseDataConnectionStateChanged( + (PreciseDataConnectionState)msg.obj); + break; + case LISTEN_DATA_CONNECTION_REAL_TIME_INFO: + PhoneStateListener.this.onDataConnectionRealTimeInfoChanged( + (DataConnectionRealTimeInfo)msg.obj); + break; + } + } + }; } /** @@ -424,56 +485,4 @@ public class PhoneStateListener { dcRtInfo).sendToTarget(); } }; - - Handler mHandler = new Handler() { - public void handleMessage(Message msg) { - //Rlog.d("TelephonyRegistry", "what=0x" + Integer.toHexString(msg.what) + " msg=" + msg); - switch (msg.what) { - case LISTEN_SERVICE_STATE: - PhoneStateListener.this.onServiceStateChanged((ServiceState)msg.obj); - break; - case LISTEN_SIGNAL_STRENGTH: - PhoneStateListener.this.onSignalStrengthChanged(msg.arg1); - break; - case LISTEN_MESSAGE_WAITING_INDICATOR: - PhoneStateListener.this.onMessageWaitingIndicatorChanged(msg.arg1 != 0); - break; - case LISTEN_CALL_FORWARDING_INDICATOR: - PhoneStateListener.this.onCallForwardingIndicatorChanged(msg.arg1 != 0); - break; - case LISTEN_CELL_LOCATION: - PhoneStateListener.this.onCellLocationChanged((CellLocation)msg.obj); - break; - case LISTEN_CALL_STATE: - PhoneStateListener.this.onCallStateChanged(msg.arg1, (String)msg.obj); - break; - case LISTEN_DATA_CONNECTION_STATE: - PhoneStateListener.this.onDataConnectionStateChanged(msg.arg1, msg.arg2); - PhoneStateListener.this.onDataConnectionStateChanged(msg.arg1); - break; - case LISTEN_DATA_ACTIVITY: - PhoneStateListener.this.onDataActivity(msg.arg1); - break; - case LISTEN_SIGNAL_STRENGTHS: - PhoneStateListener.this.onSignalStrengthsChanged((SignalStrength)msg.obj); - break; - case LISTEN_OTASP_CHANGED: - PhoneStateListener.this.onOtaspChanged(msg.arg1); - break; - case LISTEN_CELL_INFO: - PhoneStateListener.this.onCellInfoChanged((List<CellInfo>)msg.obj); - break; - case LISTEN_PRECISE_CALL_STATE: - PhoneStateListener.this.onPreciseCallStateChanged((PreciseCallState)msg.obj); - break; - case LISTEN_PRECISE_DATA_CONNECTION_STATE: - PhoneStateListener.this.onPreciseDataConnectionStateChanged((PreciseDataConnectionState)msg.obj); - break; - case LISTEN_DATA_CONNECTION_REAL_TIME_INFO: - PhoneStateListener.this.onDataConnectionRealTimeInfoChanged( - (DataConnectionRealTimeInfo)msg.obj); - break; - } - } - }; } |