diff options
Diffstat (limited to 'telephony')
4 files changed, 12 insertions, 13 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index ba07a95..7ab189c 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -2361,9 +2361,13 @@ public class PhoneNumberUtils } private static String getCurrentIdp(boolean useNanp) { - // in case, there is no IDD is found, we shouldn't convert it. - String ps = SystemProperties.get( - PROPERTY_OPERATOR_IDP_STRING, useNanp ? NANP_IDP_STRING : PLUS_SIGN_STRING); + String ps = null; + if(useNanp) + ps = NANP_IDP_STRING; + else{ + // in case, there is no IDD is found, we shouldn't convert it. + ps = SystemProperties.get(PROPERTY_OPERATOR_IDP_STRING, PLUS_SIGN_STRING); + } return ps; } diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index 8f4a92b..fce4ae7 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -233,8 +233,7 @@ public class PhoneStateListener { /** * Create a PhoneStateListener for the Phone with the default subscription. - * This class requires Looper.myLooper() not return null. To supply your - * own non-null looper use PhoneStateListener(Looper looper) below. + * This class requires Looper.myLooper() not return null. */ public PhoneStateListener() { this(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, Looper.myLooper()); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 526a3b2..339fc6d 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2167,11 +2167,7 @@ public class TelephonyManager { * Returns a constant indicating the call state (cellular) on the device. */ public int getCallState() { - try { - return getTelecomService().getCallState(); - } catch (RemoteException | NullPointerException e) { - return CALL_STATE_IDLE; - } + return getCallState(getDefaultSubscription()); } /** diff --git a/telephony/java/android/telephony/gsm/GsmCellLocation.java b/telephony/java/android/telephony/gsm/GsmCellLocation.java index 313bc82..a3889b2 100644 --- a/telephony/java/android/telephony/gsm/GsmCellLocation.java +++ b/telephony/java/android/telephony/gsm/GsmCellLocation.java @@ -40,9 +40,9 @@ public class GsmCellLocation extends CellLocation { * Initialize the object from a bundle. */ public GsmCellLocation(Bundle bundle) { - mLac = bundle.getInt("lac", mLac); - mCid = bundle.getInt("cid", mCid); - mPsc = bundle.getInt("psc", mPsc); + mLac = bundle.getInt("lac", -1); + mCid = bundle.getInt("cid", -1); + mPsc = bundle.getInt("psc", -1); } /** |