diff --git a/src/com/android/settings/network/telephony/Enhanced4gLteSliceHelper.java b/src/com/android/settings/network/telephony/Enhanced4gLteSliceHelper.java index 52fc99c1855..9e461580b24 100644 --- a/src/com/android/settings/network/telephony/Enhanced4gLteSliceHelper.java +++ b/src/com/android/settings/network/telephony/Enhanced4gLteSliceHelper.java @@ -18,6 +18,8 @@ package com.android.settings.network.telephony; import static android.app.slice.Slice.EXTRA_TOGGLE_STATE; +import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME; + import android.app.PendingIntent; import android.content.Context; import android.content.Intent; @@ -274,6 +276,7 @@ public class Enhanced4gLteSliceHelper { */ 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 */); } diff --git a/src/com/android/settings/wifi/calling/WifiCallingSliceHelper.java b/src/com/android/settings/wifi/calling/WifiCallingSliceHelper.java index 958db7ebd8d..26d742d530e 100644 --- a/src/com/android/settings/wifi/calling/WifiCallingSliceHelper.java +++ b/src/com/android/settings/wifi/calling/WifiCallingSliceHelper.java @@ -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 */); } diff --git a/tests/robotests/src/com/android/settings/network/telephony/Enhanced4gLteSliceHelperTest.java b/tests/robotests/src/com/android/settings/network/telephony/Enhanced4gLteSliceHelperTest.java index 50446ad2f14..416e2f09305 100644 --- a/tests/robotests/src/com/android/settings/network/telephony/Enhanced4gLteSliceHelperTest.java +++ b/tests/robotests/src/com/android/settings/network/telephony/Enhanced4gLteSliceHelperTest.java @@ -20,6 +20,7 @@ import static android.app.slice.Slice.EXTRA_TOGGLE_STATE; import static android.app.slice.Slice.HINT_TITLE; import static android.app.slice.SliceItem.FORMAT_TEXT; +import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.anyInt; @@ -248,6 +249,7 @@ public class Enhanced4gLteSliceHelperTest { 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 */); } diff --git a/tests/robotests/src/com/android/settings/wifi/calling/WifiCallingSliceHelperTest.java b/tests/robotests/src/com/android/settings/wifi/calling/WifiCallingSliceHelperTest.java index 0013234c950..0b9ef551d9d 100644 --- a/tests/robotests/src/com/android/settings/wifi/calling/WifiCallingSliceHelperTest.java +++ b/tests/robotests/src/com/android/settings/wifi/calling/WifiCallingSliceHelperTest.java @@ -20,6 +20,7 @@ import static android.app.slice.Slice.EXTRA_TOGGLE_STATE; import static android.app.slice.Slice.HINT_TITLE; import static android.app.slice.SliceItem.FORMAT_TEXT; +import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.anyInt; @@ -400,6 +401,7 @@ public class WifiCallingSliceHelperTest { 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 */); }