Merge "Update PhoneStateListener#onOutgoingEmergencySms"
diff --git a/Android.bp b/Android.bp
index 1d80153..87b7dc1 100644
--- a/Android.bp
+++ b/Android.bp
@@ -465,6 +465,7 @@
"android.hardware.radio-V1.3-java",
"android.hardware.radio-V1.4-java",
"android.hardware.radio-V1.5-java",
+ "android.hardware.radio-V1.6-java",
"android.hardware.thermal-V1.0-java-constants",
"android.hardware.thermal-V1.0-java",
"android.hardware.thermal-V1.1-java",
diff --git a/api/current.txt b/api/current.txt
index b251612..99d59d2 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -45977,6 +45977,7 @@
field public static final int MISSED = 5; // 0x5
field public static final int OTHER = 9; // 0x9
field public static final String REASON_EMERGENCY_CALL_PLACED = "REASON_EMERGENCY_CALL_PLACED";
+ field public static final String REASON_EMULATING_SINGLE_CALL = "EMULATING_SINGLE_CALL";
field public static final String REASON_IMS_ACCESS_BLOCKED = "REASON_IMS_ACCESS_BLOCKED";
field public static final String REASON_WIFI_ON_BUT_WFC_OFF = "REASON_WIFI_ON_BUT_WFC_OFF";
field public static final int REJECTED = 6; // 0x6
diff --git a/api/module-lib-current.txt b/api/module-lib-current.txt
index 2f0ae78..3b32b53 100644
--- a/api/module-lib-current.txt
+++ b/api/module-lib-current.txt
@@ -71,6 +71,18 @@
}
+package android.telephony {
+
+ public abstract class CellSignalStrength {
+ method public static int getNumSignalStrengthLevels();
+ }
+
+ public class TelephonyManager {
+ method @NonNull public static int[] getAllNetworkTypes();
+ }
+
+}
+
package android.util {
public final class Log {
diff --git a/api/system-current.txt b/api/system-current.txt
index 37ce4cf..483a48a 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -10270,10 +10270,6 @@
method public final void addExistingConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.Connection, @NonNull android.telecom.Conference);
}
- public final class DisconnectCause implements android.os.Parcelable {
- field public static final String REASON_EMULATING_SINGLE_CALL = "EMULATING_SINGLE_CALL";
- }
-
public abstract class InCallService extends android.app.Service {
method @Deprecated public android.telecom.Phone getPhone();
method @Deprecated public void onPhoneCreated(android.telecom.Phone);
@@ -10543,6 +10539,22 @@
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
}
+ public final class CallForwardingInfo implements android.os.Parcelable {
+ ctor public CallForwardingInfo(boolean, int, @Nullable String, int);
+ method public int describeContents();
+ method @Nullable public String getNumber();
+ method public int getReason();
+ method public int getTimeoutSeconds();
+ method public boolean isEnabled();
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
+ field public static final int REASON_ALL = 4; // 0x4
+ field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int REASON_BUSY = 1; // 0x1
+ field public static final int REASON_NOT_REACHABLE = 3; // 0x3
+ field public static final int REASON_NO_REPLY = 2; // 0x2
+ field public static final int REASON_UNCONDITIONAL = 0; // 0x0
+ }
+
public final class CallQuality implements android.os.Parcelable {
ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
@@ -11185,6 +11197,8 @@
method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
@@ -11263,6 +11277,8 @@
method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallForwarding(@NonNull android.telephony.CallForwardingInfo, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingEnabled(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
@@ -11301,6 +11317,10 @@
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";
+ field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
+ field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
+ field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
+ field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
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
@@ -11357,6 +11377,15 @@
field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
}
+ public static interface TelephonyManager.CallForwardingInfoCallback {
+ method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
+ method public void onError(int);
+ field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 2; // 0x2
+ field public static final int RESULT_ERROR_NOT_SUPPORTED = 3; // 0x3
+ field public static final int RESULT_ERROR_UNKNOWN = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
public final class UiccAccessRule implements android.os.Parcelable {
ctor public UiccAccessRule(byte[], @Nullable String, long);
method public int describeContents();
@@ -11434,11 +11463,11 @@
method public int getSuggestedRetryTime();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
- field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 2; // 0x2
- field public static final int HANDOVER_FAILURE_MODE_LEGACY = 1; // 0x1
- field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 3; // 0x3
- field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 4; // 0x4
- field public static final int HANDOVER_FAILURE_MODE_UNKNOWN = 0; // 0x0
+ field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
+ field public static final int HANDOVER_FAILURE_MODE_LEGACY = 0; // 0x0
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; // 0x2
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; // 0x3
+ field public static final int HANDOVER_FAILURE_MODE_UNKNOWN = -1; // 0xffffffff
field public static final int LINK_STATUS_ACTIVE = 2; // 0x2
field public static final int LINK_STATUS_DORMANT = 1; // 0x1
field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
diff --git a/core/java/android/net/vcn/OWNERS b/core/java/android/net/vcn/OWNERS
new file mode 100644
index 0000000..33b9f0f
--- /dev/null
+++ b/core/java/android/net/vcn/OWNERS
@@ -0,0 +1,7 @@
+set noparent
+
+benedictwong@google.com
+ckesting@google.com
+evitayan@google.com
+nharold@google.com
+jchalard@google.com
\ No newline at end of file
diff --git a/core/java/com/android/internal/net/VpnConfig.java b/core/java/com/android/internal/net/VpnConfig.java
index 7dc3871..c0648ab 100644
--- a/core/java/com/android/internal/net/VpnConfig.java
+++ b/core/java/com/android/internal/net/VpnConfig.java
@@ -70,7 +70,8 @@
intent.setClassName(DIALOGS_PACKAGE, DIALOGS_PACKAGE + ".ManageDialog");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY |
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
- return PendingIntent.getActivityAsUser(context, 0, intent, 0, null, UserHandle.CURRENT);
+ return PendingIntent.getActivityAsUser(context, 0 /* requestCode */, intent,
+ PendingIntent.FLAG_IMMUTABLE, null /* options */, UserHandle.CURRENT);
}
public static CharSequence getVpnLabel(Context context, String packageName)
diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml
index 419398d..0806e71 100644
--- a/data/etc/privapp-permissions-platform.xml
+++ b/data/etc/privapp-permissions-platform.xml
@@ -164,6 +164,7 @@
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
<permission name="android.permission.LOCAL_MAC_ADDRESS"/>
<permission name="android.permission.MANAGE_USERS"/>
+ <permission name="android.permission.MANAGE_SUBSCRIPTION_PLANS" />
<permission name="android.permission.MODIFY_PHONE_STATE"/>
<permission name="android.permission.PACKAGE_USAGE_STATS"/>
<permission name="android.permission.PERFORM_CDMA_PROVISIONING"/>
diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java
index cc5286d..9707260 100644
--- a/keystore/java/android/security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java
+++ b/keystore/java/android/security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java
@@ -177,7 +177,7 @@
&& (keymasterSwEnforcedUserAuthenticators == 0);
boolean userAuthenticationValidWhileOnBody =
keyCharacteristics.hwEnforced.getBoolean(KeymasterDefs.KM_TAG_ALLOW_WHILE_ON_BODY);
- boolean trustedUserPresenceRequred =
+ boolean trustedUserPresenceRequired =
keyCharacteristics.hwEnforced.getBoolean(
KeymasterDefs.KM_TAG_TRUSTED_USER_PRESENCE_REQUIRED);
@@ -209,7 +209,7 @@
keymasterHwEnforcedUserAuthenticators,
userAuthenticationRequirementEnforcedBySecureHardware,
userAuthenticationValidWhileOnBody,
- trustedUserPresenceRequred,
+ trustedUserPresenceRequired,
invalidatedByBiometricEnrollment,
userConfirmationRequired);
}
diff --git a/keystore/java/android/security/keystore/KeyStoreCryptoOperationUtils.java b/keystore/java/android/security/keystore/KeyStoreCryptoOperationUtils.java
index 773729e..c82b6e6b 100644
--- a/keystore/java/android/security/keystore/KeyStoreCryptoOperationUtils.java
+++ b/keystore/java/android/security/keystore/KeyStoreCryptoOperationUtils.java
@@ -48,7 +48,7 @@
return null;
}
- // An error occured. However, some errors should not lead to init throwing an exception.
+ // An error occurred. However, some errors should not lead to init throwing an exception.
// See below.
InvalidKeyException e =
keyStore.getInvalidKeyException(key.getAlias(), key.getUid(), beginOpResultCode);
diff --git a/native/android/Android.bp b/native/android/Android.bp
index 797d3fd..02e1ebe 100644
--- a/native/android/Android.bp
+++ b/native/android/Android.bp
@@ -105,6 +105,7 @@
cc_library_shared {
name: "libandroid_net",
defaults: ["libandroid_defaults"],
+ llndk_stubs: "libandroid_net.llndk",
srcs: ["net.c"],
shared_libs: ["libnetd_client"],
@@ -113,7 +114,7 @@
}
llndk_library {
- name: "libandroid_net",
+ name: "libandroid_net.llndk",
export_include_dirs: ["include"],
symbol_file: "libandroid_net.map.txt",
unversioned: true,
diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt
index c9959da..ae3b2ff 100644
--- a/non-updatable-api/current.txt
+++ b/non-updatable-api/current.txt
@@ -44145,6 +44145,7 @@
field public static final int MISSED = 5; // 0x5
field public static final int OTHER = 9; // 0x9
field public static final String REASON_EMERGENCY_CALL_PLACED = "REASON_EMERGENCY_CALL_PLACED";
+ field public static final String REASON_EMULATING_SINGLE_CALL = "EMULATING_SINGLE_CALL";
field public static final String REASON_IMS_ACCESS_BLOCKED = "REASON_IMS_ACCESS_BLOCKED";
field public static final String REASON_WIFI_ON_BUT_WFC_OFF = "REASON_WIFI_ON_BUT_WFC_OFF";
field public static final int REJECTED = 6; // 0x6
diff --git a/non-updatable-api/module-lib-current.txt b/non-updatable-api/module-lib-current.txt
index d4d9f62..198134e 100644
--- a/non-updatable-api/module-lib-current.txt
+++ b/non-updatable-api/module-lib-current.txt
@@ -26,6 +26,18 @@
}
+package android.telephony {
+
+ public abstract class CellSignalStrength {
+ method public static int getNumSignalStrengthLevels();
+ }
+
+ public class TelephonyManager {
+ method @NonNull public static int[] getAllNetworkTypes();
+ }
+
+}
+
package android.util {
public final class Log {
diff --git a/non-updatable-api/system-current.txt b/non-updatable-api/system-current.txt
index b39527b..8d6031b 100644
--- a/non-updatable-api/system-current.txt
+++ b/non-updatable-api/system-current.txt
@@ -9152,10 +9152,6 @@
method public final void addExistingConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.Connection, @NonNull android.telecom.Conference);
}
- public final class DisconnectCause implements android.os.Parcelable {
- field public static final String REASON_EMULATING_SINGLE_CALL = "EMULATING_SINGLE_CALL";
- }
-
public abstract class InCallService extends android.app.Service {
method @Deprecated public android.telecom.Phone getPhone();
method @Deprecated public void onPhoneCreated(android.telecom.Phone);
@@ -9425,6 +9421,22 @@
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
}
+ public final class CallForwardingInfo implements android.os.Parcelable {
+ ctor public CallForwardingInfo(boolean, int, @Nullable String, int);
+ method public int describeContents();
+ method @Nullable public String getNumber();
+ method public int getReason();
+ method public int getTimeoutSeconds();
+ method public boolean isEnabled();
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
+ field public static final int REASON_ALL = 4; // 0x4
+ field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int REASON_BUSY = 1; // 0x1
+ field public static final int REASON_NOT_REACHABLE = 3; // 0x3
+ field public static final int REASON_NO_REPLY = 2; // 0x2
+ field public static final int REASON_UNCONDITIONAL = 0; // 0x0
+ }
+
public final class CallQuality implements android.os.Parcelable {
ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
@@ -10067,6 +10079,8 @@
method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
@@ -10145,6 +10159,8 @@
method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallForwarding(@NonNull android.telephony.CallForwardingInfo, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingEnabled(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
@@ -10183,6 +10199,10 @@
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";
+ field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
+ field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
+ field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
+ field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
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
@@ -10239,6 +10259,15 @@
field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
}
+ public static interface TelephonyManager.CallForwardingInfoCallback {
+ method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
+ method public void onError(int);
+ field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 2; // 0x2
+ field public static final int RESULT_ERROR_NOT_SUPPORTED = 3; // 0x3
+ field public static final int RESULT_ERROR_UNKNOWN = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
public final class UiccAccessRule implements android.os.Parcelable {
ctor public UiccAccessRule(byte[], @Nullable String, long);
method public int describeContents();
@@ -10316,11 +10345,11 @@
method public int getSuggestedRetryTime();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
- field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 2; // 0x2
- field public static final int HANDOVER_FAILURE_MODE_LEGACY = 1; // 0x1
- field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 3; // 0x3
- field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 4; // 0x4
- field public static final int HANDOVER_FAILURE_MODE_UNKNOWN = 0; // 0x0
+ field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
+ field public static final int HANDOVER_FAILURE_MODE_LEGACY = 0; // 0x0
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; // 0x2
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; // 0x3
+ field public static final int HANDOVER_FAILURE_MODE_UNKNOWN = -1; // 0xffffffff
field public static final int LINK_STATUS_ACTIVE = 2; // 0x2
field public static final int LINK_STATUS_DORMANT = 1; // 0x1
field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
diff --git a/packages/Tethering/res/values-mcc310-mnc004-ne/strings.xml b/packages/Tethering/res/values-mcc310-mnc004-ne/strings.xml
new file mode 100644
index 0000000..d074f15
--- /dev/null
+++ b/packages/Tethering/res/values-mcc310-mnc004-ne/strings.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="no_upstream_notification_title" msgid="5030042590486713460">"टेदरिङमार्फत इन्टरनेट कनेक्सन प्राप्त हुन सकेन"</string>
+ <string name="no_upstream_notification_message" msgid="3843613362272973447">"यन्त्रहरू कनेक्ट गर्न सकिएन"</string>
+ <string name="no_upstream_notification_disable_button" msgid="6385491461813507624">"टेदरिङ निष्क्रिय पार्नुहोस्"</string>
+ <string name="upstream_roaming_notification_title" msgid="3015912166812283303">"हटस्पट वा टेदरिङ सक्रिय छ"</string>
+ <string name="upstream_roaming_notification_message" msgid="6724434706748439902">"रोमिङ सेवा प्रयोग गर्दा अतिरिक्त शुल्क लाग्न सक्छ"</string>
+</resources>
diff --git a/packages/Tethering/res/values-mcc310-mnc004-zh-rTW/strings.xml b/packages/Tethering/res/values-mcc310-mnc004-zh-rTW/strings.xml
new file mode 100644
index 0000000..528a1e5
--- /dev/null
+++ b/packages/Tethering/res/values-mcc310-mnc004-zh-rTW/strings.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="no_upstream_notification_title" msgid="5030042590486713460">"無法透過網路共用連上網際網路"</string>
+ <string name="no_upstream_notification_message" msgid="3843613362272973447">"裝置無法連線"</string>
+ <string name="no_upstream_notification_disable_button" msgid="6385491461813507624">"關閉網路共用"</string>
+ <string name="upstream_roaming_notification_title" msgid="3015912166812283303">"無線基地台或網路共用已開啟"</string>
+ <string name="upstream_roaming_notification_message" msgid="6724434706748439902">"使用漫遊服務可能須支付額外費用"</string>
+</resources>
diff --git a/packages/Tethering/res/values-mcc311-mnc480-ne/strings.xml b/packages/Tethering/res/values-mcc311-mnc480-ne/strings.xml
new file mode 100644
index 0000000..1503244
--- /dev/null
+++ b/packages/Tethering/res/values-mcc311-mnc480-ne/strings.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="no_upstream_notification_title" msgid="611650570559011140">"टेदरिङमार्फत इन्टरनेट कनेक्सन प्राप्त हुन सकेन"</string>
+ <string name="no_upstream_notification_message" msgid="6508394877641864863">"यन्त्रहरू कनेक्ट गर्न सकिएन"</string>
+ <string name="no_upstream_notification_disable_button" msgid="7609346639290990508">"टेदरिङ निष्क्रिय पार्नुहोस्"</string>
+ <string name="upstream_roaming_notification_title" msgid="6032901176124830787">"हटस्पट वा टेदरिङ सक्रिय छ"</string>
+ <string name="upstream_roaming_notification_message" msgid="7599056263326217523">"रोमिङ सेवा प्रयोग गर्दा अतिरिक्त शुल्क लाग्न सक्छ"</string>
+</resources>
diff --git a/packages/Tethering/res/values-mcc311-mnc480-zh-rTW/strings.xml b/packages/Tethering/res/values-mcc311-mnc480-zh-rTW/strings.xml
new file mode 100644
index 0000000..cd653df
--- /dev/null
+++ b/packages/Tethering/res/values-mcc311-mnc480-zh-rTW/strings.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="no_upstream_notification_title" msgid="611650570559011140">"無法透過網路共用連上網際網路"</string>
+ <string name="no_upstream_notification_message" msgid="6508394877641864863">"裝置無法連線"</string>
+ <string name="no_upstream_notification_disable_button" msgid="7609346639290990508">"關閉網路共用"</string>
+ <string name="upstream_roaming_notification_title" msgid="6032901176124830787">"無線基地台或網路共用已開啟"</string>
+ <string name="upstream_roaming_notification_message" msgid="7599056263326217523">"使用漫遊服務可能須支付額外費用"</string>
+</resources>
diff --git a/packages/Tethering/res/values-zh-rTW/strings.xml b/packages/Tethering/res/values-zh-rTW/strings.xml
index 9a117bb..50a50bf 100644
--- a/packages/Tethering/res/values-zh-rTW/strings.xml
+++ b/packages/Tethering/res/values-zh-rTW/strings.xml
@@ -1,8 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="tethered_notification_title" msgid="3146694234398202601">"網路共用或無線基地台已啟用"</string>
- <string name="tethered_notification_message" msgid="2113628520792055377">"輕觸即可進行設定。"</string>
- <string name="disable_tether_notification_title" msgid="7526977944111313195">"數據連線已停用"</string>
- <string name="disable_tether_notification_message" msgid="2913366428516852495">"詳情請洽你的管理員"</string>
+ <string name="tethered_notification_title" msgid="6426563586025792944">"網路共用或無線基地台已啟用"</string>
+ <string name="tethered_notification_message" msgid="64800879503420696">"輕觸即可進行設定。"</string>
+ <string name="disable_tether_notification_title" msgid="3004509127903564191">"網路共用已停用"</string>
+ <string name="disable_tether_notification_message" msgid="6717523799293901476">"詳情請洽你的管理員"</string>
+ <string name="notification_channel_tethering_status" msgid="2663463891530932727">"無線基地台與網路共用狀態"</string>
+ <string name="no_upstream_notification_title" msgid="1204601824631788482"></string>
+ <string name="no_upstream_notification_message" msgid="8586582938243032621"></string>
+ <string name="no_upstream_notification_disable_button" msgid="8800919436924640822"></string>
+ <string name="upstream_roaming_notification_title" msgid="4772373823198997030"></string>
+ <string name="upstream_roaming_notification_message" msgid="3985577843181551650"></string>
</resources>
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 0cd6e0810..afea976 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -929,13 +929,6 @@
}
/**
- * @see ServiceManager#checkService(String)
- */
- public boolean hasService(@NonNull String name) {
- return ServiceManager.checkService(name) != null;
- }
-
- /**
* @see IpConnectivityMetrics.Logger
*/
public IpConnectivityMetrics.Logger getMetricsLogger() {
@@ -1078,7 +1071,8 @@
// Do the same for Ethernet, since it's often not specified in the configs, although many
// devices can use it via USB host adapters.
- if (mNetConfigs[TYPE_ETHERNET] == null && mDeps.hasService(Context.ETHERNET_SERVICE)) {
+ if (mNetConfigs[TYPE_ETHERNET] == null
+ && mContext.getSystemService(Context.ETHERNET_SERVICE) != null) {
mLegacyTypeTracker.addSupportedType(TYPE_ETHERNET);
mNetworksDefined++;
}
diff --git a/services/core/java/com/android/server/connectivity/LingerMonitor.java b/services/core/java/com/android/server/connectivity/LingerMonitor.java
index 04c000f..7fdc7a0 100644
--- a/services/core/java/com/android/server/connectivity/LingerMonitor.java
+++ b/services/core/java/com/android/server/connectivity/LingerMonitor.java
@@ -159,8 +159,9 @@
@VisibleForTesting
protected PendingIntent createNotificationIntent() {
- return PendingIntent.getActivityAsUser(mContext, 0, CELLULAR_SETTINGS,
- PendingIntent.FLAG_CANCEL_CURRENT, null, UserHandle.CURRENT);
+ return PendingIntent.getActivityAsUser(mContext, 0 /* requestCode */, CELLULAR_SETTINGS,
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
+ null /* options */, UserHandle.CURRENT);
}
// Removes any notification that was put up as a result of switching to nai.
diff --git a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
index 34b0aa2..26356b4 100644
--- a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
+++ b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
@@ -325,7 +325,8 @@
public void setProvNotificationVisible(boolean visible, int id, String action) {
if (visible) {
Intent intent = new Intent(action);
- PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(
+ mContext, 0 /* requestCode */, intent, PendingIntent.FLAG_IMMUTABLE);
showNotification(id, NotificationType.SIGN_IN, null, null, pendingIntent, false);
} else {
clearNotification(id);
diff --git a/services/core/java/com/android/server/net/LockdownVpnTracker.java b/services/core/java/com/android/server/net/LockdownVpnTracker.java
index 05f2808..3a262d6 100644
--- a/services/core/java/com/android/server/net/LockdownVpnTracker.java
+++ b/services/core/java/com/android/server/net/LockdownVpnTracker.java
@@ -95,11 +95,13 @@
mProfile = Objects.requireNonNull(profile);
final Intent configIntent = new Intent(ACTION_VPN_SETTINGS);
- mConfigIntent = PendingIntent.getActivity(mContext, 0, configIntent, 0);
+ mConfigIntent = PendingIntent.getActivity(mContext, 0 /* requestCode */, configIntent,
+ PendingIntent.FLAG_IMMUTABLE);
final Intent resetIntent = new Intent(ACTION_LOCKDOWN_RESET);
resetIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
- mResetIntent = PendingIntent.getBroadcast(mContext, 0, resetIntent, 0);
+ mResetIntent = PendingIntent.getBroadcast(mContext, 0 /* requestCode */, resetIntent,
+ PendingIntent.FLAG_IMMUTABLE);
}
/**
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index a31aacb..ffdcf7e 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -96,7 +96,9 @@
import static com.android.internal.util.XmlUtils.readIntAttribute;
import static com.android.internal.util.XmlUtils.readLongAttribute;
import static com.android.internal.util.XmlUtils.readStringAttribute;
+import static com.android.internal.util.XmlUtils.readThisIntArrayXml;
import static com.android.internal.util.XmlUtils.writeBooleanAttribute;
+import static com.android.internal.util.XmlUtils.writeIntArrayXml;
import static com.android.internal.util.XmlUtils.writeIntAttribute;
import static com.android.internal.util.XmlUtils.writeLongAttribute;
import static com.android.internal.util.XmlUtils.writeStringAttribute;
@@ -229,6 +231,7 @@
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.StatLogger;
+import com.android.internal.util.XmlUtils;
import com.android.server.EventLogTags;
import com.android.server.LocalServices;
import com.android.server.ServiceThread;
@@ -239,6 +242,7 @@
import libcore.io.IoUtils;
import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;
import java.io.File;
@@ -313,7 +317,8 @@
private static final int VERSION_ADDED_NETWORK_ID = 9;
private static final int VERSION_SWITCH_UID = 10;
private static final int VERSION_ADDED_CYCLE = 11;
- private static final int VERSION_LATEST = VERSION_ADDED_CYCLE;
+ private static final int VERSION_ADDED_NETWORK_TYPES = 12;
+ private static final int VERSION_LATEST = VERSION_ADDED_NETWORK_TYPES;
@VisibleForTesting
public static final int TYPE_WARNING = SystemMessage.NOTE_NET_WARNING;
@@ -332,6 +337,7 @@
private static final String TAG_WHITELIST = "whitelist";
private static final String TAG_RESTRICT_BACKGROUND = "restrict-background";
private static final String TAG_REVOKED_RESTRICT_BACKGROUND = "revoked-restrict-background";
+ private static final String TAG_XML_UTILS_INT_ARRAY = "int-array";
private static final String ATTR_VERSION = "version";
private static final String ATTR_RESTRICT_BACKGROUND = "restrictBackground";
@@ -360,6 +366,8 @@
private static final String ATTR_USAGE_BYTES = "usageBytes";
private static final String ATTR_USAGE_TIME = "usageTime";
private static final String ATTR_OWNER_PACKAGE = "ownerPackage";
+ private static final String ATTR_NETWORK_TYPES = "networkTypes";
+ private static final String ATTR_XML_UTILS_NAME = "name";
private static final String ACTION_ALLOW_BACKGROUND =
"com.android.server.net.action.ALLOW_BACKGROUND";
@@ -2311,13 +2319,25 @@
}
final int subId = readIntAttribute(in, ATTR_SUB_ID);
+ final String ownerPackage = readStringAttribute(in, ATTR_OWNER_PACKAGE);
+
+ if (version >= VERSION_ADDED_NETWORK_TYPES) {
+ final int depth = in.getDepth();
+ while (XmlUtils.nextElementWithin(in, depth)) {
+ if (TAG_XML_UTILS_INT_ARRAY.equals(in.getName())
+ && ATTR_NETWORK_TYPES.equals(
+ readStringAttribute(in, ATTR_XML_UTILS_NAME))) {
+ final int[] networkTypes =
+ readThisIntArrayXml(in, TAG_XML_UTILS_INT_ARRAY, null);
+ builder.setNetworkTypes(networkTypes);
+ }
+ }
+ }
+
final SubscriptionPlan plan = builder.build();
mSubscriptionPlans.put(subId, ArrayUtils.appendElement(
SubscriptionPlan.class, mSubscriptionPlans.get(subId), plan));
-
- final String ownerPackage = readStringAttribute(in, ATTR_OWNER_PACKAGE);
mSubscriptionPlansOwner.put(subId, ownerPackage);
-
} else if (TAG_UID_POLICY.equals(tag)) {
final int uid = readIntAttribute(in, ATTR_UID);
final int policy = readIntAttribute(in, ATTR_POLICY);
@@ -2513,6 +2533,9 @@
writeIntAttribute(out, ATTR_LIMIT_BEHAVIOR, plan.getDataLimitBehavior());
writeLongAttribute(out, ATTR_USAGE_BYTES, plan.getDataUsageBytes());
writeLongAttribute(out, ATTR_USAGE_TIME, plan.getDataUsageTime());
+ try {
+ writeIntArrayXml(plan.getNetworkTypes(), ATTR_NETWORK_TYPES, out);
+ } catch (XmlPullParserException ignored) { }
out.endTag(null, TAG_SUBSCRIPTION_PLAN);
}
}
@@ -3310,7 +3333,8 @@
// let in core system components (like the Settings app).
final String ownerPackage = mSubscriptionPlansOwner.get(subId);
if (Objects.equals(ownerPackage, callingPackage)
- || (UserHandle.getCallingAppId() == android.os.Process.SYSTEM_UID)) {
+ || (UserHandle.getCallingAppId() == android.os.Process.SYSTEM_UID)
+ || (UserHandle.getCallingAppId() == android.os.Process.PHONE_UID)) {
return mSubscriptionPlans.get(subId);
} else {
Log.w(TAG, "Not returning plans because caller " + callingPackage
diff --git a/telecomm/java/android/telecom/DisconnectCause.java b/telecomm/java/android/telecom/DisconnectCause.java
index f7fe1ba..1472a4a 100644
--- a/telecomm/java/android/telecom/DisconnectCause.java
+++ b/telecomm/java/android/telecom/DisconnectCause.java
@@ -16,7 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
import android.media.ToneGenerator;
import android.os.Parcel;
import android.os.Parcelable;
@@ -97,10 +96,7 @@
*
* This reason code is only used for communication between a {@link ConnectionService} and
* Telecom and should not be surfaced to the user.
- *
- * @hide
*/
- @SystemApi
public static final String REASON_EMULATING_SINGLE_CALL = "EMULATING_SINGLE_CALL";
/**
diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java
index cb57df0..5024ae2 100644
--- a/telecomm/java/android/telecom/PhoneAccount.java
+++ b/telecomm/java/android/telecom/PhoneAccount.java
@@ -27,6 +27,7 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.telephony.TelephonyManager;
import android.text.TextUtils;
import java.util.ArrayList;
@@ -47,12 +48,20 @@
public final class PhoneAccount implements Parcelable {
/**
- * String extra which determines the order in which {@link PhoneAccount}s are sorted
+ * Integer extra which determines the order in which {@link PhoneAccount}s are sorted
*
* This is an extras key set via {@link Builder#setExtras} which determines the order in which
* {@link PhoneAccount}s from the same {@link ConnectionService} are sorted. The accounts
- * are sorted by this key via standard lexicographical order, and this ordering is used to
+ * are sorted in ascending order by this key, and this ordering is used to
* determine priority when a call can be placed via multiple accounts.
+ *
+ * When multiple {@link PhoneAccount}s are supplied with the same sort order key, no ordering is
+ * guaranteed between those {@link PhoneAccount}s. Additionally, no ordering is guaranteed
+ * between {@link PhoneAccount}s that do not supply this extra, and all such accounts
+ * will be sorted after the accounts that do supply this extra.
+ *
+ * An example of a sort order key is slot index (see {@link TelephonyManager#getSlotIndex()}),
+ * which is the one used by the cell Telephony stack.
* @hide
*/
@SystemApi
diff --git a/telephony/api/system-current.txt b/telephony/api/system-current.txt
index b092ec6..24eea0e 100644
--- a/telephony/api/system-current.txt
+++ b/telephony/api/system-current.txt
@@ -27,6 +27,22 @@
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
}
+ public final class CallForwardingInfo implements android.os.Parcelable {
+ ctor public CallForwardingInfo(boolean, int, @Nullable String, int);
+ method public int describeContents();
+ method @Nullable public String getNumber();
+ method public int getReason();
+ method public int getTimeoutSeconds();
+ method public boolean isEnabled();
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
+ field public static final int REASON_ALL = 4; // 0x4
+ field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int REASON_BUSY = 1; // 0x1
+ field public static final int REASON_NOT_REACHABLE = 3; // 0x3
+ field public static final int REASON_NO_REPLY = 2; // 0x2
+ field public static final int REASON_UNCONDITIONAL = 0; // 0x0
+ }
+
public final class CallQuality implements android.os.Parcelable {
ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
@@ -640,6 +656,8 @@
method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
@@ -719,6 +737,8 @@
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallForwarding(@NonNull android.telephony.CallForwardingInfo, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingEnabled(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean);
@@ -756,6 +776,10 @@
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";
+ field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
+ field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
+ field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
+ field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
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
@@ -812,6 +836,15 @@
field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
}
+ public static interface TelephonyManager.CallForwardingInfoCallback {
+ method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
+ method public void onError(int);
+ field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 2; // 0x2
+ field public static final int RESULT_ERROR_NOT_SUPPORTED = 3; // 0x3
+ field public static final int RESULT_ERROR_UNKNOWN = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
public final class UiccAccessRule implements android.os.Parcelable {
ctor public UiccAccessRule(byte[], @Nullable String, long);
method public int describeContents();
@@ -889,11 +922,11 @@
method public int getSuggestedRetryTime();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
- field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 2; // 0x2
- field public static final int HANDOVER_FAILURE_MODE_LEGACY = 1; // 0x1
- field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 3; // 0x3
- field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 4; // 0x4
- field public static final int HANDOVER_FAILURE_MODE_UNKNOWN = 0; // 0x0
+ field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
+ field public static final int HANDOVER_FAILURE_MODE_LEGACY = 0; // 0x0
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; // 0x2
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; // 0x3
+ field public static final int HANDOVER_FAILURE_MODE_UNKNOWN = -1; // 0xffffffff
field public static final int LINK_STATUS_ACTIVE = 2; // 0x2
field public static final int LINK_STATUS_DORMANT = 1; // 0x1
field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
diff --git a/telephony/java/android/telephony/CallForwardingInfo.java b/telephony/java/android/telephony/CallForwardingInfo.java
index 7e777fa..6ae6d00 100644
--- a/telephony/java/android/telephony/CallForwardingInfo.java
+++ b/telephony/java/android/telephony/CallForwardingInfo.java
@@ -20,6 +20,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
+import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
@@ -33,50 +34,14 @@
* Defines the call forwarding information.
* @hide
*/
+@SystemApi
public final class CallForwardingInfo implements Parcelable {
private static final String TAG = "CallForwardingInfo";
/**
- * Indicates the call forwarding status is inactive.
- *
- * @hide
- */
- public static final int STATUS_INACTIVE = 0;
-
- /**
- * Indicates the call forwarding status is active.
- *
- * @hide
- */
- public static final int STATUS_ACTIVE = 1;
-
- /**
- * Indicates the call forwarding could not be enabled because the recipient is not on
- * Fixed Dialing Number (FDN) list.
- *
- * @hide
- */
- public static final int STATUS_FDN_CHECK_FAILURE = 2;
-
- /**
- * Indicates the call forwarding status is with an unknown error.
- *
- * @hide
- */
- public static final int STATUS_UNKNOWN_ERROR = 3;
-
- /**
- * Indicates the call forwarding is not supported (e.g. called via CDMA).
- *
- * @hide
- */
- public static final int STATUS_NOT_SUPPORTED = 4;
-
- /**
- * Indicates the call forwarding reason is "unconditional".
+ * Indicates that call forwarding reason is "unconditional".
* Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
* and conditions +CCFC
- * @hide
*/
public static final int REASON_UNCONDITIONAL = 0;
@@ -84,7 +49,6 @@
* Indicates the call forwarding status is "busy".
* Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
* and conditions +CCFC
- * @hide
*/
public static final int REASON_BUSY = 1;
@@ -92,7 +56,6 @@
* Indicates the call forwarding reason is "no reply".
* Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
* and conditions +CCFC
- * @hide
*/
public static final int REASON_NO_REPLY = 2;
@@ -100,7 +63,6 @@
* Indicates the call forwarding reason is "not reachable".
* Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
* and conditions +CCFC
- * @hide
*/
public static final int REASON_NOT_REACHABLE = 3;
@@ -109,7 +71,6 @@
* simultaneously (unconditional, busy, no reply, and not reachable).
* Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
* and conditions +CCFC
- * @hide
*/
public static final int REASON_ALL = 4;
@@ -118,26 +79,12 @@
* forwarding reasons simultaneously (busy, no reply, and not reachable).
* Reference: 3GPP TS 27.007 version 10.3.0 Release 10 - 7.11 Call forwarding number
* and conditions +CCFC
- * @hide
*/
public static final int REASON_ALL_CONDITIONAL = 5;
/**
- * Call forwarding function status
- */
- @IntDef(prefix = { "STATUS_" }, value = {
- STATUS_ACTIVE,
- STATUS_INACTIVE,
- STATUS_UNKNOWN_ERROR,
- STATUS_NOT_SUPPORTED,
- STATUS_FDN_CHECK_FAILURE
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface CallForwardingStatus {
- }
-
- /**
* Call forwarding reason types
+ * @hide
*/
@IntDef(flag = true, prefix = { "REASON_" }, value = {
REASON_UNCONDITIONAL,
@@ -152,9 +99,9 @@
}
/**
- * The call forwarding status.
+ * Whether call forwarding is enabled for this reason.
*/
- private int mStatus;
+ private boolean mEnabled;
/**
* The call forwarding reason indicates the condition under which calls will be forwarded.
@@ -178,39 +125,35 @@
/**
* Construct a CallForwardingInfo.
*
- * @param status the call forwarding status
+ * @param enabled Whether to enable call forwarding for the reason specified
+ * in {@link #getReason()}.
* @param reason the call forwarding reason
* @param number the phone number to which calls will be forwarded
* @param timeSeconds the timeout (in seconds) before the forwarding is attempted
- * @hide
*/
- public CallForwardingInfo(@CallForwardingStatus int status, @CallForwardingReason int reason,
+ public CallForwardingInfo(boolean enabled, @CallForwardingReason int reason,
@Nullable String number, int timeSeconds) {
- mStatus = status;
+ mEnabled = enabled;
mReason = reason;
mNumber = number;
mTimeSeconds = timeSeconds;
}
/**
- * Returns the call forwarding status.
+ * Whether call forwarding is enabled for the reason from {@link #getReason()}.
*
- * @return the call forwarding status.
- *
- * @hide
+ * @return {@code true} if enabled, {@code false} otherwise.
*/
- public @CallForwardingStatus int getStatus() {
- return mStatus;
+ public boolean isEnabled() {
+ return mEnabled;
}
/**
* Returns the call forwarding reason. The call forwarding reason indicates the condition
- * under which calls will be forwarded. For example, {@link #REASON_NO_REPLY} indicates
- * that calls will be forward to {@link #getNumber()} when the user fails to answer the call.
+ * under which calls will be forwarded. For example, {@link #REASON_NO_REPLY} indicates
+ * that calls will be forwarded when the user fails to answer the call.
*
* @return the call forwarding reason.
- *
- * @hide
*/
public @CallForwardingReason int getReason() {
return mReason;
@@ -220,9 +163,7 @@
* Returns the phone number to which calls will be forwarded.
*
* @return the number calls will be forwarded to, or {@code null} if call forwarding
- * is being disabled.
- *
- * @hide
+ * is disabled.
*/
@Nullable
public String getNumber() {
@@ -230,16 +171,14 @@
}
/**
- * Gets the timeout (in seconds) before the forwarding is attempted. For example,
+ * Gets the timeout (in seconds) before forwarding is attempted. For example,
* if {@link #REASON_NO_REPLY} is the call forwarding reason, the device will wait this
- * duration of time before forwarding the call to {@link #getNumber()}.
+ * duration of time before forwarding the call to the number returned by {@link #getNumber()}.
*
* Reference: 3GPP TS 27.007 version 10.3.0 Release 10
* 7.11 Call forwarding number and conditions +CCFC
*
* @return the timeout (in seconds) before the forwarding is attempted.
- *
- * @hide
*/
@SuppressLint("MethodNameUnits")
public int getTimeoutSeconds() {
@@ -257,14 +196,14 @@
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeString(mNumber);
- out.writeInt(mStatus);
+ out.writeBoolean(mEnabled);
out.writeInt(mReason);
out.writeInt(mTimeSeconds);
}
private CallForwardingInfo(Parcel in) {
mNumber = in.readString();
- mStatus = in.readInt();
+ mEnabled = in.readBoolean();
mReason = in.readInt();
mTimeSeconds = in.readInt();
}
@@ -281,7 +220,7 @@
}
CallForwardingInfo other = (CallForwardingInfo) o;
- return mStatus == other.mStatus
+ return mEnabled == other.mEnabled
&& mNumber == other.mNumber
&& mReason == other.mReason
&& mTimeSeconds == other.mTimeSeconds;
@@ -292,7 +231,7 @@
*/
@Override
public int hashCode() {
- return Objects.hash(mStatus, mNumber, mReason, mTimeSeconds);
+ return Objects.hash(mEnabled, mNumber, mReason, mTimeSeconds);
}
public static final @NonNull Parcelable.Creator<CallForwardingInfo> CREATOR =
@@ -313,7 +252,7 @@
*/
@Override
public String toString() {
- return "[CallForwardingInfo: status=" + mStatus
+ return "[CallForwardingInfo: enabled=" + mEnabled
+ ", reason= " + mReason
+ ", timeSec= " + mTimeSeconds + " seconds"
+ ", number=" + Rlog.pii(TAG, mNumber) + "]";
diff --git a/telephony/java/android/telephony/CellSignalStrength.java b/telephony/java/android/telephony/CellSignalStrength.java
index 2e7bde3..e089657 100644
--- a/telephony/java/android/telephony/CellSignalStrength.java
+++ b/telephony/java/android/telephony/CellSignalStrength.java
@@ -17,6 +17,7 @@
package android.telephony;
import android.annotation.IntRange;
+import android.annotation.SystemApi;
import android.os.PersistableBundle;
/**
@@ -155,11 +156,12 @@
/**
* Returns the number of signal strength levels.
- * @return Number of signal strength levels, enforced to be 5
+ * @return Number of signal strength levels, currently defined in the HAL as 5.
*
* @hide
*/
- public static final int getNumSignalStrengthLevels() {
+ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ public static int getNumSignalStrengthLevels() {
return NUM_SIGNAL_STRENGTH_BINS;
}
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index ca47b83..04a06f5 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -96,6 +96,8 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.CellNetworkScanResult;
import com.android.internal.telephony.IBooleanConsumer;
+import com.android.internal.telephony.ICallForwardingInfoCallback;
+import com.android.internal.telephony.IIntegerConsumer;
import com.android.internal.telephony.INumberVerificationCallback;
import com.android.internal.telephony.IOns;
import com.android.internal.telephony.IPhoneSubInfo;
@@ -2827,11 +2829,13 @@
};
/**
- * Return a collection of all network types
- * @return network types
+ * Returns an array of all valid network types.
+ *
+ * @return An integer array containing all valid network types in no particular order.
*
* @hide
*/
+ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public static @NonNull @NetworkType int[] getAllNetworkTypes() {
return NETWORK_TYPES;
}
@@ -12746,195 +12750,339 @@
}
/**
- * Gets the voice call forwarding info {@link CallForwardingInfo}, given the call forward
- * reason.
+ * Callback to be used with {@link #getCallForwarding}
+ * @hide
+ */
+ @SystemApi
+ public interface CallForwardingInfoCallback {
+ /**
+ * Indicates that the operation was successful.
+ */
+ int RESULT_SUCCESS = 0;
+
+ /**
+ * Indicates that setting or retrieving the call forwarding info failed with an unknown
+ * error.
+ */
+ int RESULT_ERROR_UNKNOWN = 1;
+
+ /**
+ * Indicates that call forwarding is not enabled because the recipient is not on a
+ * Fixed Dialing Number (FDN) list.
+ */
+ int RESULT_ERROR_FDN_CHECK_FAILURE = 2;
+
+ /**
+ * Indicates that call forwarding is not supported on the network at this time.
+ */
+ int RESULT_ERROR_NOT_SUPPORTED = 3;
+
+ /**
+ * Call forwarding errors
+ * @hide
+ */
+ @IntDef(prefix = { "RESULT_ERROR_" }, value = {
+ RESULT_ERROR_UNKNOWN,
+ RESULT_ERROR_NOT_SUPPORTED,
+ RESULT_ERROR_FDN_CHECK_FAILURE
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface CallForwardingError{
+ }
+ /**
+ * Called when the call forwarding info is successfully retrieved from the network.
+ * @param info information about how calls are forwarded
+ */
+ void onCallForwardingInfoAvailable(@NonNull CallForwardingInfo info);
+
+ /**
+ * Called when there was an error retrieving the call forwarding information.
+ * @param error
+ */
+ void onError(@CallForwardingError int error);
+ }
+
+ /**
+ * Gets the voice call forwarding info for a given call forwarding reason.
*
- * @param callForwardingReason the call forwarding reasons
+ * This method queries the network for the currently set call forwarding configuration for the
+ * provided call forwarding reason. When the network has provided its response, the result will
+ * be supplied via the provided {@link Executor} on the provided
+ * {@link CallForwardingInfoCallback}.
+ *
+ * @param callForwardingReason the call forwarding reason to query.
+ * @param executor The executor on which to execute the callback once the result is ready.
+ * @param callback The callback the results should be delivered on.
*
* @throws IllegalArgumentException if callForwardingReason is not any of
- * {@link CallForwardingInfo.REASON_UNCONDITIONAL}, {@link CallForwardingInfo.REASON_BUSY},
- * {@link CallForwardingInfo.REASON_NO_REPLY}, {@link CallForwardingInfo.REASON_NOT_REACHABLE},
- * {@link CallForwardingInfo.REASON_ALL}, {@link CallForwardingInfo.REASON_ALL_CONDITIONAL}
- *
- * @return {@link CallForwardingInfo} with the status {@link CallForwardingInfo#STATUS_ACTIVE}
- * or {@link CallForwardingInfo#STATUS_INACTIVE} and the target phone number to forward calls
- * to, if it's available. Otherwise, it will return a {@link CallForwardingInfo} with status
- * {@link CallForwardingInfo#STATUS_UNKNOWN_ERROR},
- * {@link CallForwardingInfo#STATUS_NOT_SUPPORTED},
- * or {@link CallForwardingInfo#STATUS_FDN_CHECK_FAILURE} depending on the situation.
+ * {@link CallForwardingInfo#REASON_UNCONDITIONAL}, {@link CallForwardingInfo#REASON_BUSY},
+ * {@link CallForwardingInfo#REASON_NO_REPLY}, {@link CallForwardingInfo#REASON_NOT_REACHABLE},
+ * {@link CallForwardingInfo#REASON_ALL}, or {@link CallForwardingInfo#REASON_ALL_CONDITIONAL}
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
- @NonNull
- public CallForwardingInfo getCallForwarding(@CallForwardingReason int callForwardingReason) {
+ @SystemApi
+ public void getCallForwarding(@CallForwardingReason int callForwardingReason,
+ @NonNull Executor executor, @NonNull CallForwardingInfoCallback callback) {
if (callForwardingReason < CallForwardingInfo.REASON_UNCONDITIONAL
|| callForwardingReason > CallForwardingInfo.REASON_ALL_CONDITIONAL) {
throw new IllegalArgumentException("callForwardingReason is out of range");
}
+
+ ICallForwardingInfoCallback internalCallback = new ICallForwardingInfoCallback.Stub() {
+ @Override
+ public void onCallForwardingInfoAvailable(CallForwardingInfo info) {
+ executor.execute(() ->
+ Binder.withCleanCallingIdentity(() ->
+ callback.onCallForwardingInfoAvailable(info)));
+ }
+
+ @Override
+ public void onError(int error) {
+ executor.execute(() ->
+ Binder.withCleanCallingIdentity(() ->
+ callback.onError(error)));
+ }
+ };
+
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
- return telephony.getCallForwarding(getSubId(), callForwardingReason);
+ telephony.getCallForwarding(getSubId(), callForwardingReason, internalCallback);
}
} catch (RemoteException ex) {
Rlog.e(TAG, "getCallForwarding RemoteException", ex);
- } catch (NullPointerException ex) {
- Rlog.e(TAG, "getCallForwarding NPE", ex);
+ ex.rethrowAsRuntimeException();
}
- return new CallForwardingInfo(
- CallForwardingInfo.STATUS_UNKNOWN_ERROR, 0 /* reason */, null /* number */,
- 0 /* timeout */);
}
/**
- * Sets the voice call forwarding info including status (enable/disable), call forwarding
- * reason, the number to forward, and the timeout before the forwarding is attempted.
+ * Sets voice call forwarding behavior as described by the provided {@link CallForwardingInfo}.
*
- * @param callForwardingInfo {@link CallForwardingInfo} to setup the call forwarding.
- * Enabling if {@link CallForwardingInfo#getStatus()} returns
- * {@link CallForwardingInfo#STATUS_ACTIVE}; Disabling if
- * {@link CallForwardingInfo#getStatus()} returns {@link CallForwardingInfo#STATUS_INACTIVE}.
+ * This method will enable call forwarding if the provided {@link CallForwardingInfo} returns
+ * {@code true} from its {@link CallForwardingInfo#isEnabled()} method, and disables call
+ * forwarding otherwise.
*
- * @throws IllegalArgumentException if any of the following for parameter callForwardingInfo:
- * 0) it is {@code null}.
- * 1) {@link CallForwardingInfo#getStatus()} returns neither
- * {@link CallForwardingInfo#STATUS_ACTIVE} nor {@link CallForwardingInfo#STATUS_INACTIVE}.
- * 2) {@link CallForwardingInfo#getReason()} is not any of
- * {@link CallForwardingInfo.REASON_UNCONDITIONAL}, {@link CallForwardingInfo.REASON_BUSY},
- * {@link CallForwardingInfo.REASON_NO_REPLY}, {@link CallForwardingInfo.REASON_NOT_REACHABLE},
- * {@link CallForwardingInfo.REASON_ALL}, {@link CallForwardingInfo.REASON_ALL_CONDITIONAL}
- * 3) {@link CallForwardingInfo#getNumber()} returns {@code null}.
- * 4) {@link CallForwardingInfo#getTimeoutSeconds()} doesn't return a positive value.
+ * If you wish to be notified about the results of this operation, provide an {@link Executor}
+ * and {@link Consumer<Integer>} to be notified asynchronously when the operation completes.
*
- * @return {@code true} to indicate it was set successfully; {@code false} otherwise.
+ * @param callForwardingInfo Info about whether calls should be forwarded and where they
+ * should be forwarded to.
+ * @param executor The executor on which the listener will be called. Must be non-null if
+ * {@code listener} is non-null.
+ * @param resultListener Asynchronous listener that'll be called when the operation completes.
+ * Called with {@link CallForwardingInfoCallback#RESULT_SUCCESS} if the
+ * operation succeeded and an error code from
+ * {@link CallForwardingInfoCallback} it failed.
*
+ * @throws IllegalArgumentException if any of the following are true for the parameter
+ * callForwardingInfo:
+ * <ul>
+ * <li>it is {@code null}.</li>
+ * <li>{@link CallForwardingInfo#getReason()} is not any of:
+ * <ul>
+ * <li>{@link CallForwardingInfo#REASON_UNCONDITIONAL}</li>
+ * <li>{@link CallForwardingInfo#REASON_BUSY}</li>
+ * <li>{@link CallForwardingInfo#REASON_NO_REPLY}</li>
+ * <li>{@link CallForwardingInfo#REASON_NOT_REACHABLE}</li>
+ * <li>{@link CallForwardingInfo#REASON_ALL}</li>
+ * <li>{@link CallForwardingInfo#REASON_ALL_CONDITIONAL}</li>
+ * </ul>
+ * <li>{@link CallForwardingInfo#getNumber()} returns {@code null} when enabling call
+ * forwarding</li>
+ * <li>{@link CallForwardingInfo#getTimeoutSeconds()} returns a non-positive value when
+ * enabling call forwarding</li>
+ * </ul>
* @hide
*/
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
- public boolean setCallForwarding(@NonNull CallForwardingInfo callForwardingInfo) {
+ @SystemApi
+ public void setCallForwarding(@NonNull CallForwardingInfo callForwardingInfo,
+ @Nullable @CallbackExecutor Executor executor,
+ @Nullable @CallForwardingInfoCallback.CallForwardingError
+ Consumer<Integer> resultListener) {
if (callForwardingInfo == null) {
throw new IllegalArgumentException("callForwardingInfo is null");
}
- int callForwardingStatus = callForwardingInfo.getStatus();
- if (callForwardingStatus != CallForwardingInfo.STATUS_ACTIVE
- && callForwardingStatus != CallForwardingInfo.STATUS_INACTIVE) {
- throw new IllegalArgumentException(
- "callForwardingStatus is neither active nor inactive");
- }
int callForwardingReason = callForwardingInfo.getReason();
if (callForwardingReason < CallForwardingInfo.REASON_UNCONDITIONAL
|| callForwardingReason > CallForwardingInfo.REASON_ALL_CONDITIONAL) {
throw new IllegalArgumentException("callForwardingReason is out of range");
}
- if (callForwardingInfo.getNumber() == null) {
- throw new IllegalArgumentException("callForwarding number is null");
+ if (callForwardingInfo.isEnabled()) {
+ if (callForwardingInfo.getNumber() == null) {
+ throw new IllegalArgumentException("callForwarding number is null");
+ }
+ if (callForwardingInfo.getTimeoutSeconds() <= 0) {
+ throw new IllegalArgumentException("callForwarding timeout isn't positive");
+ }
}
- if (callForwardingInfo.getTimeoutSeconds() <= 0) {
- throw new IllegalArgumentException("callForwarding timeout isn't positive");
+ if (resultListener != null) {
+ Objects.requireNonNull(executor);
}
+
+ IIntegerConsumer internalCallback = new IIntegerConsumer.Stub() {
+ @Override
+ public void accept(int result) {
+ executor.execute(() ->
+ Binder.withCleanCallingIdentity(() -> resultListener.accept(result)));
+ }
+ };
+
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
- return telephony.setCallForwarding(getSubId(), callForwardingInfo);
+ telephony.setCallForwarding(getSubId(), callForwardingInfo, internalCallback);
}
} catch (RemoteException ex) {
Rlog.e(TAG, "setCallForwarding RemoteException", ex);
+ ex.rethrowAsRuntimeException();
} catch (NullPointerException ex) {
Rlog.e(TAG, "setCallForwarding NPE", ex);
+ throw ex;
}
- return false;
}
/**
- * Indicates the call waiting status is active.
+ * Indicates that call waiting is enabled.
*
* @hide
*/
- public static final int CALL_WAITING_STATUS_ACTIVE = 1;
+ @SystemApi
+ public static final int CALL_WAITING_STATUS_ENABLED = 1;
/**
- * Indicates the call waiting status is inactive.
+ * Indicates that call waiting is disabled.
*
* @hide
*/
- public static final int CALL_WAITING_STATUS_INACTIVE = 2;
+ @SystemApi
+ public static final int CALL_WAITING_STATUS_DISABLED = 2;
/**
- * Indicates the call waiting status is with an unknown error.
+ * Indicates there was an unknown error retrieving the call waiting status.
*
* @hide
*/
+ @SystemApi
public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3;
/**
- * Indicates the call waiting is not supported (e.g. called via CDMA).
+ * Indicates the call waiting is not supported on the current network.
*
* @hide
*/
+ @SystemApi
public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4;
/**
- * Call waiting function status
- *
* @hide
*/
@IntDef(prefix = { "CALL_WAITING_STATUS_" }, value = {
- CALL_WAITING_STATUS_ACTIVE,
- CALL_WAITING_STATUS_INACTIVE,
- CALL_WAITING_STATUS_NOT_SUPPORTED,
- CALL_WAITING_STATUS_UNKNOWN_ERROR
+ CALL_WAITING_STATUS_ENABLED,
+ CALL_WAITING_STATUS_DISABLED,
+ CALL_WAITING_STATUS_UNKNOWN_ERROR,
+ CALL_WAITING_STATUS_NOT_SUPPORTED,
})
@Retention(RetentionPolicy.SOURCE)
public @interface CallWaitingStatus {
}
/**
- * Gets the status of voice call waiting function. Call waiting function enables the waiting
- * for the incoming call when it reaches the user who is busy to make another call and allows
- * users to decide whether to switch to the incoming call.
+ * Retrieves the call waiting status of this device from the network.
*
- * @return the status of call waiting function.
+ * When call waiting is enabled, an incoming call that arrives when the user is already on
+ * an active call will be held in a waiting state while the user is notified instead of being
+ * rejected with a busy signal.
+ *
+ * @param executor The executor on which the result listener will be called.
+ * @param resultListener A {@link Consumer} that will be called with the result fetched
+ * from the network. The result will be one of:
+ * <ul>
+ * <li>{@link #CALL_WAITING_STATUS_ENABLED}}</li>
+ * <li>{@link #CALL_WAITING_STATUS_DISABLED}}</li>
+ * <li>{@link #CALL_WAITING_STATUS_UNKNOWN_ERROR}}</li>
+ * <li>{@link #CALL_WAITING_STATUS_NOT_SUPPORTED}}</li>
+ * </ul>
* @hide
*/
+ @SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
- public @CallWaitingStatus int getCallWaitingStatus() {
+ public void getCallWaitingStatus(@NonNull Executor executor,
+ @NonNull @CallWaitingStatus Consumer<Integer> resultListener) {
+ Objects.requireNonNull(executor);
+ Objects.requireNonNull(resultListener);
+
+ IIntegerConsumer internalCallback = new IIntegerConsumer.Stub() {
+ @Override
+ public void accept(int result) {
+ executor.execute(() -> Binder.withCleanCallingIdentity(
+ () -> resultListener.accept(result)));
+ }
+ };
+
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
- return telephony.getCallWaitingStatus(getSubId());
+ telephony.getCallWaitingStatus(getSubId(), internalCallback);
}
} catch (RemoteException ex) {
Rlog.e(TAG, "getCallWaitingStatus RemoteException", ex);
+ ex.rethrowAsRuntimeException();
} catch (NullPointerException ex) {
Rlog.e(TAG, "getCallWaitingStatus NPE", ex);
+ throw ex;
}
- return CALL_WAITING_STATUS_UNKNOWN_ERROR;
}
/**
- * Sets the status for voice call waiting function. Call waiting function enables the waiting
- * for the incoming call when it reaches the user who is busy to make another call and allows
- * users to decide whether to switch to the incoming call.
+ * Sets the call waiting status of this device with the network.
*
- * @param isEnable {@code true} to enable; {@code false} to disable.
- * @return {@code true} to indicate it was set successfully; {@code false} otherwise.
+ * If you wish to be notified about the results of this operation, provide an {@link Executor}
+ * and {@link Consumer<Integer>} to be notified asynchronously when the operation completes.
*
+ * @see #getCallWaitingStatus for a description of the call waiting functionality.
+ *
+ * @param enabled {@code true} to enable; {@code false} to disable.
+ * @param executor The executor on which the listener will be called. Must be non-null if
+ * {@code listener} is non-null.
+ * @param resultListener Asynchronous listener that'll be called when the operation completes.
+ * Called with the new call waiting status (either
+ * {@link #CALL_WAITING_STATUS_ENABLED} or
+ * {@link #CALL_WAITING_STATUS_DISABLED} if the operation succeeded and
+ * {@link #CALL_WAITING_STATUS_NOT_SUPPORTED} or
+ * {@link #CALL_WAITING_STATUS_UNKNOWN_ERROR} if it failed.
* @hide
*/
+ @SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
- public boolean setCallWaitingStatus(boolean isEnable) {
+ public void setCallWaitingEnabled(boolean enabled, @Nullable Executor executor,
+ @Nullable Consumer<Integer> resultListener) {
+ if (resultListener != null) {
+ Objects.requireNonNull(executor);
+ }
+
+ IIntegerConsumer internalCallback = new IIntegerConsumer.Stub() {
+ @Override
+ public void accept(int result) {
+ executor.execute(() ->
+ Binder.withCleanCallingIdentity(() -> resultListener.accept(result)));
+ }
+ };
+
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
- return telephony.setCallWaitingStatus(getSubId(), isEnable);
+ telephony.setCallWaitingStatus(getSubId(), enabled, internalCallback);
}
} catch (RemoteException ex) {
Rlog.e(TAG, "setCallWaitingStatus RemoteException", ex);
+ ex.rethrowAsRuntimeException();
} catch (NullPointerException ex) {
Rlog.e(TAG, "setCallWaitingStatus NPE", ex);
+ throw ex;
}
- return false;
}
/**
diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index 5ead8de..39859b1 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -80,33 +80,33 @@
/**
* Data handover failure mode is unknown.
*/
- public static final int HANDOVER_FAILURE_MODE_UNKNOWN = 0;
+ public static final int HANDOVER_FAILURE_MODE_UNKNOWN = -1;
/**
* Perform fallback to the source data transport on data handover failure using
* the legacy logic, which is fallback if the fail cause is
* {@link DataFailCause#HANDOFF_PREFERENCE_CHANGED}.
*/
- public static final int HANDOVER_FAILURE_MODE_LEGACY = 1;
+ public static final int HANDOVER_FAILURE_MODE_LEGACY = 0;
/**
* Perform fallback to the source data transport on data handover failure.
*/
- public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 2;
+ public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1;
/**
* Do not perform fallback to the source data transport on data handover failure.
- * Frameworks should keep retrying handover by sending
+ * Framework will retry setting up a new data connection by sending
* {@link DataService#REQUEST_REASON_HANDOVER} request to the underlying {@link DataService}.
*/
- public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 3;
+ public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2;
/**
* Do not perform fallback to the source transport on data handover failure.
- * Frameworks should retry setup a new data connection by sending
+ * Framework will retry setting up a new data connection by sending
* {@link DataService#REQUEST_REASON_NORMAL} request to the underlying {@link DataService}.
*/
- public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 4;
+ public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3;
private final @DataFailureCause int mCause;
private final int mSuggestedRetryTime;
@@ -332,6 +332,7 @@
.append(" mtu=").append(getMtu())
.append(" mtuV4=").append(getMtuV4())
.append(" mtuV6=").append(getMtuV6())
+ .append(" handoverFailureMode=").append(getHandoverFailureMode())
.append("}");
return sb.toString();
}
@@ -361,14 +362,15 @@
&& mPcscfAddresses.containsAll(other.mPcscfAddresses)
&& mMtu == other.mMtu
&& mMtuV4 == other.mMtuV4
- && mMtuV6 == other.mMtuV6;
+ && mMtuV6 == other.mMtuV6
+ && mHandoverFailureMode == other.mHandoverFailureMode;
}
@Override
public int hashCode() {
return Objects.hash(mCause, mSuggestedRetryTime, mId, mLinkStatus, mProtocolType,
mInterfaceName, mAddresses, mDnsAddresses, mGatewayAddresses, mPcscfAddresses,
- mMtu, mMtuV4, mMtuV6);
+ mMtu, mMtuV4, mMtuV6, mHandoverFailureMode);
}
@Override
diff --git a/telephony/java/com/android/internal/telephony/ICallForwardingInfoCallback.aidl b/telephony/java/com/android/internal/telephony/ICallForwardingInfoCallback.aidl
new file mode 100644
index 0000000..4d3b9f4
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/ICallForwardingInfoCallback.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.telephony;
+
+import android.telephony.CallForwardingInfo;
+
+// Callback interface for the getCallForwarding API in TelephonyManager.
+oneway interface ICallForwardingInfoCallback {
+ void onCallForwardingInfoAvailable(in CallForwardingInfo info);
+ void onError(int error);
+}
\ No newline at end of file
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 5c31c46f..61c22bb 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -58,6 +58,7 @@
import com.android.ims.internal.IImsServiceFeatureCallback;
import com.android.internal.telephony.CellNetworkScanResult;
import com.android.internal.telephony.IBooleanConsumer;
+import com.android.internal.telephony.ICallForwardingInfoCallback;
import com.android.internal.telephony.IIntegerConsumer;
import com.android.internal.telephony.INumberVerificationCallback;
import com.android.internal.telephony.OperatorInfo;
@@ -1639,78 +1640,15 @@
*/
void carrierActionResetAll(int subId);
- /**
- * Gets the voice call forwarding info {@link CallForwardingInfo}, given the call forward
- * reason.
- *
- * @param callForwardingReason the call forwarding reasons which are the bitwise-OR combination
- * of the following constants:
- * <ol>
- * <li>{@link CallForwardingInfo#REASON_BUSY} </li>
- * <li>{@link CallForwardingInfo#REASON_NO_REPLY} </li>
- * <li>{@link CallForwardingInfo#REASON_NOT_REACHABLE} </li>
- * </ol>
- *
- * @throws IllegalArgumentException if callForwardingReason is not a bitwise-OR combination
- * of {@link CallForwardingInfo.REASON_BUSY}, {@link CallForwardingInfo.REASON_BUSY},
- * {@link CallForwardingInfo.REASON_NOT_REACHABLE}
- *
- * @return {@link CallForwardingInfo} with the status {@link CallForwardingInfo#STATUS_ACTIVE}
- * or {@link CallForwardingInfo#STATUS_INACTIVE} and the target phone number to forward calls
- * to, if it's available. Otherwise, it will return a {@link CallForwardingInfo} with status
- * {@link CallForwardingInfo#STATUS_NOT_SUPPORTED} or
- * {@link CallForwardingInfo#STATUS_FDN_CHECK_FAILURE} depending on the situation.
- *
- * @hide
- */
- CallForwardingInfo getCallForwarding(int subId, int callForwardingReason);
+ void getCallForwarding(int subId, int callForwardingReason,
+ ICallForwardingInfoCallback callback);
- /**
- * Sets the voice call forwarding info including status (enable/disable), call forwarding
- * reason, the number to forward, and the timeout before the forwarding is attempted.
- *
- * @param callForwardingInfo {@link CallForwardingInfo} to setup the call forwarding.
- * Enabling if {@link CallForwardingInfo#getStatus()} returns
- * {@link CallForwardingInfo#STATUS_ACTIVE}; Disabling if
- * {@link CallForwardingInfo#getStatus()} returns {@link CallForwardingInfo#STATUS_INACTIVE}.
- *
- * @throws IllegalArgumentException if any of the following:
- * 0) callForwardingInfo is null.
- * 1) {@link CallForwardingInfo#getStatus()} for callForwardingInfo returns neither
- * {@link CallForwardingInfo#STATUS_ACTIVE} nor {@link CallForwardingInfo#STATUS_INACTIVE}.
- * 2) {@link CallForwardingInfo#getReason()} for callForwardingInfo doesn't return the
- * bitwise-OR combination of {@link CallForwardingInfo.REASON_BUSY},
- * {@link CallForwardingInfo.REASON_BUSY}, {@link CallForwardingInfo.REASON_NOT_REACHABLE}
- * 3) {@link CallForwardingInfo#getNumber()} for callForwardingInfo returns null.
- * 4) {@link CallForwardingInfo#getTimeout()} for callForwardingInfo returns nagetive value.
- *
- * @return {@code true} to indicate it was set successfully; {@code false} otherwise.
- *
- * @hide
- */
- boolean setCallForwarding(int subId, in CallForwardingInfo callForwardingInfo);
+ void setCallForwarding(int subId, in CallForwardingInfo callForwardingInfo,
+ IIntegerConsumer callback);
- /**
- * Gets the status of voice call waiting function. Call waiting function enables the waiting
- * for the incoming call when it reaches the user who is busy to make another call and allows
- * users to decide whether to switch to the incoming call.
- *
- * @return the status of call waiting function.
- * @hide
- */
- int getCallWaitingStatus(int subId);
+ void getCallWaitingStatus(int subId, IIntegerConsumer callback);
- /**
- * Sets the status for voice call waiting function. Call waiting function enables the waiting
- * for the incoming call when it reaches the user who is busy to make another call and allows
- * users to decide whether to switch to the incoming call.
- *
- * @param isEnable {@code true} to enable; {@code false} to disable.
- * @return {@code true} to indicate it was set successfully; {@code false} otherwise.
- *
- * @hide
- */
- boolean setCallWaitingStatus(int subId, boolean isEnable);
+ void setCallWaitingStatus(int subId, boolean enabled, IIntegerConsumer callback);
/**
* Policy control of data connection. Usually used when data limit is passed.
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index 118d7c1..9e770c5 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -147,6 +147,7 @@
import android.net.ConnectivityManager.TooManyRequestsException;
import android.net.ConnectivityThread;
import android.net.DataStallReportParcelable;
+import android.net.EthernetManager;
import android.net.IConnectivityDiagnosticsCallback;
import android.net.IDnsResolver;
import android.net.IIpConnectivityMetrics;
@@ -358,6 +359,7 @@
@Mock AppOpsManager mAppOpsManager;
@Mock TelephonyManager mTelephonyManager;
@Mock MockableSystemProperties mSystemProperties;
+ @Mock EthernetManager mEthernetManager;
private ArgumentCaptor<ResolverParamsParcel> mResolverParamsParcelCaptor =
ArgumentCaptor.forClass(ResolverParamsParcel.class);
@@ -445,6 +447,7 @@
if (Context.LOCATION_SERVICE.equals(name)) return mLocationManager;
if (Context.APP_OPS_SERVICE.equals(name)) return mAppOpsManager;
if (Context.TELEPHONY_SERVICE.equals(name)) return mTelephonyManager;
+ if (Context.ETHERNET_SERVICE.equals(name)) return mEthernetManager;
return super.getSystemService(name);
}
@@ -1274,7 +1277,6 @@
doReturn(true).when(deps).queryUserAccess(anyInt(), anyInt());
doReturn(mIpConnectivityMetrics).when(deps).getIpConnectivityMetrics();
doReturn(mBatteryStatsService).when(deps).getBatteryStatsService();
- doReturn(true).when(deps).hasService(Context.ETHERNET_SERVICE);
doAnswer(inv -> {
mPolicyTracker = new WrappedMultinetworkPolicyTracker(
inv.getArgument(0), inv.getArgument(1), inv.getArgument(2));