Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3a0e31b authored by Sumedh Sen's avatar Sumedh Sen Committed by Android (Google) Code Review
Browse files

Merge "Revert "Launching updated package after finishing package installer"" into main

parents 05a9407c 9f13b2f9
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.packageinstaller;

import static android.content.Intent.CATEGORY_LAUNCHER;

import static com.android.packageinstaller.PackageInstallerActivity.EXTRA_STAGED_SESSION_ID;

import android.app.Activity;
@@ -47,9 +45,6 @@ public class DeleteStagedFileOnResult extends Activity {
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        setResult(resultCode, data);
        finish();
        if (data != null && data.hasCategory(CATEGORY_LAUNCHER)) {
            startActivity(data);
        }
    }

    @Override
+7 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.packageinstaller;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -120,7 +121,12 @@ public class InstallSuccess extends Activity {
        Button launchButton = mDialog.getButton(DialogInterface.BUTTON_POSITIVE);
        if (enabled) {
            launchButton.setOnClickListener(view -> {
                setResult(Activity.RESULT_OK, mLaunchIntent);
                try {
                    startActivity(mLaunchIntent.addFlags(
                        Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP));
                } catch (ActivityNotFoundException | SecurityException e) {
                    Log.e(LOG_TAG, "Could not start activity", e);
                }
                finish();
            });
        } else {