Skip to content

Commit 6a0b405

Browse files
manny-jimenezManny Jimenez
and
Manny Jimenez
authored
Adding clear task flag to fix update app bug (#3262)
* Adding clear task flag to fix update app bug * Adding comments on flags * Adding flags in one line Co-authored-by: Manny Jimenez <[email protected]>
1 parent 4884bcb commit 6a0b405

File tree

1 file changed

+3
-1
lines changed
  • firebase-app-distribution/src/main/java/com/google/firebase/app/distribution/internal

1 file changed

+3
-1
lines changed

firebase-app-distribution/src/main/java/com/google/firebase/app/distribution/internal/InstallActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ private void startAndroidPackageInstallerIntent() {
142142
intent.setDataAndType(Uri.fromFile(apkFile), APK_MIME_TYPE);
143143
}
144144

145-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
145+
// These flags open the installation activity in a new task and to prevent earlier installation
146+
// tasks from causing future ones to fail we use the clear task flag
147+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
146148
LogWrapper.getInstance().v("Kicking off install as new activity");
147149
startActivity(intent);
148150
}

0 commit comments

Comments
 (0)