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

Commit 92663599 authored by Jing Ji's avatar Jing Ji
Browse files

Add exemptions for the apps with the camera/mic permissions granted

The battery usage while they're running as foreground service with
these permissions granted will be exmpted from background usage.

Bug: 203105544
Bug: 223428877
Test: Manual - dumpsys activity -a
Change-Id: Ibb58e8c29d63532b2a83d3afa72c3d5644f44f65
parent 393f3b52
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -17,7 +17,11 @@
package com.android.server.am;

import static android.Manifest.permission.ACCESS_FINE_LOCATION;
import static android.Manifest.permission.CAMERA;
import static android.Manifest.permission.RECORD_AUDIO;
import static android.app.AppOpsManager.OPSTR_CAMERA;
import static android.app.AppOpsManager.OPSTR_FINE_LOCATION;
import static android.app.AppOpsManager.OPSTR_RECORD_AUDIO;
import static android.app.AppOpsManager.OP_NONE;
import static android.app.AppOpsManager.opToPublicName;
import static android.app.AppOpsManager.strOpToOp;
@@ -515,6 +519,8 @@ final class AppPermissionTracker extends BaseAppStateTracker<AppPermissionPolicy
         */
        static final String[] DEFAULT_BG_PERMISSIONS_IN_MONITOR = new String[] {
            ACCESS_FINE_LOCATION, OPSTR_FINE_LOCATION,
            CAMERA, OPSTR_CAMERA,
            RECORD_AUDIO, OPSTR_RECORD_AUDIO,
        };

        /**