Merge "Add more error codes." into qt-qpr1-dev-plus-aosp

This commit is contained in:
Daniel Huang
2019-12-11 02:31:00 +00:00
committed by Android (Google) Code Review
2 changed files with 80 additions and 5 deletions

View File

@@ -45251,6 +45251,7 @@ package android.telephony {
field public static final int APPTYPE_USIM = 2; // 0x2
field public static final int AUTHTYPE_EAP_AKA = 129; // 0x81
field public static final int AUTHTYPE_EAP_SIM = 128; // 0x80
field public static final long CALLBACK_ON_MORE_ERROR_CODE_CHANGE = 130595455L; // 0x7c8ba7fL
field public static final int CALL_STATE_IDLE = 0; // 0x0
field public static final int CALL_STATE_OFFHOOK = 2; // 0x2
field public static final int CALL_STATE_RINGING = 1; // 0x1
@@ -45320,6 +45321,8 @@ package android.telephony {
field public static final int PHONE_TYPE_NONE = 0; // 0x0
field public static final int PHONE_TYPE_SIP = 3; // 0x3
field public static final int SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION = 2; // 0x2
field public static final int SET_OPPORTUNISTIC_SUB_NO_OPPORTUNISTIC_SUB_AVAILABLE = 3; // 0x3
field public static final int SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION = 4; // 0x4
field public static final int SET_OPPORTUNISTIC_SUB_SUCCESS = 0; // 0x0
field public static final int SET_OPPORTUNISTIC_SUB_VALIDATION_FAILED = 1; // 0x1
field public static final int SIM_STATE_ABSENT = 1; // 0x1
@@ -45336,8 +45339,14 @@ package android.telephony {
field public static final int UNKNOWN_CARRIER_ID = -1; // 0xffffffff
field public static final int UNSUPPORTED_CARD_ID = -1; // 0xffffffff
field public static final int UPDATE_AVAILABLE_NETWORKS_ABORTED = 2; // 0x2
field public static final int UPDATE_AVAILABLE_NETWORKS_DISABLE_MODEM_FAIL = 5; // 0x5
field public static final int UPDATE_AVAILABLE_NETWORKS_ENABLE_MODEM_FAIL = 6; // 0x6
field public static final int UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS = 3; // 0x3
field public static final int UPDATE_AVAILABLE_NETWORKS_MULTIPLE_NETWORKS_NOT_SUPPORTED = 7; // 0x7
field public static final int UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE = 4; // 0x4
field public static final int UPDATE_AVAILABLE_NETWORKS_NO_OPPORTUNISTIC_SUB_AVAILABLE = 8; // 0x8
field public static final int UPDATE_AVAILABLE_NETWORKS_REMOTE_SERVICE_EXCEPTION = 9; // 0x9
field public static final int UPDATE_AVAILABLE_NETWORKS_SERVICE_IS_DISABLED = 10; // 0xa
field public static final int UPDATE_AVAILABLE_NETWORKS_SUCCESS = 0; // 0x0
field public static final int UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE = 1; // 0x1
field public static final int USSD_ERROR_SERVICE_UNAVAIL = -2; // 0xfffffffe

View File

@@ -38,6 +38,9 @@ import android.annotation.UnsupportedAppUsage;
import android.annotation.WorkerThread;
import android.app.ActivityThread;
import android.app.PendingIntent;
import android.compat.Compatibility;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -141,6 +144,14 @@ import java.util.regex.Pattern;
public class TelephonyManager {
private static final String TAG = "TelephonyManager";
/**
* To expand the error codes for {@link TelephonyManager#updateAvailableNetworks} and
* {@link TelephonyManager#setPreferredOpportunisticDataSubscription}.
*/
@ChangeId
@EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q)
public static final long CALLBACK_ON_MORE_ERROR_CODE_CHANGE = 130595455L;
/**
* The key to use when placing the result of {@link #requestModemActivityInfo(ResultReceiver)}
* into the ResultReceiver Bundle.
@@ -11208,7 +11219,9 @@ public class TelephonyManager {
@IntDef(prefix = {"SET_OPPORTUNISTIC_SUB"}, value = {
SET_OPPORTUNISTIC_SUB_SUCCESS,
SET_OPPORTUNISTIC_SUB_VALIDATION_FAILED,
SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION})
SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION,
SET_OPPORTUNISTIC_SUB_NO_OPPORTUNISTIC_SUB_AVAILABLE,
SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION})
public @interface SetOpportunisticSubscriptionResult {}
/**
@@ -11226,6 +11239,16 @@ public class TelephonyManager {
*/
public static final int SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION = 2;
/**
* The subscription is not valid. It must be an opportunistic subscription.
*/
public static final int SET_OPPORTUNISTIC_SUB_NO_OPPORTUNISTIC_SUB_AVAILABLE = 3;
/**
* Subscription service happened remote exception.
*/
public static final int SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION = 4;
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = {"UPDATE_AVAILABLE_NETWORKS"}, value = {
@@ -11233,7 +11256,13 @@ public class TelephonyManager {
UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE,
UPDATE_AVAILABLE_NETWORKS_ABORTED,
UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS,
UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE})
UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE,
UPDATE_AVAILABLE_NETWORKS_DISABLE_MODEM_FAIL,
UPDATE_AVAILABLE_NETWORKS_ENABLE_MODEM_FAIL,
UPDATE_AVAILABLE_NETWORKS_MULTIPLE_NETWORKS_NOT_SUPPORTED,
UPDATE_AVAILABLE_NETWORKS_NO_OPPORTUNISTIC_SUB_AVAILABLE,
UPDATE_AVAILABLE_NETWORKS_REMOTE_SERVICE_EXCEPTION,
UPDATE_AVAILABLE_NETWORKS_SERVICE_IS_DISABLED})
public @interface UpdateAvailableNetworksResult {}
/**
@@ -11261,6 +11290,36 @@ public class TelephonyManager {
*/
public static final int UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE = 4;
/**
* Disable modem fail.
*/
public static final int UPDATE_AVAILABLE_NETWORKS_DISABLE_MODEM_FAIL = 5;
/**
* Enable modem fail.
*/
public static final int UPDATE_AVAILABLE_NETWORKS_ENABLE_MODEM_FAIL = 6;
/**
* Carrier app does not support multiple available networks.
*/
public static final int UPDATE_AVAILABLE_NETWORKS_MULTIPLE_NETWORKS_NOT_SUPPORTED = 7;
/**
* The subscription is not valid. It must be an opportunistic subscription.
*/
public static final int UPDATE_AVAILABLE_NETWORKS_NO_OPPORTUNISTIC_SUB_AVAILABLE = 8;
/**
* There is no OpportunisticNetworkService.
*/
public static final int UPDATE_AVAILABLE_NETWORKS_REMOTE_SERVICE_EXCEPTION = 9;
/**
* OpportunisticNetworkService is disabled.
*/
public static final int UPDATE_AVAILABLE_NETWORKS_SERVICE_IS_DISABLED = 10;
/**
* Set preferred opportunistic data subscription id.
*
@@ -11293,7 +11352,11 @@ public class TelephonyManager {
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> {
callback.accept(SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION);
if (Compatibility.isChangeEnabled(CALLBACK_ON_MORE_ERROR_CODE_CHANGE)) {
callback.accept(SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION);
} else {
callback.accept(SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION);
}
});
} finally {
Binder.restoreCallingIdentity(identity);
@@ -11387,9 +11450,12 @@ public class TelephonyManager {
if (iOpportunisticNetworkService == null) {
final long identity = Binder.clearCallingIdentity();
try {
/* Todo<b/130595455> passing unknown due to lack of good error codes */
executor.execute(() -> {
callback.accept(UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE);
if (Compatibility.isChangeEnabled(CALLBACK_ON_MORE_ERROR_CODE_CHANGE)) {
callback.accept(UPDATE_AVAILABLE_NETWORKS_REMOTE_SERVICE_EXCEPTION);
} else {
callback.accept(UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE);
}
});
} finally {
Binder.restoreCallingIdentity(identity);