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

Commit d69c65f3 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Let debug builds set SubscriptionPlan owners."

parents fc749759 a7f50466
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ import android.net.TrafficStats;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Binder;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
@@ -2759,6 +2760,13 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
            return;
        }

        // Fourth check: is caller a testing app on a debug build?
        final boolean enableDebug = Build.IS_USERDEBUG || Build.IS_ENG;
        if (enableDebug && callingPackage
                .equals(SystemProperties.get("fw.sub_plan_owner." + subId, null))) {
            return;
        }

        // Final check: does the caller hold a permission?
        mContext.enforceCallingOrSelfPermission(MANAGE_SUBSCRIPTION_PLANS, TAG);
    }