summaryrefslogtreecommitdiffstats
path: root/telephony/java/android/telephony/PhoneStateListener.java
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2014-04-15 22:04:10 -0700
committerWink Saville <wink@google.com>2014-04-15 22:04:10 -0700
commit070e061a289d771e62b58379eaed153fd285b04f (patch)
treedbc82d648122cb348396e7385bcc77c075a6ff67 /telephony/java/android/telephony/PhoneStateListener.java
parentdc800e85138f3ab57303a879b3e1abd109b90247 (diff)
downloadframeworks_base-070e061a289d771e62b58379eaed153fd285b04f.zip
frameworks_base-070e061a289d771e62b58379eaed153fd285b04f.tar.gz
frameworks_base-070e061a289d771e62b58379eaed153fd285b04f.tar.bz2
Add LISTEN_DATA_CONNECTIPON_REAL_TIME_INFO as listen event
Also added DataConnectionRealTimeInfo structure which passed as a parameter to onDataConnectionRealTimeInfoChanged. Change-Id: Iadcbf9765af57c125bcdf74e3fc652ed6c8f7d42
Diffstat (limited to 'telephony/java/android/telephony/PhoneStateListener.java')
-rw-r--r--telephony/java/android/telephony/PhoneStateListener.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java
index bb3f132..7c5c648 100644
--- a/telephony/java/android/telephony/PhoneStateListener.java
+++ b/telephony/java/android/telephony/PhoneStateListener.java
@@ -188,6 +188,17 @@ public class PhoneStateListener {
*/
public static final int LISTEN_PRECISE_DATA_CONNECTION_STATE = 0x00001000;
+ /**
+ * Listen for real time info for all data connections (cellular)).
+ * {@more}
+ * Requires Permission: {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE
+ * READ_PRECISE_PHONE_STATE}
+ *
+ * @see #onDataConnectionRealTimeInfoChanged(DataConnectionRealTimeInfo)
+ * @hide
+ */
+ public static final int LISTEN_DATA_CONNECTION_REAL_TIME_INFO = 0x00002000;
+
public PhoneStateListener() {
}
@@ -335,6 +346,16 @@ public class PhoneStateListener {
}
/**
+ * Callback invoked when data connection state changes with precise information.
+ *
+ * @hide
+ */
+ public void onDataConnectionRealTimeInfoChanged(
+ DataConnectionRealTimeInfo dcRtInfo) {
+ // default implementation empty
+ }
+
+ /**
* The callback methods need to be called on the handler thread where
* this object was created. If the binder did that for us it'd be nice.
*/
@@ -396,6 +417,12 @@ public class PhoneStateListener {
Message.obtain(mHandler, LISTEN_PRECISE_DATA_CONNECTION_STATE, 0, 0,
dataConnectionState).sendToTarget();
}
+
+ public void onDataConnectionRealTimeInfoChanged(
+ DataConnectionRealTimeInfo dcRtInfo) {
+ Message.obtain(mHandler, LISTEN_DATA_CONNECTION_REAL_TIME_INFO, 0, 0,
+ dcRtInfo).sendToTarget();
+ }
};
Handler mHandler = new Handler() {
@@ -441,6 +468,11 @@ public class PhoneStateListener {
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;
}
}
};