From 9856aaece4153ba5e346b92f2973d834861b68ad Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Mon, 5 Aug 2019 19:56:29 +0200 Subject: [PATCH] Fix package name when the activities are restarted (#1502) --- .../mozilla/vrbrowser/crashreporting/CrashReporterService.java | 1 + .../common/shared/org/mozilla/vrbrowser/utils/SystemUtils.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/crashreporting/CrashReporterService.java b/app/src/common/shared/org/mozilla/vrbrowser/crashreporting/CrashReporterService.java index eb7d08c1c..2c75784bb 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/crashreporting/CrashReporterService.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/crashreporting/CrashReporterService.java @@ -73,6 +73,7 @@ protected void onHandleWork(@NonNull Intent intent) { if (!otherProcessesFound) { intent.setClass(CrashReporterService.this, VRBrowserActivity.class); + intent.setPackage(BuildConfig.APPLICATION_ID); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); break; diff --git a/app/src/common/shared/org/mozilla/vrbrowser/utils/SystemUtils.java b/app/src/common/shared/org/mozilla/vrbrowser/utils/SystemUtils.java index f84eb92ea..65462dd6b 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/utils/SystemUtils.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/utils/SystemUtils.java @@ -7,17 +7,20 @@ import androidx.annotation.NonNull; +import org.mozilla.vrbrowser.BuildConfig; import org.mozilla.vrbrowser.VRBrowserActivity; public class SystemUtils { public static final void restart(@NonNull Context context) { Intent i = new Intent(context, VRBrowserActivity.class); + i.setPackage(BuildConfig.APPLICATION_ID); context.startActivity(i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK)); } public static final void scheduleRestart(@NonNull Context context, long delay) { Intent i = new Intent(context, VRBrowserActivity.class); + i.setPackage(BuildConfig.APPLICATION_ID); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);