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

Commit ce249254 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/30595743',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/30595743', 'googleplex-android-review.googlesource.com/29689248', 'googleplex-android-review.googlesource.com/29688663', 'googleplex-android-review.googlesource.com/29688664', 'googleplex-android-review.googlesource.com/30965242', 'googleplex-android-review.googlesource.com/31157007', 'googleplex-android-review.googlesource.com/31106431', 'googleplex-android-review.googlesource.com/31092845', 'googleplex-android-review.googlesource.com/30800590'] into security-aosp-24Q3-release.

Change-Id: I152139156ffec25bc87272cf5b73769548a63e6e
parents 505938d9 f1a15b5e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -19,10 +19,10 @@ package android.app;
import android.os.IRemoteCallback;

/** {@hide} */
oneway interface IUserSwitchObserver {
interface IUserSwitchObserver {
    void onBeforeUserSwitching(int newUserId);
    void onUserSwitching(int newUserId, IRemoteCallback reply);
    void onUserSwitchComplete(int newUserId);
    void onForegroundProfileSwitch(int newProfileId);
    void onLockedBootComplete(int newUserId);
    oneway void onUserSwitching(int newUserId, IRemoteCallback reply);
    oneway void onUserSwitchComplete(int newUserId);
    oneway void onForegroundProfileSwitch(int newProfileId);
    oneway void onLockedBootComplete(int newUserId);
}
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.packageinstaller;
import static android.Manifest.permission;
import static android.content.pm.PackageManager.GET_PERMISSIONS;
import static android.content.pm.PackageManager.MATCH_ARCHIVED_PACKAGES;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;

import android.app.Activity;
import android.app.DialogFragment;
@@ -53,6 +54,8 @@ public class UnarchiveActivity extends Activity {

    @Override
    public void onCreate(Bundle icicle) {
        getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);

        super.onCreate(null);

        int callingUid = getLaunchedFromUid();
+30 −1
Original line number Diff line number Diff line
@@ -21,10 +21,14 @@ import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.widget.Button;

public class UnarchiveFragment extends DialogFragment implements
        DialogInterface.OnClickListener {

    private Dialog mDialog;
    private Button mRestoreButton;

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        String appTitle = getArguments().getString(UnarchiveActivity.APP_TITLE);
@@ -40,7 +44,32 @@ public class UnarchiveFragment extends DialogFragment implements
        dialogBuilder.setPositiveButton(R.string.restore, this);
        dialogBuilder.setNegativeButton(android.R.string.cancel, this);

        return dialogBuilder.create();
        mDialog = dialogBuilder.create();
        return mDialog;
    }

    @Override
    public void onStart() {
        super.onStart();
        if (mDialog != null) {
            mRestoreButton = ((AlertDialog) mDialog).getButton(DialogInterface.BUTTON_POSITIVE);
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        if (mRestoreButton != null) {
            mRestoreButton.setEnabled(false);
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        if (mRestoreButton != null) {
            mRestoreButton.setEnabled(true);
        }
    }

    @Override
+13 −10
Original line number Diff line number Diff line
@@ -47,19 +47,19 @@ import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.StringRes;

import com.android.packageinstaller.common.EventResultPersister;
import com.android.packageinstaller.common.UninstallEventReceiver;
import com.android.packageinstaller.handheld.ErrorDialogFragment;
import com.android.packageinstaller.handheld.UninstallAlertDialogFragment;
import com.android.packageinstaller.television.ErrorFragment;
import com.android.packageinstaller.television.UninstallAlertFragment;
import com.android.packageinstaller.television.UninstallAppProgress;
import com.android.packageinstaller.common.EventResultPersister;
import com.android.packageinstaller.common.UninstallEventReceiver;
import com.android.packageinstaller.v2.ui.UninstallLaunch;

import java.util.List;

/*
 * This activity presents UI to uninstall an application. Usually launched with intent
 * Intent.ACTION_UNINSTALL_PKG_COMMAND and attribute
@@ -182,14 +182,17 @@ public class UninstallerActivity extends Activity {
        if (mDialogInfo.user == null) {
            mDialogInfo.user = Process.myUserHandle();
        } else {
            List<UserHandle> profiles = userManager.getUserProfiles();
            if (!profiles.contains(mDialogInfo.user)) {
            if (!mDialogInfo.user.equals(Process.myUserHandle())) {
                final boolean isCurrentUserProfileOwner = Process.myUserHandle().equals(
                        userManager.getProfileParent(mDialogInfo.user));
                if (!isCurrentUserProfileOwner) {
                    Log.e(TAG, "User " + Process.myUserHandle() + " can't request uninstall "
                            + "for user " + mDialogInfo.user);
                    showUserIsNotAllowed();
                    return;
                }
            }
        }

        mDialogInfo.callback = intent.getParcelableExtra(PackageInstaller.EXTRA_CALLBACK,
                                            PackageManager.UninstallCompleteCallback.class);
+545 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading