diff options
author | 2019-12-14 06:57:48 +0000 | |
---|---|---|
committer | 2019-12-14 06:57:48 +0000 | |
commit | c0fa362e1b6842da9b0bcf94fdb2cc2b7af8ca45 (patch) | |
tree | 1046fb99fec436de65aacb170933dc25c2d1eb04 | |
parent | b25174e9d0697e20ab1a89f763d2fccf74a38492 (diff) | |
parent | 435d1c1a53e896d070bbdf70c3811e972425ce16 (diff) |
Merge "remove API RoleManager.getFinancialSms"
6 files changed, 6 insertions, 107 deletions
diff --git a/core/java/android/app/role/IRoleManager.aidl b/core/java/android/app/role/IRoleManager.aidl index d8cea2860aa8..6d790b381ace 100644 --- a/core/java/android/app/role/IRoleManager.aidl +++ b/core/java/android/app/role/IRoleManager.aidl @@ -19,7 +19,6 @@ package android.app.role; import android.app.role.IOnRoleHoldersChangedListener; import android.os.Bundle; import android.os.RemoteCallback; -import android.telephony.IFinancialSmsCallback; /** * @hide @@ -55,9 +54,4 @@ interface IRoleManager { List<String> getHeldRolesFromController(in String packageName); String getDefaultSmsPackage(int userId); - - /** - * Get filtered SMS messages for financial app. - */ - void getSmsMessagesForFinancialApp(in String callingPkg, in Bundle params, in IFinancialSmsCallback callback); } diff --git a/services/core/java/com/android/server/role/RoleManagerService.java b/services/core/java/com/android/server/role/RoleManagerService.java index fff9ec7f02c5..0caf8f835752 100644 --- a/services/core/java/com/android/server/role/RoleManagerService.java +++ b/services/core/java/com/android/server/role/RoleManagerService.java @@ -50,7 +50,6 @@ import android.os.ShellCallback; import android.os.UserHandle; import android.os.UserManagerInternal; import android.service.sms.FinancialSmsService; -import android.telephony.IFinancialSmsCallback; import android.text.TextUtils; import android.util.ArrayMap; import android.util.ArraySet; @@ -675,40 +674,6 @@ public class RoleManagerService extends SystemService implements RoleUserState.C dumpOutputStream.flush(); } - /** - * Get filtered SMS messages for financial app. - */ - @Override - public void getSmsMessagesForFinancialApp( - String callingPkg, Bundle params, IFinancialSmsCallback callback) { - int mode = PermissionChecker.checkCallingOrSelfPermissionForDataDelivery( - getContext(), - AppOpsManager.OPSTR_SMS_FINANCIAL_TRANSACTIONS); - - if (mode == PermissionChecker.PERMISSION_GRANTED) { - FinancialSmsManager financialSmsManager = new FinancialSmsManager(getContext()); - financialSmsManager.getSmsMessages(new RemoteCallback((result) -> { - CursorWindow messages = null; - if (result == null) { - Slog.w(LOG_TAG, "result is null."); - } else { - messages = result.getParcelable(FinancialSmsService.EXTRA_SMS_MSGS); - } - try { - callback.onGetSmsMessagesForFinancialApp(messages); - } catch (RemoteException e) { - // do nothing - } - }), params); - } else { - try { - callback.onGetSmsMessagesForFinancialApp(null); - } catch (RemoteException e) { - // do nothing - } - } - } - private int getUidForPackage(String packageName) { long ident = Binder.clearCallingIdentity(); try { diff --git a/telephony/java/android/telephony/IFinancialSmsCallback.aidl b/telephony/java/android/telephony/IFinancialSmsCallback.aidl deleted file mode 100644 index aa88615c15cf..000000000000 --- a/telephony/java/android/telephony/IFinancialSmsCallback.aidl +++ /dev/null @@ -1,34 +0,0 @@ -/* -** Copyright 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; - -import android.app.PendingIntent; -import android.database.CursorWindow; -import android.net.Uri; -import android.os.Bundle; -import com.android.internal.telephony.SmsRawData; - -/** Interface for returning back the financial sms messages asynchrously. - * @hide - */ -interface IFinancialSmsCallback { - /** - * Return sms messages back to calling financial app. - * - * @param messages the sms messages returned for cinancial app. - */ - oneway void onGetSmsMessagesForFinancialApp(in CursorWindow messages); -} diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java index 4859ece91d1b..5b49117be532 100644 --- a/telephony/java/android/telephony/SmsManager.java +++ b/telephony/java/android/telephony/SmsManager.java @@ -32,6 +32,7 @@ import android.content.pm.PackageManager; import android.database.CursorWindow; import android.net.Uri; import android.os.Binder; +import android.os.BaseBundle; import android.os.Build; import android.os.Bundle; import android.os.RemoteException; @@ -2452,7 +2453,9 @@ public final class SmsManager { } } - /** callback for providing asynchronous sms messages for financial app. */ + /** + * callback for providing asynchronous sms messages for financial app. + */ public abstract static class FinancialSmsCallback { /** * Callback to send sms messages back to financial app asynchronously. @@ -2478,24 +2481,14 @@ public final class SmsManager { * @param params the parameters to filter SMS messages returned. * @param executor the executor on which callback will be invoked. * @param callback a callback to receive CursorWindow with SMS messages. + * */ @RequiresPermission(android.Manifest.permission.SMS_FINANCIAL_TRANSACTIONS) public void getSmsMessagesForFinancialApp( Bundle params, @NonNull @CallbackExecutor Executor executor, @NonNull FinancialSmsCallback callback) { - try { - ISms iccSms = getISmsServiceOrThrow(); - iccSms.getSmsMessagesForFinancialApp( - getSubscriptionId(), ActivityThread.currentPackageName(), params, - new IFinancialSmsCallback.Stub() { - public void onGetSmsMessagesForFinancialApp(CursorWindow msgs) { - Binder.withCleanCallingIdentity(() -> executor.execute( - () -> callback.onFinancialSmsMessages(msgs))); - }}); - } catch (RemoteException ex) { - ex.rethrowFromSystemServer(); - } + // This API is not functional and thus removed to avoid future confusion. } /** diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl index c1d700a2d190..91aa3ce62cf2 100644 --- a/telephony/java/com/android/internal/telephony/ISms.aidl +++ b/telephony/java/com/android/internal/telephony/ISms.aidl @@ -19,7 +19,6 @@ package com.android.internal.telephony; import android.app.PendingIntent; import android.net.Uri; import android.os.Bundle; -import android.telephony.IFinancialSmsCallback; import com.android.internal.telephony.SmsRawData; /** @@ -570,17 +569,6 @@ interface ISms { int subId, String callingPkg, String prefixes, in PendingIntent intent); /** - * Get sms inbox messages for the calling financial app. - * - * @param subId the SIM id. - * @param callingPkg the package name of the calling app. - * @param params parameters to filter the sms messages. - * @param callback the callback interface to deliver the result. - */ - void getSmsMessagesForFinancialApp( - int subId, String callingPkg, in Bundle params, in IFinancialSmsCallback callback); - - /** * Check if the destination is a possible premium short code. * * @param destAddress the destination address to test for possible short code diff --git a/telephony/java/com/android/internal/telephony/ISmsImplBase.java b/telephony/java/com/android/internal/telephony/ISmsImplBase.java index ff816f24667e..d9d4b6002206 100644 --- a/telephony/java/com/android/internal/telephony/ISmsImplBase.java +++ b/telephony/java/com/android/internal/telephony/ISmsImplBase.java @@ -19,7 +19,6 @@ package com.android.internal.telephony; import android.app.PendingIntent; import android.net.Uri; import android.os.Bundle; -import android.telephony.IFinancialSmsCallback; import java.util.List; @@ -198,12 +197,6 @@ public class ISmsImplBase extends ISms.Stub { } @Override - public void getSmsMessagesForFinancialApp( - int subId, String callingPkg, Bundle params, IFinancialSmsCallback callback) { - throw new UnsupportedOperationException(); - } - - @Override public int checkSmsShortCodeDestination( int subid, String callingApk, String destAddress, String countryIso) { throw new UnsupportedOperationException(); |