Add setPackage for PendingIntent in SliceHelper

Bug: 151645867
Bug: 151646375
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiCallingSliceHelperTest
      make RunSettingsRoboTests ROBOTEST_FILTER=Enhanced4gLteSliceHelperTest
Change-Id: I33c1333f9b5472cdb962b272f6be52a2d2959376
Merged-In: I33c1333f9b5472cdb962b272f6be52a2d2959376
This commit is contained in:
changbetty
2020-04-24 16:27:12 +08:00
parent 0c6037af5f
commit 0383d76a5e
4 changed files with 9 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ import static android.app.slice.Slice.EXTRA_TOGGLE_STATE;
import static com.android.settings.slices.CustomSliceRegistry.WIFI_CALLING_PREFERENCE_URI;
import static com.android.settings.slices.CustomSliceRegistry.WIFI_CALLING_URI;
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
import android.app.PendingIntent;
import android.content.ComponentName;
@@ -554,6 +555,7 @@ public class WifiCallingSliceHelper {
*/
private PendingIntent getActivityIntent(String action) {
final Intent intent = new Intent(action);
intent.setPackage(SETTINGS_PACKAGE_NAME);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent, 0 /* flags */);
}