From 0c081a10ad7145c93826121da03d9906b962e1df Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Thu, 11 Oct 2018 14:43:09 -0700 Subject: [PATCH 1/3] Initial RCS CL. This CL adds RcsManager with a dummy API. Test: build Bug: 109759350 Merged-in: Ib10a38fac9182ca010d3895431e419f5c1958d59 Change-Id: Ib10a38fac9182ca010d3895431e419f5c1958d59 (cherry picked from commit 7d496bc0308f202ffca4f5e4985421c329795cb4) --- Android.bp | 1 + .../java/android/telephony/RcsManager.java | 52 +++++++++++++++++++ .../com/android/internal/telephony/IRcs.aidl | 21 ++++++++ 3 files changed, 74 insertions(+) create mode 100644 telephony/java/android/telephony/RcsManager.java create mode 100644 telephony/java/com/android/internal/telephony/IRcs.aidl diff --git a/Android.bp b/Android.bp index 170e22e1cbdef..f49e4e5eb4965 100644 --- a/Android.bp +++ b/Android.bp @@ -546,6 +546,7 @@ java_defaults { "telephony/java/com/android/internal/telephony/IOnSubscriptionsChangedListener.aidl", "telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl", "telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl", + "telephony/java/com/android/internal/telephony/IRcs.aidl", "telephony/java/com/android/internal/telephony/ISms.aidl", "telephony/java/com/android/internal/telephony/ISub.aidl", "telephony/java/com/android/internal/telephony/IAns.aidl", diff --git a/telephony/java/android/telephony/RcsManager.java b/telephony/java/android/telephony/RcsManager.java new file mode 100644 index 0000000000000..00ce03a1f6684 --- /dev/null +++ b/telephony/java/android/telephony/RcsManager.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2018 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; + +import android.os.RemoteException; +import android.os.ServiceManager; + +import com.android.internal.telephony.IRcs; + +/** + * RcsManager is the application interface to RcsProvider and provides access methods to + * RCS related database tables. + * @hide - TODO make this public + */ +public class RcsManager { + private static final String TAG = "RcsManager"; + private static final boolean VDBG = false; + + /** + * Delete the RcsThread identified by the given threadId. + * @param threadId threadId of the thread to be deleted. + */ + public void deleteThread(int threadId) { + if (VDBG) logd("deleteThread: threadId: " + threadId); + try { + IRcs iRcs = IRcs.Stub.asInterface(ServiceManager.getService("ircs")); + if (iRcs != null) { + iRcs.deleteThread(threadId); + } + } catch (RemoteException re) { + + } + } + + private static void logd(String msg) { + Rlog.d(TAG, msg); + } +} diff --git a/telephony/java/com/android/internal/telephony/IRcs.aidl b/telephony/java/com/android/internal/telephony/IRcs.aidl new file mode 100644 index 0000000000000..ede8695ef08e1 --- /dev/null +++ b/telephony/java/com/android/internal/telephony/IRcs.aidl @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.telephony; + +interface IRcs { + void deleteThread(int threadId); +} \ No newline at end of file From 32e712e0c0d7af6b4722f650320ad62fc2bb0f4b Mon Sep 17 00:00:00 2001 From: Jayachandran C Date: Tue, 30 Oct 2018 15:09:06 -0700 Subject: [PATCH 2/3] Move the intent to SMS namespace for database corruption detection Test: Simulated and verified the new intend is used Bug: 118658558 Bug: 115990430 Merged-in: I07a58d0fe1c34106b3da85d1dfd4576b40da4bd5 Change-Id: I07a58d0fe1c34106b3da85d1dfd4576b40da4bd5 (cherry picked from commit 349b9ba16f1891a21091804f51060c6a867a5bcd) --- core/res/AndroidManifest.xml | 1 + .../java/android/provider/Telephony.java | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index f599b1fbc2067..9ce6044bcf3e5 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -399,6 +399,7 @@ + diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java index 6d3345e08a884..efea81763b9fa 100644 --- a/telephony/java/android/provider/Telephony.java +++ b/telephony/java/android/provider/Telephony.java @@ -16,6 +16,7 @@ package android.provider; +import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; @@ -1208,6 +1209,30 @@ public final class Telephony { public static final String EXTRA_IS_INITIAL_CREATE = "android.provider.extra.IS_INITIAL_CREATE"; + /** + * Broadcast intent action indicating that the telephony provider SMS MMS database is + * corrupted. A boolean is specified in {@link #EXTRA_IS_CORRUPTED} to indicate if the + * database is corrupted. Requires the + * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE permission. + * + * @hide + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + public static final String ACTION_SMS_MMS_DB_LOST = + "android.provider.action.SMS_MMS_DB_LOST"; + + /** + * Boolean flag passed as an extra with {@link #ACTION_SMS_MMS_DB_LOST} to indicate + * whether the DB got corrupted or not. + * + * @see #ACTION_SMS_MMS_DB_LOST + * + * @hide + */ + public static final String EXTRA_IS_CORRUPTED = + "android.provider.extra.IS_CORRUPTED"; + /** * Read the PDUs out of an {@link #SMS_RECEIVED_ACTION} or a * {@link #DATA_SMS_RECEIVED_ACTION} intent. From 668ce6bbef8d0e25053e694d92ec833a0e7c3cf1 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Fri, 9 Nov 2018 13:38:49 -0800 Subject: [PATCH 3/3] Define new intent ACTION_LINE1_NUMBER_ERROR_DETECTED Test: build Bug: 115843312 Merged-in: Ibcc9ce533fbc6980a371eb6239a53dc9cdebb22a Change-Id: Ibcc9ce533fbc6980a371eb6239a53dc9cdebb22a (cherry picked from commit 1bf4e92c50e80a663711b6f71dcd58cb7ee88640) --- .../internal/telephony/TelephonyIntents.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java index 5ecb43ebf112d..2a648bd8b2520 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java +++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java @@ -480,9 +480,9 @@ public class TelephonyIntents { public static final String EXTRA_PCO_VALUE_KEY = "pcoValue"; public static final String EXTRA_DEFAULT_NETWORK_AVAILABLE_KEY = "defaultNetworkAvailable"; - /** + /** * Broadcast action to trigger CI OMA-DM Session. - */ + */ public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE = "com.android.omadm.service.CONFIGURATION_UPDATE"; @@ -491,4 +491,14 @@ public class TelephonyIntents { */ public static final String ACTION_CARRIER_CERTIFICATE_DOWNLOAD = "com.android.internal.telephony.ACTION_CARRIER_CERTIFICATE_DOWNLOAD"; + + /** + * Broadcast action to indicate an error related to Line1Number has been detected. + * + * Requires the READ_PRIVILEGED_PHONE_STATE permission. + * + * @hide + */ + public static final String ACTION_LINE1_NUMBER_ERROR_DETECTED = + "com.android.internal.telephony.ACTION_LINE1_NUMBER_ERROR_DETECTED"; }