ECBM SystemProperty cleanup

- Add getEmergencyCallbackMode() method in the TelephonyManager.java
to get the boolean value for ECBM callback mode from the phone through
ITelephony.aidl/java interface

- Use the added TelephonyManager Api to replace the 'get' of
PROPERTY_INECM_MODE system property in the framework/base

Test: manual
Bug: 30361624

Change-Id: I355d69820b157f23e077a95a13f8509ee0fa5874
This commit is contained in:
shuoq
2017-01-10 13:14:02 -08:00
committed by sqian
parent 4a43598bd6
commit d199113e97
3 changed files with 37 additions and 2 deletions

View File

@@ -245,8 +245,7 @@ public class GpsNetInitiatedHandler {
}
public boolean getInEmergency() {
boolean isInEmergencyCallback = Boolean.parseBoolean(
SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE));
boolean isInEmergencyCallback = mTelephonyManager.getEmergencyCallbackMode();
return mIsInEmergency || isInEmergencyCallback;
}

View File

@@ -6150,5 +6150,33 @@ public class TelephonyManager {
return null;
}
/**
* Check if phone is in emergency callback mode
* @return true if phone is in emergency callback mode
* @hide
*/
public boolean getEmergencyCallbackMode() {
return getEmergencyCallbackMode(getSubId());
}
/**
* Check if phone is in emergency callback mode
* @return true if phone is in emergency callback mode
* @param subId the subscription ID that this action applies to.
* @hide
*/
public boolean getEmergencyCallbackMode(int subId) {
try {
ITelephony telephony = getITelephony();
if (telephony == null) {
return false;
}
return telephony.getEmergencyCallbackMode(subId);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#getEmergencyCallbackMode", e);
}
return false;
}
}

View File

@@ -1256,4 +1256,12 @@ interface ITelephony {
* @param appType the icc application type, like {@link #APPTYPE_USIM}
*/
String[] getForbiddenPlmns(int subId, int appType);
/**
* Check if phone is in emergency callback mode
* @return true if phone is in emergency callback mode
* @param subId the subscription ID that this action applies to.
* @hide
*/
boolean getEmergencyCallbackMode(int subId);
}