Mark ACTION_REQUEST_SENT_INTENT as protected.

The ActivityManager was complaining about sending a non-protected
broadcast from the system process.

StatusSmsFetcher is a dynamic receiver so it cannot receive a
component specific intent. b/31749921 also caused the PendingIntent to
be fired with no receiver and triggered
ActivityManager.checkBroadcastFromSystem().

In this CL the broadcast is marked as protected and broadcasted to the
telephony package so the above issues can be avoided.

Fixes: 31700392
Change-Id: I420b9e782892edc7b873c2adea1e96be063cf80e
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d185951..2accdab 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -72,6 +72,7 @@
     <protected-broadcast android:name= "com.android.intent.action.IMS_FEATURE_CHANGED" />
     <protected-broadcast android:name= "com.android.intent.action.IMS_CONFIG_CHANGED" />
     <protected-broadcast android:name= "com.android.ims.REGISTRATION_ERROR" />
+    <protected-broadcast android:name= "com.android.phone.vvm.omtp.sms.REQUEST_SENT" />
 
     <uses-permission android:name="android.permission.BROADCAST_STICKY" />
     <uses-permission android:name="android.permission.CALL_PHONE" />
diff --git a/src/com/android/phone/vvm/omtp/sms/StatusSmsFetcher.java b/src/com/android/phone/vvm/omtp/sms/StatusSmsFetcher.java
index 2f3cbfa..69e4f5f 100644
--- a/src/com/android/phone/vvm/omtp/sms/StatusSmsFetcher.java
+++ b/src/com/android/phone/vvm/omtp/sms/StatusSmsFetcher.java
@@ -28,11 +28,13 @@
 import android.os.Bundle;
 import android.provider.VoicemailContract;
 import android.telephony.SmsManager;
+
 import com.android.phone.Assert;
 import com.android.phone.vvm.omtp.OmtpConstants;
 import com.android.phone.vvm.omtp.OmtpVvmCarrierConfigHelper;
 import com.android.phone.vvm.omtp.VvmLog;
 import com.android.phone.vvm.omtp.protocol.VisualVoicemailProtocol;
+
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.concurrent.CancellationException;
@@ -49,7 +51,8 @@
     private static final String TAG = "VvmStatusSmsFetcher";
 
     private static final long STATUS_SMS_TIMEOUT_MILLIS = 60_000;
-    private static final String ACTION_REQUEST_SENT_INTENT = "action_request_sent_intent";
+    private static final String ACTION_REQUEST_SENT_INTENT
+            = "com.android.phone.vvm.omtp.sms.REQUEST_SENT";
     private static final int ACTION_REQUEST_SENT_REQUEST_CODE = 0;
 
     private CompletableFuture<Bundle> mFuture = new CompletableFuture<>();
@@ -80,6 +83,7 @@
 
     public PendingIntent getSentIntent() {
         Intent intent = new Intent(ACTION_REQUEST_SENT_INTENT);
+        intent.setPackage(mContext.getPackageName());
         // Because the receiver is registered dynamically, implicit intent must be used.
         // There should only be a single status SMS request at a time.
         return PendingIntent.getBroadcast(mContext, ACTION_REQUEST_SENT_REQUEST_CODE, intent,