summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp3
-rw-r--r--apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java3
-rw-r--r--config/preloaded-classes2
-rw-r--r--core/api/system-current.txt22
-rw-r--r--core/java/android/net/LinkProperties.java6
-rw-r--r--core/java/android/os/BasicShellCommandHandler.java330
-rw-r--r--core/java/android/os/ShellCommand.java8
-rw-r--r--core/java/android/os/strictmode/UntaggedSocketViolation.java2
-rw-r--r--core/java/android/security/keymaster/KeymasterDefs.java2
-rw-r--r--core/java/com/android/internal/os/BaseCommand.java3
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java55
-rw-r--r--services/core/java/com/android/server/Watchdog.java1
-rw-r--r--services/core/java/com/android/server/adb/AdbShellCommand.java2
-rw-r--r--services/core/java/com/android/server/location/LocationShellCommand.java3
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java111
-rw-r--r--telephony/java/android/telephony/data/DataCallResponse.java88
-rw-r--r--telephony/java/android/telephony/data/DataService.java151
-rw-r--r--telephony/java/android/telephony/data/DataServiceCallback.java66
-rw-r--r--telephony/java/android/telephony/data/IDataService.aidl4
-rw-r--r--telephony/java/android/telephony/data/IDataServiceCallback.aidl2
-rw-r--r--telephony/java/android/telephony/ims/DelegateRequest.java5
-rw-r--r--telephony/java/android/telephony/ims/SipDelegateManager.java21
-rw-r--r--telephony/java/android/telephony/ims/aidl/IImsRcsController.aidl2
-rw-r--r--telephony/java/android/telephony/ims/aidl/ISipTransport.aidl2
-rw-r--r--telephony/java/android/telephony/ims/stub/SipTransportImplBase.java17
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl8
-rw-r--r--telephony/java/com/android/internal/telephony/RILConstants.java2
-rw-r--r--tests/net/java/com/android/server/ConnectivityServiceTest.java38
-rw-r--r--wifi/jarjar-rules.txt2
29 files changed, 534 insertions, 427 deletions
diff --git a/Android.bp b/Android.bp
index 570040f3ab93..dcb6ac77fe98 100644
--- a/Android.bp
+++ b/Android.bp
@@ -573,6 +573,7 @@ java_library {
// If MimeMap ever becomes its own APEX, then this dependency would need to be removed
// in favor of an API stubs dependency in java_library "framework" below.
"mimemap",
+ "modules-utils-os",
],
// For backwards compatibility.
stem: "framework",
@@ -1157,7 +1158,6 @@ aidl_mapping {
filegroup {
name: "framework-telephony-common-shared-srcs",
srcs: [
- "core/java/android/os/BasicShellCommandHandler.java",
"core/java/android/os/RegistrantList.java",
"core/java/android/os/Registrant.java",
"core/java/android/util/LocalLog.java",
@@ -1238,7 +1238,6 @@ filegroup {
name: "framework-wifi-service-shared-srcs",
srcs: [
"core/java/android/net/InterfaceConfiguration.java",
- "core/java/android/os/BasicShellCommandHandler.java",
"core/java/android/util/BackupUtils.java",
"core/java/android/util/Rational.java",
"core/java/com/android/internal/util/FastXmlSerializer.java",
diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java
index 1e7206287566..cc202130ab07 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java
@@ -20,10 +20,11 @@ import android.app.ActivityManager;
import android.app.AppGlobals;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
-import android.os.BasicShellCommandHandler;
import android.os.Binder;
import android.os.UserHandle;
+import com.android.modules.utils.BasicShellCommandHandler;
+
import java.io.PrintWriter;
public final class JobSchedulerShellCommand extends BasicShellCommandHandler {
diff --git a/config/preloaded-classes b/config/preloaded-classes
index 481bcb5f8b85..d56fc7720c89 100644
--- a/config/preloaded-classes
+++ b/config/preloaded-classes
@@ -4539,7 +4539,6 @@ android.os.AsyncTask
android.os.BadParcelableException
android.os.BaseBundle$NoImagePreloadHolder
android.os.BaseBundle
-android.os.BasicShellCommandHandler
android.os.BatteryManager
android.os.BatteryManagerInternal
android.os.BatteryProperty$1
@@ -9565,6 +9564,7 @@ com.android.internal.widget.VerifyCredentialResponse$1
com.android.internal.widget.VerifyCredentialResponse
com.android.internal.widget.ViewClippingUtil$ClippingParameters
com.android.internal.widget.ViewClippingUtil
+com.android.modules.utils.BasicShellCommandHandler
com.android.okhttp.Address
com.android.okhttp.AndroidShimResponseCache
com.android.okhttp.Authenticator
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 6d158927ff64..f6b1d0627312 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -10127,6 +10127,8 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin(int);
method public String getCdmaPrlVersion();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCdmaRoamingMode();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCdmaSubscriptionMode();
method public int getCurrentPhoneType();
method public int getCurrentPhoneType(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getDataActivationState();
@@ -10198,6 +10200,8 @@ package android.telephony {
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 @Deprecated @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 setCdmaRoamingMode(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCdmaSubscriptionMode(int);
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);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean);
@@ -10246,6 +10250,9 @@ package android.telephony {
field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
field public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; // 0xffffffff
+ field public static final int CDMA_SUBSCRIPTION_NV = 1; // 0x1
+ field public static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0; // 0x0
+ field public static final int CDMA_SUBSCRIPTION_UNKNOWN = -1; // 0xffffffff
field public static final int ENABLE_NR_DUAL_CONNECTIVITY_INVALID_STATE = 4; // 0x4
field public static final int ENABLE_NR_DUAL_CONNECTIVITY_NOT_SUPPORTED = 1; // 0x1
field public static final int ENABLE_NR_DUAL_CONNECTIVITY_RADIO_ERROR = 3; // 0x3
@@ -10388,8 +10395,10 @@ package android.telephony.data {
method public int getMtuV4();
method public int getMtuV6();
method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
+ method public int getPduSessionId();
method public int getProtocolType();
- method public int getSuggestedRetryTime();
+ method public long getRetryIntervalMillis();
+ method @Deprecated 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 = 1; // 0x1
@@ -10401,6 +10410,8 @@ package android.telephony.data {
field public static final int LINK_STATUS_DORMANT = 1; // 0x1
field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
field public static final int LINK_STATUS_UNKNOWN = -1; // 0xffffffff
+ field public static final int PDU_SESSION_ID_NOT_SET = 0; // 0x0
+ field public static final int RETRY_INTERVAL_UNDEFINED = -1; // 0xffffffff
}
public static final class DataCallResponse.Builder {
@@ -10418,8 +10429,10 @@ package android.telephony.data {
method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV4(int);
method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV6(int);
method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setPduSessionId(int);
method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
- method @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setRetryIntervalMillis(long);
+ method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
}
public final class DataProfile implements android.os.Parcelable {
@@ -10481,6 +10494,7 @@ package android.telephony.data {
public abstract class DataService.DataServiceProvider implements java.lang.AutoCloseable {
ctor public DataService.DataServiceProvider(int);
+ method public void cancelHandover(int, @NonNull android.telephony.data.DataServiceCallback);
method public abstract void close();
method public void deactivateDataCall(int, int, @Nullable android.telephony.data.DataServiceCallback);
method public final int getSlotIndex();
@@ -10489,11 +10503,15 @@ package android.telephony.data {
method public void setDataProfile(@NonNull java.util.List<android.telephony.data.DataProfile>, boolean, @NonNull android.telephony.data.DataServiceCallback);
method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @NonNull android.telephony.data.DataServiceCallback);
method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @NonNull android.telephony.data.DataServiceCallback);
+ method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @IntRange(from=0, to=15) int, @NonNull android.telephony.data.DataServiceCallback);
+ method public void startHandover(int, @NonNull android.telephony.data.DataServiceCallback);
}
public class DataServiceCallback {
method public void onDataCallListChanged(@NonNull java.util.List<android.telephony.data.DataCallResponse>);
method public void onDeactivateDataCallComplete(int);
+ method public void onHandoverCancelled(int);
+ method public void onHandoverStarted(int);
method public void onRequestDataCallListComplete(int, @NonNull java.util.List<android.telephony.data.DataCallResponse>);
method public void onSetDataProfileComplete(int);
method public void onSetInitialAttachApnComplete(int);
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java
index aa4b15454721..06046f7ded2e 100644
--- a/core/java/android/net/LinkProperties.java
+++ b/core/java/android/net/LinkProperties.java
@@ -80,8 +80,10 @@ public final class LinkProperties implements Parcelable {
private final transient boolean mParcelSensitiveFields;
private static final int MIN_MTU = 68;
- /* package-visibility - Used in other files (such as Ikev2VpnProfile) as minimum iface MTU. */
- static final int MIN_MTU_V6 = 1280;
+
+ /** @hide */
+ public static final int MIN_MTU_V6 = 1280;
+
private static final int MAX_MTU = 10000;
private static final int INET6_ADDR_LENGTH = 16;
diff --git a/core/java/android/os/BasicShellCommandHandler.java b/core/java/android/os/BasicShellCommandHandler.java
deleted file mode 100644
index 1ea2229cff1f..000000000000
--- a/core/java/android/os/BasicShellCommandHandler.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (C) 2019 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 android.os;
-
-import android.util.Log;
-
-import java.io.BufferedInputStream;
-import java.io.FileDescriptor;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-/**
- * Helper for implementing {@link Binder#onShellCommand Binder.onShellCommand}. This is meant to
- * be copied into mainline modules, so this class must not use any hidden APIs.
- *
- * @hide
- */
-public abstract class BasicShellCommandHandler {
- static final String TAG = "ShellCommand";
- static final boolean DEBUG = false;
-
- private Binder mTarget;
- private FileDescriptor mIn;
- private FileDescriptor mOut;
- private FileDescriptor mErr;
- private String[] mArgs;
-
- private String mCmd;
- private int mArgPos;
- private String mCurArgData;
-
- private FileInputStream mFileIn;
- private FileOutputStream mFileOut;
- private FileOutputStream mFileErr;
-
- private PrintWriter mOutPrintWriter;
- private PrintWriter mErrPrintWriter;
- private InputStream mInputStream;
-
- public void init(Binder target, FileDescriptor in, FileDescriptor out, FileDescriptor err,
- String[] args, int firstArgPos) {
- mTarget = target;
- mIn = in;
- mOut = out;
- mErr = err;
- mArgs = args;
- mCmd = null;
- mArgPos = firstArgPos;
- mCurArgData = null;
- mFileIn = null;
- mFileOut = null;
- mFileErr = null;
- mOutPrintWriter = null;
- mErrPrintWriter = null;
- mInputStream = null;
- }
-
- public int exec(Binder target, FileDescriptor in, FileDescriptor out, FileDescriptor err,
- String[] args) {
- String cmd;
- int start;
- if (args != null && args.length > 0) {
- cmd = args[0];
- start = 1;
- } else {
- cmd = null;
- start = 0;
- }
- init(target, in, out, err, args, start);
- mCmd = cmd;
-
- if (DEBUG) {
- RuntimeException here = new RuntimeException("here");
- here.fillInStackTrace();
- Log.d(TAG, "Starting command " + mCmd + " on " + mTarget, here);
- Log.d(TAG, "Calling uid=" + Binder.getCallingUid()
- + " pid=" + Binder.getCallingPid());
- }
- int res = -1;
- try {
- res = onCommand(mCmd);
- if (DEBUG) Log.d(TAG, "Executed command " + mCmd + " on " + mTarget);
- } catch (Throwable e) {
- // Unlike usual calls, in this case if an exception gets thrown
- // back to us we want to print it back in to the dump data, since
- // that is where the caller expects all interesting information to
- // go.
- PrintWriter eout = getErrPrintWriter();
- eout.println();
- eout.println("Exception occurred while executing '" + mCmd + "':");
- e.printStackTrace(eout);
- } finally {
- if (DEBUG) Log.d(TAG, "Flushing output streams on " + mTarget);
- if (mOutPrintWriter != null) {
- mOutPrintWriter.flush();
- }
- if (mErrPrintWriter != null) {
- mErrPrintWriter.flush();
- }
- if (DEBUG) Log.d(TAG, "Sending command result on " + mTarget);
- }
- if (DEBUG) Log.d(TAG, "Finished command " + mCmd + " on " + mTarget);
- return res;
- }
-
- /**
- * Return the raw FileDescriptor for the output stream.
- */
- public FileDescriptor getOutFileDescriptor() {
- return mOut;
- }
-
- /**
- * Return direct raw access (not buffered) to the command's output data stream.
- */
- public OutputStream getRawOutputStream() {
- if (mFileOut == null) {
- mFileOut = new FileOutputStream(mOut);
- }
- return mFileOut;
- }
-
- /**
- * Return a PrintWriter for formatting output to {@link #getRawOutputStream()}.
- */
- public PrintWriter getOutPrintWriter() {
- if (mOutPrintWriter == null) {
- mOutPrintWriter = new PrintWriter(getRawOutputStream());
- }
- return mOutPrintWriter;
- }
-
- /**
- * Return the raw FileDescriptor for the error stream.
- */
- public FileDescriptor getErrFileDescriptor() {
- return mErr;
- }
-
- /**
- * Return direct raw access (not buffered) to the command's error output data stream.
- */
- public OutputStream getRawErrorStream() {
- if (mFileErr == null) {
- mFileErr = new FileOutputStream(mErr);
- }
- return mFileErr;
- }
-
- /**
- * Return a PrintWriter for formatting output to {@link #getRawErrorStream()}.
- */
- public PrintWriter getErrPrintWriter() {
- if (mErr == null) {
- return getOutPrintWriter();
- }
- if (mErrPrintWriter == null) {
- mErrPrintWriter = new PrintWriter(getRawErrorStream());
- }
- return mErrPrintWriter;
- }
-
- /**
- * Return the raw FileDescriptor for the input stream.
- */
- public FileDescriptor getInFileDescriptor() {
- return mIn;
- }
-
- /**
- * Return direct raw access (not buffered) to the command's input data stream.
- */
- public InputStream getRawInputStream() {
- if (mFileIn == null) {
- mFileIn = new FileInputStream(mIn);
- }
- return mFileIn;
- }
-
- /**
- * Return buffered access to the command's {@link #getRawInputStream()}.
- */
- public InputStream getBufferedInputStream() {
- if (mInputStream == null) {
- mInputStream = new BufferedInputStream(getRawInputStream());
- }
- return mInputStream;
- }
-
- /**
- * Return the next option on the command line -- that is an argument that
- * starts with '-'. If the next argument is not an option, null is returned.
- */
- public String getNextOption() {
- if (mCurArgData != null) {
- String prev = mArgs[mArgPos - 1];
- throw new IllegalArgumentException("No argument expected after \"" + prev + "\"");
- }
- if (mArgPos >= mArgs.length) {
- return null;
- }
- String arg = mArgs[mArgPos];
- if (!arg.startsWith("-")) {
- return null;
- }
- mArgPos++;
- if (arg.equals("--")) {
- return null;
- }
- if (arg.length() > 1 && arg.charAt(1) != '-') {
- if (arg.length() > 2) {
- mCurArgData = arg.substring(2);
- return arg.substring(0, 2);
- } else {
- mCurArgData = null;
- return arg;
- }
- }
- mCurArgData = null;
- return arg;
- }
-
- /**
- * Return the next argument on the command line, whatever it is; if there are
- * no arguments left, return null.
- */
- public String getNextArg() {
- if (mCurArgData != null) {
- String arg = mCurArgData;
- mCurArgData = null;
- return arg;
- } else if (mArgPos < mArgs.length) {
- return mArgs[mArgPos++];
- } else {
- return null;
- }
- }
-
- public String peekNextArg() {
- if (mCurArgData != null) {
- return mCurArgData;
- } else if (mArgPos < mArgs.length) {
- return mArgs[mArgPos];
- } else {
- return null;
- }
- }
-
- /**
- * Returns number of arguments that haven't been processed yet.
- */
- public int getRemainingArgsCount() {
- if (mArgPos >= mArgs.length) {
- return 0;
- }
- return mArgs.length - mArgPos;
- }
-
- /**
- * Return the next argument on the command line, whatever it is; if there are
- * no arguments left, throws an IllegalArgumentException to report this to the user.
- */
- public String getNextArgRequired() {
- String arg = getNextArg();
- if (arg == null) {
- String prev = mArgs[mArgPos - 1];
- throw new IllegalArgumentException("Argument expected after \"" + prev + "\"");
- }
- return arg;
- }
-
- public int handleDefaultCommands(String cmd) {
- if (cmd == null || "help".equals(cmd) || "-h".equals(cmd)) {
- onHelp();
- } else {
- getOutPrintWriter().println("Unknown command: " + cmd);
- }
- return -1;
- }
-
- public Binder getTarget() {
- return mTarget;
- }
-
- public String[] getAllArgs() {
- return mArgs;
- }
-
- /**
- * Implement parsing and execution of a command. If it isn't a command you understand,
- * call {@link #handleDefaultCommands(String)} and return its result as a last resort.
- * Use {@link #getNextOption()}, {@link #getNextArg()}, and {@link #getNextArgRequired()}
- * to process additional command line arguments. Command output can be written to
- * {@link #getOutPrintWriter()} and errors to {@link #getErrPrintWriter()}.
- *
- * <p class="caution">Note that no permission checking has been done before entering this
- * function, so you need to be sure to do your own security verification for any commands you
- * are executing. The easiest way to do this is to have the ShellCommand contain
- * only a reference to your service's aidl interface, and do all of your command
- * implementations on top of that -- that way you can rely entirely on your executing security
- * code behind that interface.</p>
- *
- * @param cmd The first command line argument representing the name of the command to execute.
- * @return Return the command result; generally 0 or positive indicates success and
- * negative values indicate error.
- */
- public abstract int onCommand(String cmd);
-
- /**
- * Implement this to print help text about your command to {@link #getOutPrintWriter()}.
- */
- public abstract void onHelp();
-}
diff --git a/core/java/android/os/ShellCommand.java b/core/java/android/os/ShellCommand.java
index 3358ce13ed52..a2173a6d2360 100644
--- a/core/java/android/os/ShellCommand.java
+++ b/core/java/android/os/ShellCommand.java
@@ -19,15 +19,9 @@ package android.os;
import android.compat.annotation.UnsupportedAppUsage;
import android.util.Slog;
-import com.android.internal.util.FastPrintWriter;
+import com.android.modules.utils.BasicShellCommandHandler;
-import java.io.BufferedInputStream;
import java.io.FileDescriptor;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
/**
* Helper for implementing {@link Binder#onShellCommand Binder.onShellCommand}.
diff --git a/core/java/android/os/strictmode/UntaggedSocketViolation.java b/core/java/android/os/strictmode/UntaggedSocketViolation.java
index 3b1ef253b2d2..c34d6e821f7a 100644
--- a/core/java/android/os/strictmode/UntaggedSocketViolation.java
+++ b/core/java/android/os/strictmode/UntaggedSocketViolation.java
@@ -18,7 +18,7 @@ package android.os.strictmode;
public final class UntaggedSocketViolation extends Violation {
/** @hide */
public UntaggedSocketViolation() {
- super("Untagged socket detected; use TrafficStats.setThreadSocketTag() to "
+ super("Untagged socket detected; use TrafficStats.setTrafficStatsTag() to "
+ "track all network usage");
}
}
diff --git a/core/java/android/security/keymaster/KeymasterDefs.java b/core/java/android/security/keymaster/KeymasterDefs.java
index e32ffa6e9d05..18921639f55d 100644
--- a/core/java/android/security/keymaster/KeymasterDefs.java
+++ b/core/java/android/security/keymaster/KeymasterDefs.java
@@ -94,6 +94,8 @@ public final class KeymasterDefs {
public static final int KM_TAG_ATTESTATION_ID_MEID = KM_BYTES | 715;
public static final int KM_TAG_ATTESTATION_ID_MANUFACTURER = KM_BYTES | 716;
public static final int KM_TAG_ATTESTATION_ID_MODEL = KM_BYTES | 717;
+ public static final int KM_TAG_VENDOR_PATCHLEVEL = KM_UINT | 718;
+ public static final int KM_TAG_BOOT_PATCHLEVEL = KM_UINT | 719;
public static final int KM_TAG_DEVICE_UNIQUE_ATTESTATION = KM_BOOL | 720;
public static final int KM_TAG_ASSOCIATED_DATA = KM_BYTES | 1000;
diff --git a/core/java/com/android/internal/os/BaseCommand.java b/core/java/com/android/internal/os/BaseCommand.java
index c110b263e781..c85b5d7aa7a6 100644
--- a/core/java/com/android/internal/os/BaseCommand.java
+++ b/core/java/com/android/internal/os/BaseCommand.java
@@ -18,9 +18,10 @@
package com.android.internal.os;
import android.compat.annotation.UnsupportedAppUsage;
-import android.os.BasicShellCommandHandler;
import android.os.Build;
+import com.android.modules.utils.BasicShellCommandHandler;
+
import java.io.PrintStream;
public abstract class BaseCommand {
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index fba1e79ad79a..f7de5c023b4f 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -139,7 +139,6 @@ import android.net.util.LinkPropertiesUtils.CompareOrUpdateResult;
import android.net.util.LinkPropertiesUtils.CompareResult;
import android.net.util.MultinetworkPolicyTracker;
import android.net.util.NetdService;
-import android.os.BasicShellCommandHandler;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
@@ -192,6 +191,7 @@ import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.LocationPermissionChecker;
import com.android.internal.util.MessageUtils;
import com.android.internal.util.XmlUtils;
+import com.android.modules.utils.BasicShellCommandHandler;
import com.android.server.am.BatteryStatsService;
import com.android.server.connectivity.AutodestructReference;
import com.android.server.connectivity.DataConnectionStats;
@@ -2697,10 +2697,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
/**
* Return an array of all current NetworkRequest sorted by request id.
*/
- private NetworkRequestInfo[] requestsSortedById() {
+ @VisibleForTesting
+ protected NetworkRequestInfo[] requestsSortedById() {
NetworkRequestInfo[] requests = new NetworkRequestInfo[0];
requests = mNetworkRequests.values().toArray(requests);
- Arrays.sort(requests, Comparator.comparingInt(nri -> nri.request.requestId));
+ // Sort the array based off the NRI containing the min requestId in its requests.
+ Arrays.sort(requests,
+ Comparator.comparingInt(nri -> Collections.min(nri.mRequests,
+ Comparator.comparingInt(req -> req.requestId)).requestId
+ )
+ );
return requests;
}
@@ -5350,6 +5356,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
}
+ private void ensureAllNetworkRequestsHaveType(List<NetworkRequest> requests) {
+ for (int i = 0; i < requests.size(); i++) {
+ ensureNetworkRequestHasType(requests.get(i));
+ }
+ }
+
private void ensureNetworkRequestHasType(NetworkRequest request) {
if (request.type == NetworkRequest.Type.NONE) {
throw new IllegalArgumentException(
@@ -5361,7 +5373,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
* Tracks info about the requester.
* Also used to notice when the calling process dies so we can self-expire
*/
- private class NetworkRequestInfo implements IBinder.DeathRecipient {
+ @VisibleForTesting
+ protected class NetworkRequestInfo implements IBinder.DeathRecipient {
final List<NetworkRequest> mRequests;
final NetworkRequest request;
@@ -5380,7 +5393,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
NetworkRequestInfo(NetworkRequest r, PendingIntent pi) {
request = r;
mRequests = initializeRequests(r);
- ensureNetworkRequestHasType(request);
+ ensureAllNetworkRequestsHaveType(mRequests);
mPendingIntent = pi;
messenger = null;
mBinder = null;
@@ -5394,7 +5407,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
messenger = m;
request = r;
mRequests = initializeRequests(r);
- ensureNetworkRequestHasType(request);
+ ensureAllNetworkRequestsHaveType(mRequests);
mBinder = binder;
mPid = getCallingPid();
mUid = getCallingUid();
@@ -5418,6 +5431,19 @@ public class ConnectivityService extends IConnectivityManager.Stub
return Collections.unmodifiableList(tempRequests);
}
+ private NetworkRequest getSatisfiedRequest() {
+ if (mSatisfier == null) {
+ return null;
+ }
+
+ for (NetworkRequest req : mRequests) {
+ if (mSatisfier.isSatisfyingRequest(req.requestId)) {
+ return req;
+ }
+ }
+
+ return null;
+ }
private void enforceRequestCountLimit() {
synchronized (mUidToNetworkRequestCount) {
@@ -5436,14 +5462,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
}
+ @Override
public void binderDied() {
log("ConnectivityService NetworkRequestInfo binderDied(" +
- request + ", " + mBinder + ")");
- releaseNetworkRequest(request);
+ mRequests + ", " + mBinder + ")");
+ releaseNetworkRequest(mRequests);
}
+ @Override
public String toString() {
- return "uid/pid:" + mUid + "/" + mPid + " " + request
+ return "uid/pid:" + mUid + "/" + mPid + " " + mRequests
+ (mPendingIntent == null ? "" : " to trigger " + mPendingIntent);
}
}
@@ -5763,6 +5791,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
return mNextNetworkProviderId.getAndIncrement();
}
+ private void releaseNetworkRequest(List<NetworkRequest> networkRequests) {
+ for (int i = 0; i < networkRequests.size(); i++) {
+ releaseNetworkRequest(networkRequests.get(i));
+ }
+ }
+
@Override
public void releaseNetworkRequest(NetworkRequest networkRequest) {
ensureNetworkRequestHasType(networkRequest);
@@ -5854,7 +5888,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
@GuardedBy("mBlockedAppUids")
private final HashSet<Integer> mBlockedAppUids = new HashSet<>();
- // Note: if mDefaultRequest is changed, NetworkMonitor needs to be updated.
@NonNull
private final NetworkRequest mDefaultRequest;
// The NetworkAgentInfo currently satisfying the default request, if any.
@@ -6780,7 +6813,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
public String toString() {
- return mRequest.request.requestId + " : "
+ return mRequest.mRequests.get(0).requestId + " : "
+ (null != mOldNetwork ? mOldNetwork.network.netId : "null")
+ " → " + (null != mNewNetwork ? mNewNetwork.network.netId : "null");
}
diff --git a/services/core/java/com/android/server/Watchdog.java b/services/core/java/com/android/server/Watchdog.java
index 418deb801085..630548df4b0b 100644
--- a/services/core/java/com/android/server/Watchdog.java
+++ b/services/core/java/com/android/server/Watchdog.java
@@ -113,6 +113,7 @@ public class Watchdog extends Thread {
"android.hardware.audio@4.0::IDevicesFactory",
"android.hardware.audio@5.0::IDevicesFactory",
"android.hardware.audio@6.0::IDevicesFactory",
+ "android.hardware.audio@7.0::IDevicesFactory",
"android.hardware.biometrics.face@1.0::IBiometricsFace",
"android.hardware.biometrics.fingerprint@2.1::IBiometricsFingerprint",
"android.hardware.bluetooth@1.0::IBluetoothHci",
diff --git a/services/core/java/com/android/server/adb/AdbShellCommand.java b/services/core/java/com/android/server/adb/AdbShellCommand.java
index 76918529d071..d7e95df332fa 100644
--- a/services/core/java/com/android/server/adb/AdbShellCommand.java
+++ b/services/core/java/com/android/server/adb/AdbShellCommand.java
@@ -16,7 +16,7 @@
package com.android.server.adb;
-import android.os.BasicShellCommandHandler;
+import com.android.modules.utils.BasicShellCommandHandler;
import java.io.PrintWriter;
import java.util.Objects;
diff --git a/services/core/java/com/android/server/location/LocationShellCommand.java b/services/core/java/com/android/server/location/LocationShellCommand.java
index 909873f07993..3464704b9734 100644
--- a/services/core/java/com/android/server/location/LocationShellCommand.java
+++ b/services/core/java/com/android/server/location/LocationShellCommand.java
@@ -16,9 +16,10 @@
package com.android.server.location;
-import android.os.BasicShellCommandHandler;
import android.os.UserHandle;
+import com.android.modules.utils.BasicShellCommandHandler;
+
import java.io.PrintWriter;
import java.util.Objects;
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 2483126807b7..4a7118ec3590 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -9364,11 +9364,22 @@ public class TelephonyManager {
* <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
* given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}
*
- * @return one of {@link #CDMA_ROAMING_MODE_RADIO_DEFAULT}, {@link #CDMA_ROAMING_MODE_HOME},
- * {@link #CDMA_ROAMING_MODE_AFFILIATED}, {@link #CDMA_ROAMING_MODE_ANY}.
+ * @return the CDMA roaming mode.
+ * @throws SecurityException if the caller does not have the permission.
+ * @throws IllegalStateException if the Telephony process is not currently available.
+ *
+ * @see #CDMA_ROAMING_MODE_RADIO_DEFAULT
+ * @see #CDMA_ROAMING_MODE_HOME
+ * @see #CDMA_ROAMING_MODE_AFFILIATED
+ * @see #CDMA_ROAMING_MODE_ANY
+ *
+ * <p>Requires permission:
+ * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
+ * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
*
* @hide
*/
+ @SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public @CdmaRoamingMode int getCdmaRoamingMode() {
int mode = CDMA_ROAMING_MODE_RADIO_DEFAULT;
@@ -9376,9 +9387,12 @@ public class TelephonyManager {
ITelephony telephony = getITelephony();
if (telephony != null) {
mode = telephony.getCdmaRoamingMode(getSubId());
+ } else {
+ throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
Log.e(TAG, "Error calling ITelephony#getCdmaRoamingMode", ex);
+ ex.rethrowFromSystemServer();
}
return mode;
}
@@ -9389,25 +9403,36 @@ public class TelephonyManager {
* <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
* given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}
*
- * @param mode should be one of {@link #CDMA_ROAMING_MODE_RADIO_DEFAULT},
- * {@link #CDMA_ROAMING_MODE_HOME}, {@link #CDMA_ROAMING_MODE_AFFILIATED},
- * {@link #CDMA_ROAMING_MODE_ANY}.
+ * @param mode CDMA roaming mode.
+ * @throws SecurityException if the caller does not have the permission.
+ * @throws IllegalStateException if the Telephony process or radio is not currently available.
*
- * @return {@code true} if successed.
+ * @see #CDMA_ROAMING_MODE_RADIO_DEFAULT
+ * @see #CDMA_ROAMING_MODE_HOME
+ * @see #CDMA_ROAMING_MODE_AFFILIATED
+ * @see #CDMA_ROAMING_MODE_ANY
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
+ * app has carrier privileges (see {@link #hasCarrierPrivileges}).
*
* @hide
*/
+ @SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
- public boolean setCdmaRoamingMode(@CdmaRoamingMode int mode) {
+ public void setCdmaRoamingMode(@CdmaRoamingMode int mode) {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
- return telephony.setCdmaRoamingMode(getSubId(), mode);
+ boolean result = telephony.setCdmaRoamingMode(getSubId(), mode);
+ if (!result) throw new IllegalStateException("radio is unavailable.");
+ } else {
+ throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
Log.e(TAG, "Error calling ITelephony#setCdmaRoamingMode", ex);
+ ex.rethrowFromSystemServer();
}
- return false;
}
/** @hide */
@@ -9419,48 +9444,94 @@ public class TelephonyManager {
@Retention(RetentionPolicy.SOURCE)
public @interface CdmaSubscription{}
- /** Used for CDMA subscription mode, it'll be UNKNOWN if there is no Subscription source.
+ /**
+ * Used for CDMA subscription mode, it'll be UNKNOWN if there is no Subscription source.
* @hide
*/
+ @SystemApi
public static final int CDMA_SUBSCRIPTION_UNKNOWN = -1;
- /** Used for CDMA subscription mode: RUIM/SIM (default)
+ /**
+ * Used for CDMA subscription mode: RUIM/SIM (default)
* @hide
*/
+ @SystemApi
public static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0;
- /** Used for CDMA subscription mode: NV -> non-volatile memory
+ /**
+ * Used for CDMA subscription mode: NV -> non-volatile memory
* @hide
*/
+ @SystemApi
public static final int CDMA_SUBSCRIPTION_NV = 1;
- /** @hide */
- public static final int PREFERRED_CDMA_SUBSCRIPTION = CDMA_SUBSCRIPTION_RUIM_SIM;
+ /**
+ * Gets the subscription mode for CDMA phone.
+ *
+ * @return the CDMA subscription mode.
+ * @throws SecurityException if the caller does not have the permission.
+ * @throws IllegalStateException if the Telephony process or radio is not currently available.
+ *
+ * @see #CDMA_SUBSCRIPTION_UNKNOWN
+ * @see #CDMA_SUBSCRIPTION_RUIM_SIM
+ * @see #CDMA_SUBSCRIPTION_NV
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
+ * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ public @CdmaSubscription int getCdmaSubscriptionMode() {
+ int mode = CDMA_SUBSCRIPTION_RUIM_SIM;
+ try {
+ ITelephony telephony = getITelephony();
+ if (telephony != null) {
+ mode = telephony.getCdmaSubscriptionMode(getSubId());
+ } else {
+ throw new IllegalStateException("telephony service is null.");
+ }
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Error calling ITelephony#getCdmaSubscriptionMode", ex);
+ ex.rethrowFromSystemServer();
+ }
+ return mode;
+ }
/**
* Sets the subscription mode for CDMA phone to the given mode {@code mode}.
*
- * @param mode CDMA subscription mode
- *
- * @return {@code true} if successed.
+ * @param mode CDMA subscription mode.
+ * @throws SecurityException if the caller does not have the permission.
+ * @throws IllegalStateException if the Telephony process is not currently available.
*
* @see #CDMA_SUBSCRIPTION_UNKNOWN
* @see #CDMA_SUBSCRIPTION_RUIM_SIM
* @see #CDMA_SUBSCRIPTION_NV
*
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
+ * app has carrier privileges (see {@link #hasCarrierPrivileges}).
+ *
* @hide
*/
+ @SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
- public boolean setCdmaSubscriptionMode(@CdmaSubscription int mode) {
+ public void setCdmaSubscriptionMode(@CdmaSubscription int mode) {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
- return telephony.setCdmaSubscriptionMode(getSubId(), mode);
+ boolean result = telephony.setCdmaSubscriptionMode(getSubId(), mode);
+ if (!result) throw new IllegalStateException("radio is unavailable.");
+ } else {
+ throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
Log.e(TAG, "Error calling ITelephony#setCdmaSubscriptionMode", ex);
+ ex.rethrowFromSystemServer();
}
- return false;
}
/**
diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index a39031d6846e..ca9bf3cfaa0d 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -108,8 +108,19 @@ public final class DataCallResponse implements Parcelable {
*/
public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3;
+ /**
+ * Indicates that data retry interval is not specified. Platform can determine when to
+ * perform data setup appropriately.
+ */
+ public static final int RETRY_INTERVAL_UNDEFINED = -1;
+
+ /**
+ * Indicates that the pdu session id is not set.
+ */
+ public static final int PDU_SESSION_ID_NOT_SET = 0;
+
private final @DataFailureCause int mCause;
- private final int mSuggestedRetryTime;
+ private final long mSuggestedRetryTime;
private final int mId;
private final @LinkStatus int mLinkStatus;
private final @ProtocolType int mProtocolType;
@@ -122,6 +133,7 @@ public final class DataCallResponse implements Parcelable {
private final int mMtuV4;
private final int mMtuV6;
private final @HandoverFailureMode int mHandoverFailureMode;
+ private final int mPduSessionId;
/**
* @param cause Data call fail cause. {@link DataFailCause#NONE} indicates no error.
@@ -169,14 +181,15 @@ public final class DataCallResponse implements Parcelable {
? new ArrayList<>() : new ArrayList<>(pcscfAddresses);
mMtu = mMtuV4 = mMtuV6 = mtu;
mHandoverFailureMode = HANDOVER_FAILURE_MODE_LEGACY;
+ mPduSessionId = PDU_SESSION_ID_NOT_SET;
}
- private DataCallResponse(@DataFailureCause int cause, int suggestedRetryTime, int id,
+ private DataCallResponse(@DataFailureCause int cause, long suggestedRetryTime, int id,
@LinkStatus int linkStatus, @ProtocolType int protocolType,
@Nullable String interfaceName, @Nullable List<LinkAddress> addresses,
@Nullable List<InetAddress> dnsAddresses, @Nullable List<InetAddress> gatewayAddresses,
@Nullable List<InetAddress> pcscfAddresses, int mtu, int mtuV4, int mtuV6,
- @HandoverFailureMode int handoverFailureMode) {
+ @HandoverFailureMode int handoverFailureMode, int pduSessionId) {
mCause = cause;
mSuggestedRetryTime = suggestedRetryTime;
mId = id;
@@ -195,13 +208,14 @@ public final class DataCallResponse implements Parcelable {
mMtuV4 = mtuV4;
mMtuV6 = mtuV6;
mHandoverFailureMode = handoverFailureMode;
+ mPduSessionId = pduSessionId;
}
/** @hide */
@VisibleForTesting
public DataCallResponse(Parcel source) {
mCause = source.readInt();
- mSuggestedRetryTime = source.readInt();
+ mSuggestedRetryTime = source.readLong();
mId = source.readInt();
mLinkStatus = source.readInt();
mProtocolType = source.readInt();
@@ -218,6 +232,7 @@ public final class DataCallResponse implements Parcelable {
mMtuV4 = source.readInt();
mMtuV6 = source.readInt();
mHandoverFailureMode = source.readInt();
+ mPduSessionId = source.readInt();
}
/**
@@ -228,8 +243,22 @@ public final class DataCallResponse implements Parcelable {
/**
* @return The suggested data retry time in milliseconds.
+ *
+ * @deprecated Use {@link #getRetryIntervalMillis()} instead.
*/
- public int getSuggestedRetryTime() { return mSuggestedRetryTime; }
+ @Deprecated
+ public int getSuggestedRetryTime() {
+ return (int) mSuggestedRetryTime;
+ }
+
+ /**
+ * @return The network suggested data retry interval in milliseconds. {@code Long.MAX_VALUE}
+ * indicates data retry should not occur. {@link #RETRY_INTERVAL_UNDEFINED} indicates network
+ * did not suggest any retry interval.
+ */
+ public long getRetryIntervalMillis() {
+ return mSuggestedRetryTime;
+ }
/**
* @return The unique id of the data connection.
@@ -314,6 +343,13 @@ public final class DataCallResponse implements Parcelable {
return mHandoverFailureMode;
}
+ /**
+ * @return The pdu session id
+ */
+ public int getPduSessionId() {
+ return mPduSessionId;
+ }
+
@NonNull
@Override
public String toString() {
@@ -333,6 +369,7 @@ public final class DataCallResponse implements Parcelable {
.append(" mtuV4=").append(getMtuV4())
.append(" mtuV6=").append(getMtuV6())
.append(" handoverFailureMode=").append(getHandoverFailureMode())
+ .append(" pduSessionId=").append(getPduSessionId())
.append("}");
return sb.toString();
}
@@ -363,14 +400,15 @@ public final class DataCallResponse implements Parcelable {
&& mMtu == other.mMtu
&& mMtuV4 == other.mMtuV4
&& mMtuV6 == other.mMtuV6
- && mHandoverFailureMode == other.mHandoverFailureMode;
+ && mHandoverFailureMode == other.mHandoverFailureMode
+ && mPduSessionId == other.mPduSessionId;
}
@Override
public int hashCode() {
return Objects.hash(mCause, mSuggestedRetryTime, mId, mLinkStatus, mProtocolType,
mInterfaceName, mAddresses, mDnsAddresses, mGatewayAddresses, mPcscfAddresses,
- mMtu, mMtuV4, mMtuV6, mHandoverFailureMode);
+ mMtu, mMtuV4, mMtuV6, mHandoverFailureMode, mPduSessionId);
}
@Override
@@ -381,7 +419,7 @@ public final class DataCallResponse implements Parcelable {
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mCause);
- dest.writeInt(mSuggestedRetryTime);
+ dest.writeLong(mSuggestedRetryTime);
dest.writeInt(mId);
dest.writeInt(mLinkStatus);
dest.writeInt(mProtocolType);
@@ -394,6 +432,7 @@ public final class DataCallResponse implements Parcelable {
dest.writeInt(mMtuV4);
dest.writeInt(mMtuV6);
dest.writeInt(mHandoverFailureMode);
+ dest.writeInt(mPduSessionId);
}
public static final @android.annotation.NonNull Parcelable.Creator<DataCallResponse> CREATOR =
@@ -445,7 +484,7 @@ public final class DataCallResponse implements Parcelable {
public static final class Builder {
private @DataFailureCause int mCause;
- private int mSuggestedRetryTime;
+ private long mSuggestedRetryTime = RETRY_INTERVAL_UNDEFINED;
private int mId;
@@ -471,6 +510,8 @@ public final class DataCallResponse implements Parcelable {
private @HandoverFailureMode int mHandoverFailureMode = HANDOVER_FAILURE_MODE_LEGACY;
+ private int mPduSessionId = PDU_SESSION_ID_NOT_SET;
+
/**
* Default constructor for Builder.
*/
@@ -493,9 +534,23 @@ public final class DataCallResponse implements Parcelable {
*
* @param suggestedRetryTime The suggested data retry time in milliseconds.
* @return The same instance of the builder.
+ *
+ * @deprecated Use {@link #setRetryIntervalMillis(long)} instead.
*/
+ @Deprecated
public @NonNull Builder setSuggestedRetryTime(int suggestedRetryTime) {
- mSuggestedRetryTime = suggestedRetryTime;
+ mSuggestedRetryTime = (long) suggestedRetryTime;
+ return this;
+ }
+
+ /**
+ * Set the network suggested data retry interval.
+ *
+ * @param retryIntervalMillis The suggested data retry interval in milliseconds.
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setRetryIntervalMillis(long retryIntervalMillis) {
+ mSuggestedRetryTime = retryIntervalMillis;
return this;
}
@@ -640,6 +695,17 @@ public final class DataCallResponse implements Parcelable {
}
/**
+ * Set pdu session id.
+ *
+ * @param pduSessionId Pdu Session Id of the data call.
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setPduSessionId(int pduSessionId) {
+ mPduSessionId = pduSessionId;
+ return this;
+ }
+
+ /**
* Build the DataCallResponse.
*
* @return the DataCallResponse object.
@@ -647,7 +713,7 @@ public final class DataCallResponse implements Parcelable {
public @NonNull DataCallResponse build() {
return new DataCallResponse(mCause, mSuggestedRetryTime, mId, mLinkStatus,
mProtocolType, mInterfaceName, mAddresses, mDnsAddresses, mGatewayAddresses,
- mPcscfAddresses, mMtu, mMtuV4, mMtuV6, mHandoverFailureMode);
+ mPcscfAddresses, mMtu, mMtuV4, mMtuV6, mHandoverFailureMode, mPduSessionId);
}
}
}
diff --git a/telephony/java/android/telephony/data/DataService.java b/telephony/java/android/telephony/data/DataService.java
index f56bbe13051c..77685971c138 100644
--- a/telephony/java/android/telephony/data/DataService.java
+++ b/telephony/java/android/telephony/data/DataService.java
@@ -17,6 +17,7 @@
package android.telephony.data;
import android.annotation.IntDef;
+import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
@@ -30,7 +31,7 @@ import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
-import android.telephony.AccessNetworkConstants;
+import android.util.Log;
import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting;
@@ -104,6 +105,8 @@ public abstract class DataService extends Service {
private static final int DATA_SERVICE_REQUEST_REGISTER_DATA_CALL_LIST_CHANGED = 9;
private static final int DATA_SERVICE_REQUEST_UNREGISTER_DATA_CALL_LIST_CHANGED = 10;
private static final int DATA_SERVICE_INDICATION_DATA_CALL_LIST_CHANGED = 11;
+ private static final int DATA_SERVICE_REQUEST_START_HANDOVER = 12;
+ private static final int DATA_SERVICE_REQUEST_CANCEL_HANDOVER = 13;
private final HandlerThread mHandlerThread;
@@ -147,7 +150,7 @@ public abstract class DataService extends Service {
* the provided callback to notify the platform.
*
* @param accessNetworkType Access network type that the data call will be established on.
- * Must be one of {@link AccessNetworkConstants.AccessNetworkType}.
+ * Must be one of {@link android.telephony.AccessNetworkConstants.AccessNetworkType}.
* @param dataProfile Data profile used for data call setup. See {@link DataProfile}
* @param isRoaming True if the device is data roaming.
* @param allowRoaming True if data roaming is allowed by the user.
@@ -158,10 +161,9 @@ public abstract class DataService extends Service {
* @param callback The result callback for this request.
*/
public void setupDataCall(int accessNetworkType, @NonNull DataProfile dataProfile,
- boolean isRoaming, boolean allowRoaming,
- @SetupDataReason int reason,
- @Nullable LinkProperties linkProperties,
- @NonNull DataServiceCallback callback) {
+ boolean isRoaming, boolean allowRoaming,
+ @SetupDataReason int reason, @Nullable LinkProperties linkProperties,
+ @NonNull DataServiceCallback callback) {
// The default implementation is to return unsupported.
if (callback != null) {
callback.onSetupDataCallComplete(DataServiceCallback.RESULT_ERROR_UNSUPPORTED,
@@ -170,6 +172,37 @@ public abstract class DataService extends Service {
}
/**
+ * Setup a data connection. The data service provider must implement this method to support
+ * establishing a packet data connection. When completed or error, the service must invoke
+ * the provided callback to notify the platform.
+ *
+ * @param accessNetworkType Access network type that the data call will be established on.
+ * Must be one of {@link android.telephony.AccessNetworkConstants.AccessNetworkType}.
+ * @param dataProfile Data profile used for data call setup. See {@link DataProfile}
+ * @param isRoaming True if the device is data roaming.
+ * @param allowRoaming True if data roaming is allowed by the user.
+ * @param reason The reason for data setup. Must be {@link #REQUEST_REASON_NORMAL} or
+ * {@link #REQUEST_REASON_HANDOVER}.
+ * @param linkProperties If {@code reason} is {@link #REQUEST_REASON_HANDOVER}, this is the
+ * link properties of the existing data connection, otherwise null.
+ * @param pduSessionId The pdu session id to be used for this data call.
+ * The standard range of values are 1-15 while 0 means no pdu session id
+ * was attached to this call. Reference: 3GPP TS 24.007 section
+ * 11.2.3.1b.
+ * @param callback The result callback for this request.
+ */
+ public void setupDataCall(int accessNetworkType, @NonNull DataProfile dataProfile,
+ boolean isRoaming, boolean allowRoaming,
+ @SetupDataReason int reason,
+ @Nullable LinkProperties linkProperties,
+ @IntRange(from = 0, to = 15) int pduSessionId,
+ @NonNull DataServiceCallback callback) {
+ /* Call the old version since the new version isn't supported */
+ setupDataCall(accessNetworkType, dataProfile, isRoaming, allowRoaming, reason,
+ linkProperties, callback);
+ }
+
+ /**
* Deactivate a data connection. The data service provider must implement this method to
* support data connection tear down. When completed or error, the service must invoke the
* provided callback to notify the platform.
@@ -224,6 +257,53 @@ public abstract class DataService extends Service {
}
/**
+ * Indicates that a handover has begun. This is called on the source transport.
+ *
+ * Any resources being transferred cannot be released while a
+ * handover is underway.
+ *
+ * If a handover was unsuccessful, then the framework calls
+ * {@link DataService#cancelHandover}. The target transport retains ownership over any of
+ * the resources being transferred.
+ *
+ * If a handover was successful, the framework calls {@link DataService#deactivateDataCall}
+ * with reason {@link DataService.REQUEST_REASON_HANDOVER}. The target transport now owns
+ * the transferred resources and is responsible for releasing them.
+ *
+ * @param cid The identifier of the data call which is provided in {@link DataCallResponse}
+ * @param callback The result callback for this request.
+ */
+ public void startHandover(int cid, @NonNull DataServiceCallback callback) {
+ // The default implementation is to return unsupported.
+ if (callback != null) {
+ Log.d(TAG, "startHandover: " + cid);
+ callback.onHandoverStarted(DataServiceCallback.RESULT_ERROR_UNSUPPORTED);
+ } else {
+ Log.e(TAG, "startHandover: " + cid + ", callback is null");
+ }
+ }
+
+ /**
+ * Indicates that a handover was cancelled after a call to
+ * {@link DataService#startHandover}. This is called on the source transport.
+ *
+ * Since the handover was unsuccessful, the source transport retains ownership over any of
+ * the resources being transferred and is still responsible for releasing them.
+ *
+ * @param cid The identifier of the data call which is provided in {@link DataCallResponse}
+ * @param callback The result callback for this request.
+ */
+ public void cancelHandover(int cid, @NonNull DataServiceCallback callback) {
+ // The default implementation is to return unsupported.
+ if (callback != null) {
+ Log.d(TAG, "cancelHandover: " + cid);
+ callback.onHandoverCancelled(DataServiceCallback.RESULT_ERROR_UNSUPPORTED);
+ } else {
+ Log.e(TAG, "cancelHandover: " + cid + ", callback is null");
+ }
+ }
+
+ /**
* Get the active data call list.
*
* @param callback The result callback for this request.
@@ -278,16 +358,18 @@ public abstract class DataService extends Service {
public final boolean allowRoaming;
public final int reason;
public final LinkProperties linkProperties;
+ public final int pduSessionId;
public final IDataServiceCallback callback;
SetupDataCallRequest(int accessNetworkType, DataProfile dataProfile, boolean isRoaming,
boolean allowRoaming, int reason, LinkProperties linkProperties,
- IDataServiceCallback callback) {
+ int pduSessionId, IDataServiceCallback callback) {
this.accessNetworkType = accessNetworkType;
this.dataProfile = dataProfile;
this.isRoaming = isRoaming;
this.allowRoaming = allowRoaming;
this.linkProperties = linkProperties;
this.reason = reason;
+ this.pduSessionId = pduSessionId;
this.callback = callback;
}
}
@@ -327,6 +409,16 @@ public abstract class DataService extends Service {
}
}
+ private static final class BeginCancelHandoverRequest {
+ public final int cid;
+ public final IDataServiceCallback callback;
+ BeginCancelHandoverRequest(int cid,
+ IDataServiceCallback callback) {
+ this.cid = cid;
+ this.callback = callback;
+ }
+ }
+
private static final class DataCallListChangedIndication {
public final List<DataCallResponse> dataCallList;
public final IDataServiceCallback callback;
@@ -377,7 +469,7 @@ public abstract class DataService extends Service {
serviceProvider.setupDataCall(setupDataCallRequest.accessNetworkType,
setupDataCallRequest.dataProfile, setupDataCallRequest.isRoaming,
setupDataCallRequest.allowRoaming, setupDataCallRequest.reason,
- setupDataCallRequest.linkProperties,
+ setupDataCallRequest.linkProperties, setupDataCallRequest.pduSessionId,
(setupDataCallRequest.callback != null)
? new DataServiceCallback(setupDataCallRequest.callback)
: null);
@@ -438,6 +530,20 @@ public abstract class DataService extends Service {
loge("Failed to call onDataCallListChanged. " + e);
}
break;
+ case DATA_SERVICE_REQUEST_START_HANDOVER:
+ if (serviceProvider == null) break;
+ BeginCancelHandoverRequest bReq = (BeginCancelHandoverRequest) message.obj;
+ serviceProvider.startHandover(bReq.cid,
+ (bReq.callback != null)
+ ? new DataServiceCallback(bReq.callback) : null);
+ break;
+ case DATA_SERVICE_REQUEST_CANCEL_HANDOVER:
+ if (serviceProvider == null) break;
+ BeginCancelHandoverRequest cReq = (BeginCancelHandoverRequest) message.obj;
+ serviceProvider.cancelHandover(cReq.cid,
+ (cReq.callback != null)
+ ? new DataServiceCallback(cReq.callback) : null);
+ break;
}
}
}
@@ -506,11 +612,11 @@ public abstract class DataService extends Service {
@Override
public void setupDataCall(int slotIndex, int accessNetworkType, DataProfile dataProfile,
- boolean isRoaming, boolean allowRoaming, int reason,
- LinkProperties linkProperties, IDataServiceCallback callback) {
+ boolean isRoaming, boolean allowRoaming, int reason,
+ LinkProperties linkProperties, int pduSessionId, IDataServiceCallback callback) {
mHandler.obtainMessage(DATA_SERVICE_REQUEST_SETUP_DATA_CALL, slotIndex, 0,
new SetupDataCallRequest(accessNetworkType, dataProfile, isRoaming,
- allowRoaming, reason, linkProperties, callback))
+ allowRoaming, reason, linkProperties, pduSessionId, callback))
.sendToTarget();
}
@@ -566,6 +672,29 @@ public abstract class DataService extends Service {
mHandler.obtainMessage(DATA_SERVICE_REQUEST_UNREGISTER_DATA_CALL_LIST_CHANGED,
slotIndex, 0, callback).sendToTarget();
}
+
+ @Override
+ public void startHandover(int slotIndex, int cid, IDataServiceCallback callback) {
+ if (callback == null) {
+ loge("startHandover: callback is null");
+ return;
+ }
+ BeginCancelHandoverRequest req = new BeginCancelHandoverRequest(cid, callback);
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_START_HANDOVER,
+ slotIndex, 0, req)
+ .sendToTarget();
+ }
+
+ @Override
+ public void cancelHandover(int slotIndex, int cid, IDataServiceCallback callback) {
+ if (callback == null) {
+ loge("cancelHandover: callback is null");
+ return;
+ }
+ BeginCancelHandoverRequest req = new BeginCancelHandoverRequest(cid, callback);
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_CANCEL_HANDOVER,
+ slotIndex, 0, req).sendToTarget();
+ }
}
private void log(String s) {
diff --git a/telephony/java/android/telephony/data/DataServiceCallback.java b/telephony/java/android/telephony/data/DataServiceCallback.java
index 72b68e4645c9..eef0e017f998 100644
--- a/telephony/java/android/telephony/data/DataServiceCallback.java
+++ b/telephony/java/android/telephony/data/DataServiceCallback.java
@@ -79,7 +79,7 @@ public class DataServiceCallback {
* @param response Setup data call response.
*/
public void onSetupDataCallComplete(@ResultCode int result,
- @Nullable DataCallResponse response) {
+ @Nullable DataCallResponse response) {
if (mCallback != null) {
try {
if (DBG) Rlog.d(TAG, "onSetupDataCallComplete");
@@ -156,7 +156,7 @@ public class DataServiceCallback {
* set it to an empty list.
*/
public void onRequestDataCallListComplete(@ResultCode int result,
- @NonNull List<DataCallResponse> dataCallList) {
+ @NonNull List<DataCallResponse> dataCallList) {
if (mCallback != null) {
try {
mCallback.onRequestDataCallListComplete(result, dataCallList);
@@ -186,4 +186,66 @@ public class DataServiceCallback {
Rlog.e(TAG, "onDataCallListChanged: callback is null!");
}
}
+
+ /**
+ * Called to indicate result for the request {@link DataService#startHandover}.
+ *
+ * @param result The result code. Must be one of the {@link ResultCode}
+ */
+ public void onHandoverStarted(@ResultCode int result) {
+ if (mCallback != null) {
+ try {
+ if (DBG) Rlog.d(TAG, "onHandoverStarted");
+ mCallback.onHandoverStarted(result);
+ } catch (RemoteException e) {
+ Rlog.e(TAG, "Failed to onHandoverStarted on the remote");
+ }
+ } else {
+ Rlog.e(TAG, "onHandoverStarted: callback is null!");
+ }
+ }
+
+ /**
+ * Called to indicate result for the request {@link DataService#cancelHandover}.
+ *
+ * @param result The result code. Must be one of the {@link ResultCode}
+ */
+ public void onHandoverCancelled(@ResultCode int result) {
+ if (mCallback != null) {
+ try {
+ if (DBG) Rlog.d(TAG, "onHandoverCancelled");
+ mCallback.onHandoverCancelled(result);
+ } catch (RemoteException e) {
+ Rlog.e(TAG, "Failed to onHandoverCancelled on the remote");
+ }
+ } else {
+ Rlog.e(TAG, "onHandoverCancelled: callback is null!");
+ }
+ }
+
+ /**
+ * Get the result code as a string
+ *
+ * @param resultCode The result code. Must be one of the {@link ResultCode}
+ * @return the string representation
+ *
+ * @hide
+ */
+ @NonNull
+ public static String resultCodeToString(@DataServiceCallback.ResultCode int resultCode) {
+ switch(resultCode) {
+ case RESULT_SUCCESS:
+ return "RESULT_SUCCESS";
+ case RESULT_ERROR_UNSUPPORTED:
+ return "RESULT_ERROR_UNSUPPORTED";
+ case RESULT_ERROR_INVALID_ARG:
+ return "RESULT_ERROR_INVALID_ARG";
+ case RESULT_ERROR_BUSY:
+ return "RESULT_ERROR_BUSY";
+ case RESULT_ERROR_ILLEGAL_STATE:
+ return "RESULT_ERROR_ILLEGAL_STATE";
+ default:
+ return "Missing case for result code=" + resultCode;
+ }
+ }
}
diff --git a/telephony/java/android/telephony/data/IDataService.aidl b/telephony/java/android/telephony/data/IDataService.aidl
index 9c74dcccec54..33226feb0e35 100644
--- a/telephony/java/android/telephony/data/IDataService.aidl
+++ b/telephony/java/android/telephony/data/IDataService.aidl
@@ -29,7 +29,7 @@ oneway interface IDataService
void removeDataServiceProvider(int slotId);
void setupDataCall(int slotId, int accessNetwork, in DataProfile dataProfile, boolean isRoaming,
boolean allowRoaming, int reason, in LinkProperties linkProperties,
- IDataServiceCallback callback);
+ int pduSessionId, IDataServiceCallback callback);
void deactivateDataCall(int slotId, int cid, int reason, IDataServiceCallback callback);
void setInitialAttachApn(int slotId, in DataProfile dataProfile, boolean isRoaming,
IDataServiceCallback callback);
@@ -38,4 +38,6 @@ oneway interface IDataService
void requestDataCallList(int slotId, IDataServiceCallback callback);
void registerForDataCallListChanged(int slotId, IDataServiceCallback callback);
void unregisterForDataCallListChanged(int slotId, IDataServiceCallback callback);
+ void startHandover(int slotId, int cid, IDataServiceCallback callback);
+ void cancelHandover(int slotId, int cid, IDataServiceCallback callback);
}
diff --git a/telephony/java/android/telephony/data/IDataServiceCallback.aidl b/telephony/java/android/telephony/data/IDataServiceCallback.aidl
index cec757d23988..d296e7b19be8 100644
--- a/telephony/java/android/telephony/data/IDataServiceCallback.aidl
+++ b/telephony/java/android/telephony/data/IDataServiceCallback.aidl
@@ -30,4 +30,6 @@ oneway interface IDataServiceCallback
void onSetDataProfileComplete(int result);
void onRequestDataCallListComplete(int result, in List<DataCallResponse> dataCallList);
void onDataCallListChanged(in List<DataCallResponse> dataCallList);
+ void onHandoverStarted(int result);
+ void onHandoverCancelled(int result);
}
diff --git a/telephony/java/android/telephony/ims/DelegateRequest.java b/telephony/java/android/telephony/ims/DelegateRequest.java
index f384901d58bd..73d0840177dd 100644
--- a/telephony/java/android/telephony/ims/DelegateRequest.java
+++ b/telephony/java/android/telephony/ims/DelegateRequest.java
@@ -98,4 +98,9 @@ public final class DelegateRequest implements Parcelable {
public int hashCode() {
return Objects.hash(mFeatureTags);
}
+
+ @Override
+ public String toString() {
+ return "DelegateRequest{mFeatureTags=" + mFeatureTags + '}';
+ }
}
diff --git a/telephony/java/android/telephony/ims/SipDelegateManager.java b/telephony/java/android/telephony/ims/SipDelegateManager.java
index 337b7d49323d..190a792b5a9a 100644
--- a/telephony/java/android/telephony/ims/SipDelegateManager.java
+++ b/telephony/java/android/telephony/ims/SipDelegateManager.java
@@ -236,17 +236,17 @@ public class SipDelegateManager {
public static final int SIP_DELEGATE_DESTROY_REASON_REQUESTED_BY_APP = 2;
/**
- * The SipDelegate has closed because the IMS service does not support the creation of
- * SipDelegates.
+ * The SipDelegate has been closed due to the user disabling RCS.
* @hide
*/
- public static final int SIP_DELEGATE_DESTROY_REASON_SERVICE_NOT_SUPPORTED = 3;
+ public static final int SIP_DELEGATE_DESTROY_REASON_USER_DISABLED_RCS = 3;
/**
- * The SipDelegate has been closed due to the user disabling RCS.
+ * The SipDelegate has been closed due to the subscription associated with this delegate being
+ * torn down.
* @hide
*/
- public static final int SIP_DELEGATE_DESTROY_REASON_USER_DISABLED_RCS = 4;
+ public static final int SIP_DELEGATE_DESTROY_REASON_SUBSCRIPTION_TORN_DOWN = 4;
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@@ -254,8 +254,8 @@ public class SipDelegateManager {
SIP_DELEGATE_DESTROY_REASON_UNKNOWN,
SIP_DELEGATE_DESTROY_REASON_SERVICE_DEAD,
SIP_DELEGATE_DESTROY_REASON_REQUESTED_BY_APP,
- SIP_DELEGATE_DESTROY_REASON_SERVICE_NOT_SUPPORTED,
- SIP_DELEGATE_DESTROY_REASON_USER_DISABLED_RCS
+ SIP_DELEGATE_DESTROY_REASON_USER_DISABLED_RCS,
+ SIP_DELEGATE_DESTROY_REASON_SUBSCRIPTION_TORN_DOWN
})
public @interface SipDelegateDestroyReason {}
@@ -316,6 +316,9 @@ public class SipDelegateManager {
* always be available to handle incoming messages. One mechanism that can be used for this is
* the {@link android.service.carrier.CarrierMessagingClientService}, which the framework keeps
* a persistent binding to when the app is the default SMS application.
+ * <p>
+ * Note: the ability to create SipDelegates is only available applications running as the
+ * primary user.
* @param request The parameters that are associated with the SipDelegate creation request that
* will be used to create the SipDelegate connection.
* @param executor The executor that will be used to call the callbacks associated with this
@@ -346,8 +349,8 @@ public class SipDelegateManager {
throw new ImsException("Telephony server is down",
ImsException.CODE_ERROR_SERVICE_UNAVAILABLE);
}
- controller.createSipDelegate(mSubId, request, wrapper.getStateCallbackBinder(),
- wrapper.getMessageCallbackBinder());
+ controller.createSipDelegate(mSubId, request, mContext.getOpPackageName(),
+ wrapper.getStateCallbackBinder(), wrapper.getMessageCallbackBinder());
} catch (ServiceSpecificException e) {
throw new ImsException(e.getMessage(), e.errorCode);
} catch (RemoteException e) {
diff --git a/telephony/java/android/telephony/ims/aidl/IImsRcsController.aidl b/telephony/java/android/telephony/ims/aidl/IImsRcsController.aidl
index f218e35a5a9b..c6d9a8629556 100644
--- a/telephony/java/android/telephony/ims/aidl/IImsRcsController.aidl
+++ b/telephony/java/android/telephony/ims/aidl/IImsRcsController.aidl
@@ -63,7 +63,7 @@ interface IImsRcsController {
// SipDelegateManager
boolean isSipDelegateSupported(int subId);
- void createSipDelegate(int subId, in DelegateRequest request,
+ void createSipDelegate(int subId, in DelegateRequest request, String packageName,
ISipDelegateConnectionStateCallback delegateState,
ISipDelegateMessageCallback delegateMessage);
void destroySipDelegate(int subId, ISipDelegate connection, int reason);
diff --git a/telephony/java/android/telephony/ims/aidl/ISipTransport.aidl b/telephony/java/android/telephony/ims/aidl/ISipTransport.aidl
index cd888391c584..3438587b7348 100644
--- a/telephony/java/android/telephony/ims/aidl/ISipTransport.aidl
+++ b/telephony/java/android/telephony/ims/aidl/ISipTransport.aidl
@@ -26,7 +26,7 @@ import android.telephony.ims.aidl.ISipDelegateStateCallback;
* {@hide}
*/
oneway interface ISipTransport {
- void createSipDelegate(in DelegateRequest request, ISipDelegateStateCallback dc,
+ void createSipDelegate(int subId, in DelegateRequest request, ISipDelegateStateCallback dc,
ISipDelegateMessageCallback mc);
void destroySipDelegate(ISipDelegate delegate, int reason);
}
diff --git a/telephony/java/android/telephony/ims/stub/SipTransportImplBase.java b/telephony/java/android/telephony/ims/stub/SipTransportImplBase.java
index b48f6317e413..93d438cf7f4d 100644
--- a/telephony/java/android/telephony/ims/stub/SipTransportImplBase.java
+++ b/telephony/java/android/telephony/ims/stub/SipTransportImplBase.java
@@ -58,11 +58,11 @@ public class SipTransportImplBase {
private final ISipTransport.Stub mSipTransportImpl = new ISipTransport.Stub() {
@Override
- public void createSipDelegate(DelegateRequest request, ISipDelegateStateCallback dc,
- ISipDelegateMessageCallback mc) {
+ public void createSipDelegate(int subId, DelegateRequest request,
+ ISipDelegateStateCallback dc, ISipDelegateMessageCallback mc) {
final long token = Binder.clearCallingIdentity();
try {
- mBinderExecutor.execute(() -> createSipDelegateInternal(request, dc, mc));
+ mBinderExecutor.execute(() -> createSipDelegateInternal(subId, request, dc, mc));
} finally {
Binder.restoreCallingIdentity(token);
}
@@ -105,6 +105,7 @@ public class SipTransportImplBase {
* This method will be called on the Executor specified in
* {@link SipTransportImplBase#SipTransportImplBase(Executor)}.
*
+ * @param subscriptionId The subscription ID associated with the requested {@link SipDelegate}.
* @param request A SIP delegate request containing the parameters that the remote RCS
* application wishes to use.
* @param dc A callback back to the remote application to be used to communicate state callbacks
@@ -113,9 +114,9 @@ public class SipTransportImplBase {
* remote application and acknowledge the sending of outgoing SIP messages.
* @hide
*/
- public void createSipDelegate(@NonNull DelegateRequest request,
+ public void createSipDelegate(int subscriptionId, @NonNull DelegateRequest request,
@NonNull DelegateStateCallback dc, @NonNull DelegateMessageCallback mc) {
- throw new UnsupportedOperationException("destroySipDelegate not implemented!");
+ throw new UnsupportedOperationException("createSipDelegate not implemented!");
}
/**
@@ -136,11 +137,11 @@ public class SipTransportImplBase {
throw new UnsupportedOperationException("destroySipDelegate not implemented!");
}
- private void createSipDelegateInternal(DelegateRequest r, ISipDelegateStateCallback cb,
- ISipDelegateMessageCallback mc) {
+ private void createSipDelegateInternal(int subId, DelegateRequest r,
+ ISipDelegateStateCallback cb, ISipDelegateMessageCallback mc) {
SipDelegateAidlWrapper wrapper = new SipDelegateAidlWrapper(mBinderExecutor, cb, mc);
mDelegates.add(wrapper);
- createSipDelegate(r, wrapper, wrapper);
+ createSipDelegate(subId, r, wrapper, wrapper);
}
private void destroySipDelegateInternal(ISipDelegate d, int reason) {
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index d16cb16a290c..4895fffa5849 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -1799,6 +1799,14 @@ interface ITelephony {
boolean setCdmaRoamingMode(int subId, int mode);
/**
+ * Gets the subscription mode for the CDMA phone with the subscription id {@code subId}.
+ *
+ * @param the subscription id.
+ * @return the subscription mode for CDMA phone.
+ */
+ int getCdmaSubscriptionMode(int subId);
+
+ /**
* Sets the subscription mode for CDMA phone with the subscription {@code subId} to the given
* subscription mode {@code mode}.
*
diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java
index 91607462c29f..9d4072f1cf1c 100644
--- a/telephony/java/com/android/internal/telephony/RILConstants.java
+++ b/telephony/java/com/android/internal/telephony/RILConstants.java
@@ -517,7 +517,7 @@ public interface RILConstants {
int RIL_REQUEST_IS_NR_DUAL_CONNECTIVITY_ENABLED = 214;
int RIL_REQUEST_ALLOCATE_PDU_SESSION_ID = 215;
int RIL_REQUEST_RELEASE_PDU_SESSION_ID = 216;
- int RIL_REQUEST_BEGIN_HANDOVER = 217;
+ int RIL_REQUEST_START_HANDOVER = 217;
int RIL_REQUEST_CANCEL_HANDOVER = 218;
/* Responses begin */
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index 6293befb2c6a..408dd0a83554 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -259,7 +259,10 @@ import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
import org.mockito.stubbing.Answer;
+import java.io.FileDescriptor;
import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.net.DatagramSocket;
import java.net.Inet4Address;
import java.net.Inet6Address;
@@ -7585,4 +7588,39 @@ public class ConnectivityServiceTest {
mCm.unregisterNetworkCallback(networkCallback);
}
+
+ @Test
+ public void testDumpDoesNotCrash() {
+ StringWriter stringWriter = new StringWriter();
+
+ mService.dump(new FileDescriptor(), new PrintWriter(stringWriter), new String[0]);
+
+ assertFalse(stringWriter.toString().isEmpty());
+ }
+
+ @Test
+ public void testRequestsSortedByIdSortsCorrectly() {
+ final TestNetworkCallback genericNetworkCallback = new TestNetworkCallback();
+ final TestNetworkCallback wifiNetworkCallback = new TestNetworkCallback();
+ final TestNetworkCallback cellNetworkCallback = new TestNetworkCallback();
+ final NetworkRequest genericRequest = new NetworkRequest.Builder()
+ .clearCapabilities().build();
+ final NetworkRequest wifiRequest = new NetworkRequest.Builder()
+ .addTransportType(TRANSPORT_WIFI).build();
+ final NetworkRequest cellRequest = new NetworkRequest.Builder()
+ .addTransportType(TRANSPORT_CELLULAR).build();
+ mCm.registerNetworkCallback(genericRequest, genericNetworkCallback);
+ mCm.registerNetworkCallback(wifiRequest, wifiNetworkCallback);
+ mCm.registerNetworkCallback(cellRequest, cellNetworkCallback);
+
+ ConnectivityService.NetworkRequestInfo[] nriOutput = mService.requestsSortedById();
+
+ assertTrue(nriOutput.length > 1);
+ for (int i = 0; i < nriOutput.length - 1; i++) {
+ boolean isRequestIdInOrder =
+ nriOutput[i].mRequests.get(0).requestId
+ < nriOutput[i + 1].mRequests.get(0).requestId;
+ assertTrue(isRequestIdInOrder);
+ }
+ }
}
diff --git a/wifi/jarjar-rules.txt b/wifi/jarjar-rules.txt
index ff06a180b8c1..75b5e728eb0d 100644
--- a/wifi/jarjar-rules.txt
+++ b/wifi/jarjar-rules.txt
@@ -89,8 +89,6 @@ rule android.util.BackupUtils* com.android.wifi.x.@0
rule android.util.LocalLog* com.android.wifi.x.@0
rule android.util.Rational* com.android.wifi.x.@0
-rule android.os.BasicShellCommandHandler* com.android.wifi.x.@0
-
# Use our statically linked bouncy castle library
rule org.bouncycastle.** com.android.wifi.x.@0
# Use our statically linked protobuf library