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

Commit 33f940d1 authored by Pechetty Sravani's avatar Pechetty Sravani Committed by Android (Google) Code Review
Browse files

Revert "Check phone or system process in PMS with multiple-user-aware way"

This reverts commit f9ca3610.

Reason for revert: Droidmonitor created revert due to b/351033862. Will be verifying through ABTD before submission.

Change-Id: I34cd93ee8581a58094ce8aae09b6d6145b298422
parent f9ca3610
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -186,7 +186,6 @@ import com.android.internal.pm.pkg.component.ParsedInstrumentation;
import com.android.internal.pm.pkg.component.ParsedMainComponent;
import com.android.internal.pm.pkg.parsing.ParsingPackageUtils;
import com.android.internal.telephony.CarrierAppUtils;
import com.android.internal.telephony.TelephonyPermissions;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.CollectionUtils;
import com.android.internal.util.ConcurrentUtils;
@@ -4493,7 +4492,8 @@ public class PackageManagerService implements PackageSender, TestUtilityService
    void setSystemAppHiddenUntilInstalled(@NonNull Computer snapshot, String packageName,
            boolean hidden) {
        final int callingUid = Binder.getCallingUid();
        final boolean calledFromSystemOrPhone = TelephonyPermissions.isSystemOrPhone(callingUid);
        final boolean calledFromSystemOrPhone = callingUid == Process.PHONE_UID
                || callingUid == Process.SYSTEM_UID;
        if (!calledFromSystemOrPhone) {
            mContext.enforceCallingOrSelfPermission(Manifest.permission.SUSPEND_APPS,
                    "setSystemAppHiddenUntilInstalled");
+1 −2
Original line number Diff line number Diff line
@@ -92,7 +92,6 @@ import android.util.proto.ProtoOutputStream;

import com.android.internal.content.InstallLocationUtils;
import com.android.internal.content.NativeLibraryHelper;
import com.android.internal.telephony.TelephonyPermissions;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.HexDump;
@@ -357,7 +356,7 @@ public class PackageManagerServiceUtils {
     * If not, throws a {@link SecurityException}.
     */
    public static void enforceSystemOrPhoneCaller(String methodName, int callingUid) {
        if (!TelephonyPermissions.isSystemOrPhone(callingUid)) {
        if (callingUid != Process.PHONE_UID && callingUid != Process.SYSTEM_UID) {
            throw new SecurityException(
                    "Cannot call " + methodName + " from UID " + callingUid);
        }