Update TelephonySnippet.java
diff --git a/src/main/java/com/google/android/mobly/snippet/bundled/TelephonySnippet.java b/src/main/java/com/google/android/mobly/snippet/bundled/TelephonySnippet.java
index 928fd93..26bae43 100644
--- a/src/main/java/com/google/android/mobly/snippet/bundled/TelephonySnippet.java
+++ b/src/main/java/com/google/android/mobly/snippet/bundled/TelephonySnippet.java
@@ -47,7 +47,11 @@
"Gets the call state for the default subscription. Call state values are"
+ "0: IDLE, 1: RINGING, 2: OFFHOOK")
public int getTelephonyCallState() {
- return mTelephonyManager.getCallStateForSubscription();
+ if (Build.VERSION.SDK_INT < 31) {
+ return mTelephonyManager.getCallState();
+ } else {
+ return mTelephonyManager.getCallStateForSubscription();
+ }
}
@Rpc(
@@ -55,11 +59,7 @@
"Returns a constant indicating the radio technology (network type) currently"
+ "in use on the device for data transmission.")
public int getDataNetworkType() {
- if (Build.VERSION.SDK_INT < 31) {
- return mTelephonyManager.getDataNetworkType();
- } else {
- return mTelephonyManager.getCallStateForSubscription();
- }
+ return mTelephonyManager.getDataNetworkType();
}
@Rpc(