SystemAPI RoleManager.getFinancialSms
1) telephoy calls hidden IRoleManager API getSmsMessagesForFinancialApp.
In order to mainline telephony, we should call stable system API
instead of hidden AIDL API.
2) decouple ISms from IFinancialSmsCallBack. Pass public
FinancialSmsCallback to RoleManager directly instead of going all
the way to ISms -> AppSmsManager
Bug: 138745655
Bug: 140908357
Test: atest android.telephony.cts.SmsManagerTest
Change-Id: Ibb25583cff46ac796c056c905424b9cc72e7a34e
(cherry picked from commit 0dc25b0f8d88c1dc8cc8d92c43b2060acd6d24a7)
Merged-in: Ibb25583cff46ac796c056c905424b9cc72e7a34e
diff --git a/src/java/com/android/internal/telephony/AppSmsManager.java b/src/java/com/android/internal/telephony/AppSmsManager.java
index 30de674..f473c9a 100644
--- a/src/java/com/android/internal/telephony/AppSmsManager.java
+++ b/src/java/com/android/internal/telephony/AppSmsManager.java
@@ -20,16 +20,10 @@
import android.annotation.Nullable;
import android.app.AppOpsManager;
import android.app.PendingIntent;
-import android.app.role.IRoleManager;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
-import android.os.Bundle;
-import android.os.RemoteException;
-import android.os.ServiceManager;
-import android.os.ServiceManager.ServiceNotFoundException;
import android.provider.Telephony.Sms.Intents;
-import android.telephony.IFinancialSmsCallback;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
import android.telephony.SubscriptionManager;
@@ -147,24 +141,6 @@
}
/**
- * Get filtered SMS messages for financial app.
- */
- public void getSmsMessagesForFinancialApp(
- String callingPkg, Bundle params, final IFinancialSmsCallback callback) {
- try {
- IRoleManager roleManager = IRoleManager.Stub.asInterface(
- ServiceManager.getServiceOrThrow(Context.ROLE_SERVICE));
- roleManager.getSmsMessagesForFinancialApp(callingPkg, params, callback);
- } catch (RemoteException e) {
- Log.e(LOG_TAG, "Receive RemoteException.");
- // do nothing
- } catch (ServiceNotFoundException e) {
- Log.e(LOG_TAG, "Service not found.");
- // do nothing
- }
- }
-
- /**
* Handle an incoming SMS_DELIVER_ACTION intent if it is an app-only SMS.
*/
public boolean handleSmsReceivedIntent(Intent intent) {
diff --git a/src/java/com/android/internal/telephony/SmsController.java b/src/java/com/android/internal/telephony/SmsController.java
index 64a5ab9..952336e 100644
--- a/src/java/com/android/internal/telephony/SmsController.java
+++ b/src/java/com/android/internal/telephony/SmsController.java
@@ -28,10 +28,8 @@
import android.content.Context;
import android.net.Uri;
import android.os.Binder;
-import android.os.Bundle;
import android.os.ServiceManager;
import android.provider.Telephony.Sms.Intents;
-import android.telephony.IFinancialSmsCallback;
import android.telephony.Rlog;
import android.telephony.SmsManager;
import android.telephony.SubscriptionInfo;
@@ -513,13 +511,6 @@
}
@Override
- public void getSmsMessagesForFinancialApp(
- int subId, String callingPkg, Bundle params, IFinancialSmsCallback callback) {
- getPhone(subId).getAppSmsManager().getSmsMessagesForFinancialApp(
- callingPkg, params, callback);
- }
-
- @Override
public int checkSmsShortCodeDestination(
int subId, String callingPackage, String destAddress, String countryIso) {
if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(getPhone(subId).getContext(),