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

Commit 0784a7d0 authored by Songchun Fan's avatar Songchun Fan Committed by Android (Google) Code Review
Browse files

Merge changes Iba408e53,I751b737d

* changes:
  [pm] forbid deletion of protected packages
  [pm] fix thread tag
parents e2f931cd 15f85c7f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -673,6 +673,18 @@ final class DeletePackageHelper {
        final String packageName = versionedPackage.getPackageName();
        final long versionCode = versionedPackage.getLongVersionCode();

        if (mPm.mProtectedPackages.isPackageDataProtected(userId, packageName)) {
            mPm.mHandler.post(() -> {
                try {
                    Slog.w(TAG, "Attempted to delete protected package: " + packageName);
                    observer.onPackageDeleted(packageName,
                            PackageManager.DELETE_FAILED_INTERNAL_ERROR, null);
                } catch (RemoteException re) {
                }
            });
            return;
        }

        try {
            if (mPm.mInjector.getLocalService(ActivityTaskManagerInternal.class)
                    .isBaseOfLockedTask(packageName)) {
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ import com.android.server.pm.UserManagerService;
 * Legacy permission manager service.
 */
public class LegacyPermissionManagerService extends ILegacyPermissionManager.Stub {
    private static final String TAG = "PackageManager";
    private static final String TAG = "PermissionManager";

    /** Injector that can be used to facilitate testing. */
    private final Injector mInjector;
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ import java.util.concurrent.TimeoutException;
 */
public class PermissionManagerServiceImpl implements PermissionManagerServiceInterface {

    private static final String TAG = "PackageManager";
    private static final String TAG = "PermissionManager";
    private static final String LOG_TAG = PermissionManagerServiceImpl.class.getSimpleName();

    private static final String SKIP_KILL_APP_REASON_NOTIFICATION_TEST = "skip permission revoke "