enforce the calling package is the default dialer for VisualVoicemail
In the docs for setVisualVoicemailSmsFilterSettings, they state that
the callingPackage needs to be the default dialer. However, server side,
there is no enforcement for this. Now, every client is verified to be
the default dialer, system dialer, or carrier visual voicemail app
before changing the settings for visual voicemail.
Bug: 308932906
Test: CTS
Change-Id: I951d7783f5c425c03768efb7aee7a38e299e6536
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index e22f51a..af8caa4 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -4267,10 +4267,9 @@
public void enableVisualVoicemailSmsFilter(String callingPackage, int subId,
VisualVoicemailSmsFilterSettings settings) {
mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);
-
+ enforceVisualVoicemailPackage(callingPackage, subId);
enforceTelephonyFeatureWithException(callingPackage,
PackageManager.FEATURE_TELEPHONY_CALLING, "enableVisualVoicemailSmsFilter");
-
final long identity = Binder.clearCallingIdentity();
try {
VisualVoicemailSmsFilterConfig.enableVisualVoicemailSmsFilter(