API Council Feedbacks

1) Update doc of ACTION_UPDATE_EMERGENCY_NUMBER_DB
2) Add new APIs EXTRA_VERSION and EXTRA_REQUIRED_HASH
3) Rename isDataConnectionEnabled to IsDataConnectionAllowed
4) Format the API documentations with html format
5) Throw errors for shutdownAllRadios, isAnyRadioPoweredOn
6) Modify the doc of TelephonyManager.getEmergencyNumberDbVersion
7) Add UPDATE_CONFIG permission for ACTION_UPDATE_EMERGENCY_NUMBER_DB

Test: Treehugger; Manual made a call; make -j offline-sdk-docs
Bug: 147696692
Bug: 147805285
Bug: 148217670
Bug: 148218347
Change-Id: Idf3dee3de5ebf75ca8b8fbaaf879e69f7ae4b754
Merged-In: Idf3dee3de5ebf75ca8b8fbaaf879e69f7ae4b754
(cherry picked from commit dc86120fca)
This commit is contained in:
Shuo Qian
2020-03-03 19:51:13 -08:00
committed by sqian
parent 365caf6f04
commit 9ae1afee27
8 changed files with 107 additions and 76 deletions

View File

@@ -5982,13 +5982,15 @@ package android.os {
field public static final String ACTION_UPDATE_CARRIER_PROVISIONING_URLS = "android.intent.action.UPDATE_CARRIER_PROVISIONING_URLS";
field public static final String ACTION_UPDATE_CONVERSATION_ACTIONS = "android.intent.action.UPDATE_CONVERSATION_ACTIONS";
field public static final String ACTION_UPDATE_CT_LOGS = "android.intent.action.UPDATE_CT_LOGS";
field public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB = "android.os.action.UPDATE_EMERGENCY_NUMBER_DB";
field @RequiresPermission("android.permission.UPDATE_CONFIG") public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB = "android.os.action.UPDATE_EMERGENCY_NUMBER_DB";
field public static final String ACTION_UPDATE_INTENT_FIREWALL = "android.intent.action.UPDATE_INTENT_FIREWALL";
field public static final String ACTION_UPDATE_LANG_ID = "android.intent.action.UPDATE_LANG_ID";
field public static final String ACTION_UPDATE_NETWORK_WATCHLIST = "android.intent.action.UPDATE_NETWORK_WATCHLIST";
field public static final String ACTION_UPDATE_PINS = "android.intent.action.UPDATE_PINS";
field public static final String ACTION_UPDATE_SMART_SELECTION = "android.intent.action.UPDATE_SMART_SELECTION";
field public static final String ACTION_UPDATE_SMS_SHORT_CODES = "android.intent.action.UPDATE_SMS_SHORT_CODES";
field public static final String EXTRA_REQUIRED_HASH = "android.os.extra.REQUIRED_HASH";
field public static final String EXTRA_VERSION = "android.os.extra.VERSION";
}
public class Environment {
@@ -9361,7 +9363,7 @@ package android.telephony {
method @NonNull public java.util.List<android.telephony.data.ApnSetting> getDevicePolicyOverrideApns(@NonNull android.content.Context);
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 @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) 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[] getIsimImpu();
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
@@ -9391,7 +9393,7 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApplicationOnUicc(int);
method public boolean isCurrentSimOperator(@NonNull String, int, @Nullable String);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataAllowedInVoiceCall();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataConnectionEnabled();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataConnectionAllowed();
method public boolean isDataConnectivityPossible();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataEnabledForApn(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled();

View File

@@ -3244,7 +3244,7 @@ package android.telephony {
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 @NonNull public java.util.List<android.telephony.data.ApnSetting> getDevicePolicyOverrideApns(@NonNull android.content.Context);
method public int getEmergencyNumberDbVersion();
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public int getEmergencyNumberDbVersion();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1AlphaTag();
method @NonNull @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getNetworkCountryIso(int);
method public android.util.Pair<java.lang.Integer,java.lang.Integer> getRadioHalVersion();

View File

@@ -16,6 +16,7 @@
package android.os;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
/**
@@ -114,20 +115,36 @@ public final class ConfigUpdate {
= "android.os.action.UPDATE_CARRIER_ID_DB";
/**
* Broadcast intent action indicating that the updated emergency number database is available.
* <p>Extra: "VERSION" the numeric version of the new data. Devices should only install if the
* update version is newer than the current one.
* <p>Extra: "REQUIRED_HASH" the hash of the current update data.
* <p>Input: {@link android.content.Intent#getData} is URI of downloaded emergency number file.
* Devices should pick up the downloaded file and persist to the database
* {@code com.android.internal.telephony.emergency.EmergencyNumberTracker}.
* Update the emergency number database into the devices.
* <p>Extra: {@link #EXTRA_VERSION} the numeric version of the database.
* <p>Extra: {@link #EXTRA_REQUIRED_HASH} the hash of the database.
* <p>Input: {@link android.content.Intent#getData} the URI to download emergency number
* database.
*
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.UPDATE_CONFIG)
public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB =
"android.os.action.UPDATE_EMERGENCY_NUMBER_DB";
/**
* An integer to indicate the numeric version of the new data. Devices should only install
* if the update version is newer than the current one.
*
* @hide
*/
@SystemApi
public static final String EXTRA_VERSION = "android.os.extra.VERSION";
/**
* A string to indicate the hash of the data.
*
* @hide
*/
@SystemApi
public static final String EXTRA_REQUIRED_HASH = "android.os.extra.REQUIRED_HASH";
private ConfigUpdate() {
}
}

View File

@@ -577,7 +577,7 @@ public class MobileSignalController extends SignalController<
}
boolean isDataDisabled() {
return !mPhone.isDataConnectionEnabled();
return !mPhone.isDataConnectionAllowed();
}
@VisibleForTesting

View File

@@ -176,7 +176,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
protected void setupNetworkController() {
// For now just pretend to be the data sim, so we can test that too.
mSubId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID;
when(mMockTm.isDataConnectionEnabled()).thenReturn(true);
when(mMockTm.isDataConnectionAllowed()).thenReturn(true);
setDefaultSubId(mSubId);
setSubscriptions(mSubId);
mMobileSignalController = mNetworkController.mMobileSignalControllers.get(mSubId);

View File

@@ -119,7 +119,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
@Test
public void testNoInternetIcon_withDefaultSub() {
setupNetworkController();
when(mMockTm.isDataConnectionEnabled()).thenReturn(false);
when(mMockTm.isDataConnectionAllowed()).thenReturn(false);
setupDefaultSignal();
updateDataConnectionState(TelephonyManager.DATA_CONNECTED, 0);
setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
@@ -133,7 +133,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
@Test
public void testDataDisabledIcon_withDefaultSub() {
setupNetworkController();
when(mMockTm.isDataConnectionEnabled()).thenReturn(false);
when(mMockTm.isDataConnectionAllowed()).thenReturn(false);
setupDefaultSignal();
updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0);
setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
@@ -147,7 +147,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
@Test
public void testNonDefaultSIM_showsFullSignal_connected() {
setupNetworkController();
when(mMockTm.isDataConnectionEnabled()).thenReturn(false);
when(mMockTm.isDataConnectionAllowed()).thenReturn(false);
setupDefaultSignal();
setDefaultSubId(mSubId + 1);
updateDataConnectionState(TelephonyManager.DATA_CONNECTED, 0);
@@ -162,7 +162,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
@Test
public void testNonDefaultSIM_showsFullSignal_disconnected() {
setupNetworkController();
when(mMockTm.isDataConnectionEnabled()).thenReturn(false);
when(mMockTm.isDataConnectionAllowed()).thenReturn(false);
setupDefaultSignal();
setDefaultSubId(mSubId + 1);
updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0);
@@ -177,7 +177,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
@Test
public void testDataDisabledIcon_UserNotSetup() {
setupNetworkController();
when(mMockTm.isDataConnectionEnabled()).thenReturn(false);
when(mMockTm.isDataConnectionAllowed()).thenReturn(false);
setupDefaultSignal();
updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0);
setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
@@ -192,7 +192,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
@Test
public void testAlwaysShowDataRatIcon() {
setupDefaultSignal();
when(mMockTm.isDataConnectionEnabled()).thenReturn(false);
when(mMockTm.isDataConnectionAllowed()).thenReturn(false);
updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED,
TelephonyManager.NETWORK_TYPE_GSM);

View File

@@ -2362,17 +2362,16 @@ public class CarrierConfigManager {
* <p> If a measure is not set, signal criteria reporting from modem will not be triggered and
* not be used for calculating signal level. If multiple measures are set bit, the parameter
* whose value is smallest is used to indicate the signal level.
* <UL>
* <LI>RSRP = 1 << 0</LI>
* <LI>RSRQ = 1 << 1</LI>
* <LI>RSSNR = 1 << 2</LI>
* </UL>
* <p> The value of this key must be bitwise OR of {@link CellSignalStrengthLte#USE_RSRP},
* {@link CellSignalStrengthLte#USE_RSRQ}, {@link CellSignalStrengthLte#USE_RSSNR}.
*
* RSRP = 1 << 0,
* RSRQ = 1 << 1,
* RSSNR = 1 << 2,
*
* The value of this key must be bitwise OR of {@link CellSignalStrengthLte#USE_RSRP},
* {@link CellSignalStrengthLte#USE_RSRQ}, {@link CellSignalStrengthLte#USE_RSSNR}.
*
* For example, if both RSRP and RSRQ are used, the value of key is 3 (1 << 0 | 1 << 1).
* If the key is invalid or not configured, a default value (RSRP = 1 << 0)
* will apply.
* <p> For example, if both RSRP and RSRQ are used, the value of key is 3 (1 << 0 | 1 << 1).
* If the key is invalid or not configured, a default value (RSRP = 1 << 0) will apply.
*
* @hide
*/
@@ -2381,16 +2380,18 @@ public class CarrierConfigManager {
/**
* List of 4 customized 5G SS reference signal received power (SSRSRP) thresholds.
*
* <p>
* Reference: 3GPP TS 38.215
*
* <p>
* 4 threshold integers must be within the boundaries [-140 dB, -44 dB], and the levels are:
* "NONE: [-140, threshold1]"
* "POOR: (threshold1, threshold2]"
* "MODERATE: (threshold2, threshold3]"
* "GOOD: (threshold3, threshold4]"
* "EXCELLENT: (threshold4, -44]"
*
* <UL>
* <LI>"NONE: [-140, threshold1]"</LI>
* <LI>"POOR: (threshold1, threshold2]"</LI>
* <LI>"MODERATE: (threshold2, threshold3]"</LI>
* <LI>"GOOD: (threshold3, threshold4]"</LI>
* <LI>"EXCELLENT: (threshold4, -44]"</LI>
* </UL>
* <p>
* This key is considered invalid if the format is violated. If the key is invalid or
* not configured, a default value set will apply.
*/
@@ -2399,16 +2400,18 @@ public class CarrierConfigManager {
/**
* List of 4 customized 5G SS reference signal received quality (SSRSRQ) thresholds.
*
* <p>
* Reference: 3GPP TS 38.215
*
* <p>
* 4 threshold integers must be within the boundaries [-20 dB, -3 dB], and the levels are:
* "NONE: [-20, threshold1]"
* "POOR: (threshold1, threshold2]"
* "MODERATE: (threshold2, threshold3]"
* "GOOD: (threshold3, threshold4]"
* "EXCELLENT: (threshold4, -3]"
*
* <UL>
* <LI>"NONE: [-20, threshold1]"</LI>
* <LI>"POOR: (threshold1, threshold2]"</LI>
* <LI>"MODERATE: (threshold2, threshold3]"</LI>
* <LI>"GOOD: (threshold3, threshold4]"</LI>
* <LI>"EXCELLENT: (threshold4, -3]"</LI>
* </UL>
* <p>
* This key is considered invalid if the format is violated. If the key is invalid or
* not configured, a default value set will apply.
*/
@@ -2417,17 +2420,19 @@ public class CarrierConfigManager {
/**
* List of 4 customized 5G SS signal-to-noise and interference ratio (SSSINR) thresholds.
*
* <p>
* Reference: 3GPP TS 38.215,
* 3GPP TS 38.133 10.1.16.1
*
* <p>
* 4 threshold integers must be within the boundaries [-23 dB, 40 dB], and the levels are:
* "NONE: [-23, threshold1]"
* "POOR: (threshold1, threshold2]"
* "MODERATE: (threshold2, threshold3]"
* "GOOD: (threshold3, threshold4]"
* "EXCELLENT: (threshold4, 40]"
*
* <UL>
* <LI>"NONE: [-23, threshold1]"</LI>
* <LI>"POOR: (threshold1, threshold2]"</LI>
* <LI>"MODERATE: (threshold2, threshold3]"</LI>
* <LI>"GOOD: (threshold3, threshold4]"</LI>
* <LI>"EXCELLENT: (threshold4, 40]"</LI>
* </UL>
* <p>
* This key is considered invalid if the format is violated. If the key is invalid or
* not configured, a default value set will apply.
*/
@@ -2442,19 +2447,19 @@ public class CarrierConfigManager {
* <p> If a measure is not set, signal criteria reporting from modem will not be triggered and
* not be used for calculating signal level. If multiple measures are set bit, the parameter
* whose value is smallest is used to indicate the signal level.
*
* SSRSRP = 1 << 0,
* SSRSRQ = 1 << 1,
* SSSINR = 1 << 2,
*
* <UL>
* <LI>SSRSRP = 1 << 0</LI>
* <LI>SSRSRQ = 1 << 1</LI>
* <LI>SSSINR = 1 << 2</LI>
* </UL>
* The value of this key must be bitwise OR of {@link CellSignalStrengthNr#USE_SSRSRP},
* {@link CellSignalStrengthNr#USE_SSRSRQ}, {@link CellSignalStrengthNr#USE_SSSINR}.
*
* For example, if both SSRSRP and SSSINR are used, the value of key is 5 (1 << 0 | 1 << 2).
* <p> For example, if both SSRSRP and SSSINR are used, the value of key is 5 (1 << 0 | 1 << 2).
* If the key is invalid or not configured, a default value (SSRSRP = 1 << 0) will apply.
*
* Reference: 3GPP TS 38.215,
* 3GPP TS 38.133 10.1.16.1
* <p> Reference: 3GPP TS 38.215,
* 3GPP TS 38.133 10.1.16.1
*
* @hide
*/

View File

@@ -8908,7 +8908,10 @@ public class TelephonyManager {
}
/**
* Shut down all the live radios over all the slot index.
* Shut down all the live radios over all the slot indexes.
*
* <p>To know when the radio has completed powering off, use
* {@link PhoneStateListener#LISTEN_SERVICE_STATE LISTEN_SERVICE_STATE}.
*
* @hide
*/
@@ -8921,7 +8924,8 @@ public class TelephonyManager {
telephony.shutdownMobileRadios();
}
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#shutdownMobileRadios", e);
Log.e(TAG, "Error calling ITelephony#shutdownAllRadios", e);
e.rethrowAsRuntimeException();
}
}
@@ -8940,7 +8944,8 @@ public class TelephonyManager {
return telephony.needMobileRadioShutdown();
}
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#needMobileRadioShutdown", e);
Log.e(TAG, "Error calling ITelephony#isAnyRadioPoweredOn", e);
e.rethrowAsRuntimeException();
}
return false;
}
@@ -11109,21 +11114,21 @@ public class TelephonyManager {
}
/**
* Checks whether cellular data connection is enabled in the device.
* Checks whether cellular data connection is allowed in the device.
*
* Whether cellular data connection is enabled, meaning upon request whether will try to setup
* metered data connection considering all factors below:
* 1) User turned on data setting {@link #isDataEnabled}.
* 2) Carrier allows data to be on.
* 3) Network policy.
* And possibly others.
*
* @return {@code true} if the overall data connection is capable; {@code false} if not.
* <p>Whether cellular data connection is allowed considers all factors below:
* <UL>
* <LI>User turned on data setting {@link #isDataEnabled}.</LI>
* <LI>Carrier allows data to be on.</LI>
* <LI>Network policy.</LI>
* <LI>And possibly others.</LI>
* </UL>
* @return {@code true} if the overall data connection is allowed; {@code false} if not.
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public boolean isDataConnectionEnabled() {
public boolean isDataConnectionAllowed() {
boolean retVal = false;
try {
int subId = getSubId(SubscriptionManager.getDefaultDataSubscriptionId());
@@ -11131,8 +11136,9 @@ public class TelephonyManager {
if (telephony != null)
retVal = telephony.isDataEnabled(subId);
} catch (RemoteException e) {
Log.e(TAG, "Error isDataConnectionEnabled", e);
Log.e(TAG, "Error isDataConnectionAllowed", e);
} catch (NullPointerException e) {
return false;
}
return retVal;
}
@@ -11843,7 +11849,7 @@ public class TelephonyManager {
}
/**
* A test API to return the emergency number db version.
* Returns the emergency number database version.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
@@ -11852,6 +11858,7 @@ public class TelephonyManager {
*/
@TestApi
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public int getEmergencyNumberDbVersion() {
try {
ITelephony telephony = getITelephony();