Revert "Telephony light grey list clean up for Q"

This reverts commit 253bdb7175.

Reason for revert: This CL caused MMS break because Bugle is using the
hidden API in Q's darkgrey list. The proper fix should either come from
Bugle team if their apk moved to Q, or compat team to explore why this
caused issue for app target on P.

Change-Id: Icc6c190cde79c10d9045183c0b80cdf008e95578

Bug: 117899984
This commit is contained in:
Chen Xu
2018-10-19 17:59:18 +00:00
parent 253bdb7175
commit bab59cb9db
4 changed files with 27 additions and 31 deletions

View File

@@ -676,7 +676,7 @@ public class TelecomManager {
/**
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public static TelecomManager from(Context context) {
return (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
}

View File

@@ -21,7 +21,6 @@ import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
@@ -247,7 +246,7 @@ public class ServiceState implements Parcelable {
private String mDataOperatorAlphaLong;
private String mDataOperatorAlphaShort;
private String mDataOperatorNumeric;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
private boolean mIsManualNetworkSelection;
private boolean mIsEmergencyOnly;
@@ -257,9 +256,9 @@ public class ServiceState implements Parcelable {
@UnsupportedAppUsage
private boolean mCssIndicator;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
private int mNetworkId;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
private int mSystemId;
@UnsupportedAppUsage
private int mCdmaRoamingIndicator;
@@ -457,7 +456,7 @@ public class ServiceState implements Parcelable {
*
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public int getVoiceRegState() {
return mVoiceRegState;
}
@@ -472,7 +471,7 @@ public class ServiceState implements Parcelable {
*
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public int getDataRegState() {
return mDataRegState;
}
@@ -533,7 +532,7 @@ public class ServiceState implements Parcelable {
* @return roaming status
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public boolean getVoiceRoaming() {
return getVoiceRoamingType() != ROAMING_TYPE_NOT_ROAMING;
}
@@ -557,7 +556,7 @@ public class ServiceState implements Parcelable {
* @return roaming type
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public boolean getDataRoaming() {
return getDataRoamingType() != ROAMING_TYPE_NOT_ROAMING;
}

View File

@@ -43,7 +43,6 @@ import android.database.ContentObserver;
import android.net.INetworkPolicyManager;
import android.net.NetworkCapabilities;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -1369,7 +1368,7 @@ public class SubscriptionManager {
}
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public static int getPhoneId(int subId) {
if (!isValidSubscriptionId(subId)) {
if (DBG) {
@@ -1665,7 +1664,7 @@ public class SubscriptionManager {
* usable subId means its neither a INVALID_SUBSCRIPTION_ID nor a DEFAULT_SUB_ID.
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public static boolean isUsableSubIdValue(int subId) {
return subId >= MIN_SUBSCRIPTION_ID_VALUE && subId <= MAX_SUBSCRIPTION_ID_VALUE;
}
@@ -1683,7 +1682,7 @@ public class SubscriptionManager {
}
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId) {
int[] subIds = SubscriptionManager.getSubId(phoneId);
if (subIds != null && subIds.length > 0) {

View File

@@ -41,7 +41,6 @@ import android.net.NetworkStats;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.BatteryStats;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.PersistableBundle;
@@ -231,8 +230,7 @@ public class TelephonyManager {
/** @hide
/* @deprecated - use getSystemService as described above */
@Deprecated
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public static TelephonyManager getDefault() {
return sInstance;
}
@@ -321,7 +319,7 @@ public class TelephonyManager {
}
/** {@hide} */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public static TelephonyManager from(Context context) {
return (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
}
@@ -1881,7 +1879,7 @@ public class TelephonyManager {
* @param subId
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getNetworkOperatorName(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ALPHA, "");
@@ -1909,7 +1907,7 @@ public class TelephonyManager {
* @param subId
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getNetworkOperator(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
return getNetworkOperatorForPhone(phoneId);
@@ -2233,7 +2231,7 @@ public class TelephonyManager {
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public int getDataNetworkType(int subId) {
try{
ITelephony telephony = getITelephony();
@@ -2269,7 +2267,7 @@ public class TelephonyManager {
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public int getVoiceNetworkType(int subId) {
try{
ITelephony telephony = getITelephony();
@@ -2752,7 +2750,7 @@ public class TelephonyManager {
* @param subId for which SimOperator is returned
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getSimOperator(int subId) {
return getSimOperatorNumeric(subId);
}
@@ -2766,7 +2764,7 @@ public class TelephonyManager {
* @see #getSimState
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getSimOperatorNumeric() {
int subId = mSubId;
if (!SubscriptionManager.isUsableSubIdValue(subId)) {
@@ -2795,7 +2793,7 @@ public class TelephonyManager {
* @param subId for which SimOperator is returned
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getSimOperatorNumeric(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
return getSimOperatorNumericForPhone(phoneId);
@@ -2809,7 +2807,7 @@ public class TelephonyManager {
* @param phoneId for which SimOperator is returned
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getSimOperatorNumericForPhone(int phoneId) {
return getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, "");
@@ -2836,7 +2834,7 @@ public class TelephonyManager {
* @param subId for which SimOperatorName is returned
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getSimOperatorName(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
return getSimOperatorNameForPhone(phoneId);
@@ -2866,7 +2864,7 @@ public class TelephonyManager {
* @param subId for which SimCountryIso is returned
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getSimCountryIso(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
return getSimCountryIsoForPhone(phoneId);
@@ -3056,7 +3054,7 @@ public class TelephonyManager {
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getSubscriberId(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -3441,7 +3439,7 @@ public class TelephonyManager {
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public String getMsisdn(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -4407,7 +4405,7 @@ public class TelephonyManager {
/**
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
private ITelephony getITelephony() {
return ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE));
}
@@ -7932,7 +7930,7 @@ public class TelephonyManager {
* either READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE to retrieve the information.
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@UnsupportedAppUsage
public ServiceState getServiceStateForSubscriber(int subId) {
try {
ITelephony service = getITelephony();