summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp2
-rw-r--r--config/hiddenapi-greylist-max-p.txt2
-rw-r--r--core/java/android/app/SystemServiceRegistry.java10
-rw-r--r--core/java/android/content/Context.java4
-rw-r--r--telephony/java/android/telephony/SubscriptionManager.java24
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java6
-rw-r--r--telephony/java/android/telephony/ims/RcsControllerCall.java20
-rw-r--r--telephony/java/android/telephony/ims/RcsManager.java43
-rw-r--r--telephony/java/android/telephony/ims/RcsMessageManager.java (renamed from telephony/java/android/telephony/ims/RcsMessageStore.java)12
-rw-r--r--telephony/java/android/telephony/ims/aidl/IRcsMessage.aidl (renamed from telephony/java/android/telephony/ims/aidl/IRcs.aidl)2
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl42
-rw-r--r--tools/preload2/Android.bp50
-rw-r--r--tools/preload2/Android.mk30
13 files changed, 126 insertions, 121 deletions
diff --git a/Android.bp b/Android.bp
index 17e31e04506f..9cc17ead3491 100644
--- a/Android.bp
+++ b/Android.bp
@@ -507,7 +507,7 @@ java_defaults {
"telephony/java/android/telephony/ims/aidl/IImsServiceController.aidl",
"telephony/java/android/telephony/ims/aidl/IImsServiceControllerListener.aidl",
"telephony/java/android/telephony/ims/aidl/IImsSmsListener.aidl",
- "telephony/java/android/telephony/ims/aidl/IRcs.aidl",
+ "telephony/java/android/telephony/ims/aidl/IRcsMessage.aidl",
"telephony/java/android/telephony/mbms/IMbmsDownloadSessionCallback.aidl",
"telephony/java/android/telephony/mbms/IMbmsStreamingSessionCallback.aidl",
"telephony/java/android/telephony/mbms/IMbmsGroupCallSessionCallback.aidl",
diff --git a/config/hiddenapi-greylist-max-p.txt b/config/hiddenapi-greylist-max-p.txt
index f201063ef12e..a32fbec768e3 100644
--- a/config/hiddenapi-greylist-max-p.txt
+++ b/config/hiddenapi-greylist-max-p.txt
@@ -68,6 +68,8 @@ Lcom/android/internal/R$styleable;->MenuView:[I
Lcom/android/internal/R$styleable;->Searchable:[I
Lcom/android/internal/R$styleable;->SearchableActionKey:[I
Lcom/android/internal/telephony/IPhoneSubInfo$Stub;-><init>()V
+Lcom/android/internal/telephony/ITelephony;->getDataActivity()I
+Lcom/android/internal/telephony/ITelephony;->getDataState()I
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCallForwardingChanged(Z)V
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCellLocation(Landroid/os/Bundle;)V
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyDataActivity(I)V
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index b19cd1c1ffb3..94aa4811b846 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -149,7 +149,7 @@ import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.euicc.EuiccCardManager;
import android.telephony.euicc.EuiccManager;
-import android.telephony.ims.RcsManager;
+import android.telephony.ims.RcsMessageManager;
import android.util.ArrayMap;
import android.util.Log;
import android.view.ContextThemeWrapper;
@@ -552,11 +552,11 @@ final class SystemServiceRegistry {
return new SubscriptionManager(ctx.getOuterContext());
}});
- registerService(Context.TELEPHONY_RCS_SERVICE, RcsManager.class,
- new CachedServiceFetcher<RcsManager>() {
+ registerService(Context.TELEPHONY_RCS_MESSAGE_SERVICE, RcsMessageManager.class,
+ new CachedServiceFetcher<RcsMessageManager>() {
@Override
- public RcsManager createService(ContextImpl ctx) {
- return new RcsManager(ctx.getOuterContext());
+ public RcsMessageManager createService(ContextImpl ctx) {
+ return new RcsMessageManager(ctx.getOuterContext());
}
});
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 87973d8de54d..99ff53dcb904 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -4290,10 +4290,10 @@ public abstract class Context {
/**
* Use with {@link #getSystemService(String)} to retrieve an
- * {@link android.telephony.ims.RcsManager}.
+ * {@link android.telephony.ims.RcsMessageManager}.
* @hide
*/
- public static final String TELEPHONY_RCS_SERVICE = "ircs";
+ public static final String TELEPHONY_RCS_MESSAGE_SERVICE = "ircsmessage";
/**
* Use with {@link #getSystemService(String)} to retrieve an
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 6557886d3a5c..1c048571f12f 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -3078,18 +3078,10 @@ public class SubscriptionManager {
}
/**
- * Returns whether the subscription is enabled or not. This is different from activated
- * or deactivated for two aspects. 1) For when user disables a physical subscription, we
- * actually disable the modem because we can't switch off the subscription. 2) For eSIM,
- * user may enable one subscription but the system may activate another temporarily. In this
- * case, user enabled one is different from current active one.
-
- * @param subscriptionId The subscription it asks about.
- * @return whether it's enabled or not. {@code true} if user set this subscription enabled
- * earlier, or user never set subscription enable / disable on this slot explicitly, and
- * this subscription is currently active. Otherwise, it returns {@code false}.
- *
+ * DO NOT USE.
+ * This API is designed for features that are not finished at this point. Do not call this API.
* @hide
+ * TODO b/135547512: further clean up
*/
@SystemApi
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@@ -3107,14 +3099,10 @@ public class SubscriptionManager {
}
/**
- * Get which subscription is enabled on this slot. See {@link #isSubscriptionEnabled(int)}
- * for more details.
- *
- * @param slotIndex which slot it asks about.
- * @return which subscription is enabled on this slot. If there's no enabled subscription
- * in this slot, it will return {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}.
- *
+ * DO NOT USE.
+ * This API is designed for features that are not finished at this point. Do not call this API.
* @hide
+ * TODO b/135547512: further clean up
*/
@SystemApi
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 03a5c74be766..fe812151489b 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -4777,7 +4777,8 @@ public class TelephonyManager {
ITelephony telephony = getITelephony();
if (telephony == null)
return DATA_ACTIVITY_NONE;
- return telephony.getDataActivity();
+ return telephony.getDataActivityForSubId(
+ getSubId(SubscriptionManager.getActiveDataSubscriptionId()));
} catch (RemoteException ex) {
// the phone process is restarting.
return DATA_ACTIVITY_NONE;
@@ -4825,7 +4826,8 @@ public class TelephonyManager {
ITelephony telephony = getITelephony();
if (telephony == null)
return DATA_DISCONNECTED;
- return telephony.getDataState();
+ return telephony.getDataStateForSubId(
+ getSubId(SubscriptionManager.getActiveDataSubscriptionId()));
} catch (RemoteException ex) {
// the phone process is restarting.
return DATA_DISCONNECTED;
diff --git a/telephony/java/android/telephony/ims/RcsControllerCall.java b/telephony/java/android/telephony/ims/RcsControllerCall.java
index a2d68ad0cdb0..ce03c3c799bb 100644
--- a/telephony/java/android/telephony/ims/RcsControllerCall.java
+++ b/telephony/java/android/telephony/ims/RcsControllerCall.java
@@ -19,10 +19,11 @@ package android.telephony.ims;
import android.content.Context;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.telephony.ims.aidl.IRcs;
+import android.telephony.ims.aidl.IRcsMessage;
/**
- * A wrapper class around RPC calls that {@link RcsMessageStore} APIs to minimize boilerplate code.
+ * A wrapper class around RPC calls that {@link RcsMessageManager} APIs to minimize boilerplate
+ * code.
*
* @hide - not meant for public use
*/
@@ -34,13 +35,14 @@ class RcsControllerCall {
}
<R> R call(RcsServiceCall<R> serviceCall) throws RcsMessageStoreException {
- IRcs iRcs = IRcs.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_RCS_SERVICE));
- if (iRcs == null) {
+ IRcsMessage iRcsMessage = IRcsMessage.Stub.asInterface(ServiceManager.getService(
+ Context.TELEPHONY_RCS_MESSAGE_SERVICE));
+ if (iRcsMessage == null) {
throw new RcsMessageStoreException("Could not connect to RCS storage service");
}
try {
- return serviceCall.methodOnIRcs(iRcs, mContext.getOpPackageName());
+ return serviceCall.methodOnIRcs(iRcsMessage, mContext.getOpPackageName());
} catch (RemoteException exception) {
throw new RcsMessageStoreException(exception.getMessage());
}
@@ -48,17 +50,17 @@ class RcsControllerCall {
void callWithNoReturn(RcsServiceCallWithNoReturn serviceCall)
throws RcsMessageStoreException {
- call((iRcs, callingPackage) -> {
- serviceCall.methodOnIRcs(iRcs, callingPackage);
+ call((iRcsMessage, callingPackage) -> {
+ serviceCall.methodOnIRcs(iRcsMessage, callingPackage);
return null;
});
}
interface RcsServiceCall<R> {
- R methodOnIRcs(IRcs iRcs, String callingPackage) throws RemoteException;
+ R methodOnIRcs(IRcsMessage iRcs, String callingPackage) throws RemoteException;
}
interface RcsServiceCallWithNoReturn {
- void methodOnIRcs(IRcs iRcs, String callingPackage) throws RemoteException;
+ void methodOnIRcs(IRcsMessage iRcs, String callingPackage) throws RemoteException;
}
}
diff --git a/telephony/java/android/telephony/ims/RcsManager.java b/telephony/java/android/telephony/ims/RcsManager.java
deleted file mode 100644
index 0d6ca3cc58e1..000000000000
--- a/telephony/java/android/telephony/ims/RcsManager.java
+++ /dev/null
@@ -1,43 +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.telephony.ims;
-
-import android.annotation.SystemService;
-import android.content.Context;
-
-/**
- * The manager class for RCS related utilities.
- *
- * @hide
- */
-@SystemService(Context.TELEPHONY_RCS_SERVICE)
-public class RcsManager {
- private final RcsMessageStore mRcsMessageStore;
-
- /**
- * @hide
- */
- public RcsManager(Context context) {
- mRcsMessageStore = new RcsMessageStore(context);
- }
-
- /**
- * Returns an instance of {@link RcsMessageStore}
- */
- public RcsMessageStore getRcsMessageStore() {
- return mRcsMessageStore;
- }
-}
diff --git a/telephony/java/android/telephony/ims/RcsMessageStore.java b/telephony/java/android/telephony/ims/RcsMessageManager.java
index d1127984f126..a1c7c0fefab2 100644
--- a/telephony/java/android/telephony/ims/RcsMessageStore.java
+++ b/telephony/java/android/telephony/ims/RcsMessageManager.java
@@ -18,6 +18,7 @@ package android.telephony.ims;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SystemService;
import android.annotation.WorkerThread;
import android.content.Context;
import android.net.Uri;
@@ -25,15 +26,20 @@ import android.net.Uri;
import java.util.List;
/**
- * RcsMessageStore is the application interface to RcsProvider and provides access methods to
+ * RcsMessageManager is the application interface to RcsProvider and provides access methods to
* RCS related database tables.
*
* @hide
*/
-public class RcsMessageStore {
+@SystemService(Context.TELEPHONY_RCS_MESSAGE_SERVICE)
+public class RcsMessageManager {
RcsControllerCall mRcsControllerCall;
- RcsMessageStore(Context context) {
+ /**
+ * Use {@link Context#getSystemService(String)} to get an instance of this service.
+ * @hide
+ */
+ public RcsMessageManager(Context context) {
mRcsControllerCall = new RcsControllerCall(context);
}
diff --git a/telephony/java/android/telephony/ims/aidl/IRcs.aidl b/telephony/java/android/telephony/ims/aidl/IRcsMessage.aidl
index 9ee15daf67b9..0ae6303f024e 100644
--- a/telephony/java/android/telephony/ims/aidl/IRcs.aidl
+++ b/telephony/java/android/telephony/ims/aidl/IRcsMessage.aidl
@@ -35,7 +35,7 @@ import android.telephony.ims.RcsThreadQueryResultParcelable;
* RPC definition between RCS storage APIs and phone process.
* {@hide}
*/
-interface IRcs {
+interface IRcsMessage {
/////////////////////////
// RcsMessageStore APIs
/////////////////////////
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 1aba95bf5e5a..da80774e8ed0 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -308,18 +308,46 @@ interface ITelephony {
*/
List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg);
- @UnsupportedAppUsage
- int getCallState();
+ @UnsupportedAppUsage
+ int getCallState();
/**
* Returns the call state for a slot.
*/
- int getCallStateForSlot(int slotIndex);
+ int getCallStateForSlot(int slotIndex);
+
+ /**
+ * Replaced by getDataActivityForSubId.
+ */
+ int getDataActivity();
+
+ /**
+ * Returns a constant indicating the type of activity on a data connection
+ * (cellular).
+ *
+ * @see #DATA_ACTIVITY_NONE
+ * @see #DATA_ACTIVITY_IN
+ * @see #DATA_ACTIVITY_OUT
+ * @see #DATA_ACTIVITY_INOUT
+ * @see #DATA_ACTIVITY_DORMANT
+ */
+ int getDataActivityForSubId(int subId);
+
+ /**
+ * Replaced by getDataStateForSubId.
+ */
+ int getDataState();
- @UnsupportedAppUsage
- int getDataActivity();
- @UnsupportedAppUsage
- int getDataState();
+ /**
+ * Returns a constant indicating the current data connection state
+ * (cellular).
+ *
+ * @see #DATA_DISCONNECTED
+ * @see #DATA_CONNECTING
+ * @see #DATA_CONNECTED
+ * @see #DATA_SUSPENDED
+ */
+ int getDataStateForSubId(int subId);
/**
* Returns the current active phone type as integer.
diff --git a/tools/preload2/Android.bp b/tools/preload2/Android.bp
new file mode 100644
index 000000000000..5809421da3e8
--- /dev/null
+++ b/tools/preload2/Android.bp
@@ -0,0 +1,50 @@
+// Copyright (C) 2015 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.
+
+java_library_host {
+ name: "preload2",
+
+ srcs: ["src/**/*.java"],
+
+ // To connect to devices (and take hprof dumps).
+ static_libs: [
+ "ddmlib-prebuilt",
+ "tools-common-prebuilt",
+
+ // To process hprof dumps.
+ "perflib-prebuilt",
+
+ "trove-prebuilt",
+ "guavalib",
+
+ // For JDWP access we use the framework in the JDWP tests from Apache Harmony, for
+ // convenience (and to not depend on internal JDK APIs).
+ "apache-harmony-jdwp-tests",
+ "junit",
+ ],
+
+ // Copy to build artifacts
+ dist: {
+ targets: [
+ "dist_files",
+ ],
+ },
+}
+
+// Copy the preload-tool shell script to the host's bin directory.
+sh_binary_host {
+ name: "preload-tool",
+ src: "preload-tool",
+ required: ["preload2"],
+}
diff --git a/tools/preload2/Android.mk b/tools/preload2/Android.mk
deleted file mode 100644
index d3ee1d370855..000000000000
--- a/tools/preload2/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-# To connect to devices (and take hprof dumps).
-LOCAL_STATIC_JAVA_LIBRARIES := ddmlib-prebuilt tools-common-prebuilt
-
-# To process hprof dumps.
-LOCAL_STATIC_JAVA_LIBRARIES += perflib-prebuilt trove-prebuilt guavalib
-
-# For JDWP access we use the framework in the JDWP tests from Apache Harmony, for
-# convenience (and to not depend on internal JDK APIs).
-LOCAL_STATIC_JAVA_LIBRARIES += apache-harmony-jdwp-tests-host junit-host
-
-LOCAL_MODULE:= preload2
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-# Copy to build artifacts
-$(call dist-for-goals,dist_files,$(LOCAL_BUILT_MODULE):$(LOCAL_MODULE).jar)
-
-# Copy the preload-tool shell script to the host's bin directory.
-include $(CLEAR_VARS)
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE := preload-tool
-LOCAL_SRC_FILES := preload-tool
-LOCAL_REQUIRED_MODULES := preload2
-include $(BUILD_PREBUILT)