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

Commit 6189dba3 authored by Xin Guan's avatar Xin Guan
Browse files

Don't check for carrier privileged apps.

if the device doesn't support Telephony APIs for the subscriptions

Bug: 394635545
Flag: EXEMPT bug fix
Test: atest FrameworksServicesTests:com.android.server.usage.AppStandbyControllerTests#testSlicePinnedEvent
      on non-telephony supported devices.
Change-Id: I7b28a6983207fe1a67243c3046e72e1517ff5beb
parent 7272c960
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -264,6 +264,8 @@ public class AppStandbyController
    @GuardedBy("mCarrierPrivilegedLock")
    private boolean mHaveCarrierPrivilegedApps;

    private final boolean mHasFeatureTelephonySubscription;

    /** List of carrier-privileged apps that should be excluded from standby */
    @GuardedBy("mCarrierPrivilegedLock")
    private List<String> mCarrierPrivilegedApps;
@@ -603,6 +605,8 @@ public class AppStandbyController
        mContext = mInjector.getContext();
        mHandler = new AppStandbyHandler(mInjector.getLooper());
        mPackageManager = mContext.getPackageManager();
        mHasFeatureTelephonySubscription = mPackageManager.hasSystemFeature(
                PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION);

        DeviceStateReceiver deviceStateReceiver = new DeviceStateReceiver();
        IntentFilter deviceStates = new IntentFilter(BatteryManager.ACTION_CHARGING);
@@ -1515,7 +1519,7 @@ public class AppStandbyController
        }

        // Check this last, as it can be the most expensive check
        if (isCarrierApp(packageName)) {
        if (mHasFeatureTelephonySubscription && isCarrierApp(packageName)) {
            return STANDBY_BUCKET_EXEMPTED;
        }