summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Brad Ebinger <breadley@google.com> 2019-07-12 14:53:26 -0700
committer android-build-merger <android-build-merger@google.com> 2019-07-12 14:53:26 -0700
commit53f6c34039ae3ccf582d0ac108769bb476aa358a (patch)
tree2f87ae2f4666bc9d1374dd3d60e50a16cef7bcc4
parente02370196f245ca4c1a73836f1426db2aef0959d (diff)
parentbac258f22e9de343954d44ca7be323f5b480d379 (diff)
Merge "Make RcsMessageStore a top level API"
am: bac258f22e Change-Id: If235ead8a75dc080e1e129d83bf7f24c3c996d8c
-rw-r--r--Android.bp2
-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/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
7 files changed, 29 insertions, 64 deletions
diff --git a/Android.bp b/Android.bp
index 26c00152c650..2d88580327bf 100644
--- a/Android.bp
+++ b/Android.bp
@@ -559,7 +559,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/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index d32b6b516a7d..cfe2cf09ae19 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -172,7 +172,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;
@@ -614,11 +614,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 341fc26e2b96..7a013f176691 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -4665,10 +4665,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/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
/////////////////////////