Merge "Introduce APIs for Emergency Number Database version"

This commit is contained in:
Shuo Qian
2019-11-27 22:35:00 +00:00
committed by Gerrit Code Review
6 changed files with 104 additions and 10 deletions

View File

@@ -8634,6 +8634,7 @@ package android.telephony {
method @Nullable public static android.content.ComponentName getDefaultRespondViaMessageApplication(@NonNull android.content.Context, boolean);
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDeviceSoftwareVersion(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
method public int getEmergencyNumberDbVersion();
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping();
@@ -8672,6 +8673,7 @@ package android.telephony {
method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isVideoCallingEnabled();
method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle);
method public boolean needsOtaServiceProvisioning();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOtaEmergencyNumberDbInstalled();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio();
method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.MODIFY_PHONE_STATE}) public void requestCellInfoUpdate(@NonNull android.os.WorkSource, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestNumberVerification(@NonNull android.telephony.PhoneNumberRange, long, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.NumberVerificationCallback);
@@ -8699,8 +8701,8 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff();
method public void updateServiceLocation();
method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateTestOtaEmergencyNumberDbFilePath(@NonNull String);
field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_ANOMALY_REPORTED = "android.telephony.action.ANOMALY_REPORTED";
field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_OTA_EMERGENCY_NUMBER_DB_INSTALLED = "android.telephony.action.OTA_EMERGENCY_NUMBER_DB_INSTALLED";
field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
@@ -8713,6 +8715,7 @@ package android.telephony {
field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
field public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff
field public static final int KEY_TYPE_EPDG = 1; // 0x1
field public static final int KEY_TYPE_WLAN = 2; // 0x2
field public static final long NETWORK_TYPE_BITMASK_1xRTT = 64L; // 0x40L

View File

@@ -3021,16 +3021,19 @@ package android.telephony {
method public int getCarrierIdListVersion();
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
method @Nullable public static android.content.ComponentName getDefaultRespondViaMessageApplication(@NonNull android.content.Context, boolean);
method public int getEmergencyNumberDbVersion();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1AlphaTag();
method @NonNull public String getNetworkCountryIso(int);
method public android.util.Pair<java.lang.Integer,java.lang.Integer> getRadioHalVersion();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile();
method @Deprecated public void setCarrierTestOverride(String, String, String, String, String, String, String);
method public void setCarrierTestOverride(String, String, String, String, String, String, String, String, String);
method @RequiresPermission("android.permission.READ_ACTIVE_EMERGENCY_SESSION") public void updateTestOtaEmergencyNumberDbFilePath(@NonNull String);
field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
field public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; // 0xffffffff
field public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff
field public static final int UNKNOWN_CARRIER_ID_LIST_VERSION = -1; // 0xffffffff
}

View File

@@ -499,7 +499,6 @@
<protected-broadcast android:name="android.telephony.action.CARRIER_CONFIG_CHANGED" />
<protected-broadcast android:name="android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.telephony.action.OTA_EMERGENCY_NUMBER_DB_INSTALLED" />
<protected-broadcast android:name="android.telephony.action.SECRET_CODE" />
<protected-broadcast android:name="android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION" />
<protected-broadcast android:name="android.telephony.action.SUBSCRIPTION_PLANS_CHANGED" />

View File

@@ -37,9 +37,8 @@ public class EmergencyNumberDbInstallReceiver extends ConfigUpdateInstallReceive
Slog.i(TAG, "Emergency number database is updated in file partition");
// Notify EmergencyNumberTracker for emergency number installation complete.
Intent notifyInstallComplete = new Intent(
TelephonyManager.ACTION_OTA_EMERGENCY_NUMBER_DB_INSTALLED);
context.sendBroadcast(
notifyInstallComplete, android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE);
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(
Context.TELEPHONY_SERVICE);
telephonyManager.notifyOtaEmergencyNumberDbInstalled();
}
}

View File

@@ -10910,14 +10910,66 @@ public class TelephonyManager {
}
/**
* Broadcast intent action for Ota emergency number database installation complete.
* Indicates Emergency number database version is invalid.
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@TestApi
@SystemApi
public static final String ACTION_OTA_EMERGENCY_NUMBER_DB_INSTALLED =
"android.telephony.action.OTA_EMERGENCY_NUMBER_DB_INSTALLED";
public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1;
/**
* Notify Telephony for OTA emergency number database installation complete.
*
* <p> Requires permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
@SystemApi
public void notifyOtaEmergencyNumberDbInstalled() {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
telephony.notifyOtaEmergencyNumberDbInstalled();
} else {
throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
Log.e(TAG, "notifyOtaEmergencyNumberDatabaseInstalled RemoteException", ex);
ex.rethrowAsRuntimeException();
}
}
/**
* Override the file path for testing OTA emergency number database in a file partition.
*
* @param otaFilePath The test OTA emergency number database file path;
* if "RESET", recover the original database file partition.
* Format: <root file folder>@<file path>
*
* <p> Requires permission:
* {@link android.Manifest.permission#READ_ACTIVE_EMERGENCY_SESSION}
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION)
@SystemApi
@TestApi
public void updateTestOtaEmergencyNumberDbFilePath(@NonNull String otaFilePath) {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
telephony.updateTestOtaEmergencyNumberDbFilePath(otaFilePath);
} else {
throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
Log.e(TAG, "notifyOtaEmergencyNumberDatabaseInstalled RemoteException", ex);
ex.rethrowAsRuntimeException();
}
}
/**
* Returns whether {@link TelephonyManager#ACTION_EMERGENCY_ASSISTANCE emergency assistance} is
@@ -11114,6 +11166,29 @@ public class TelephonyManager {
return false;
}
/**
* A test API to return the emergency number db version.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
*
* @hide
*/
@TestApi
@SystemApi
public int getEmergencyNumberDbVersion() {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getEmergencyNumberDbVersion(getSubId());
}
} catch (RemoteException ex) {
Log.e(TAG, "getEmergencyNumberDbVersion RemoteException", ex);
ex.rethrowAsRuntimeException();
}
return INVALID_EMERGENCY_NUMBER_DB_VERSION;
}
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = {"SET_OPPORTUNISTIC_SUB"}, value = {

View File

@@ -1990,6 +1990,21 @@ interface ITelephony {
*/
List<String> getEmergencyNumberListTestMode();
/**
* A test API to return the emergency number db version.
*/
int getEmergencyNumberDbVersion(int subId);
/**
* Notify Telephony for OTA emergency number database installation complete.
*/
void notifyOtaEmergencyNumberDbInstalled();
/**
* Override the file partition name for testing OTA emergency number database.
*/
void updateTestOtaEmergencyNumberDbFilePath(String otaFilePath);
/**
* Enable or disable a logical modem stack associated with the slotIndex.
*/