Loading apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +10 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,10 @@ public class PowerExemptionManager { public static final int REASON_APPOP = 66; /** @hide */ public static final int REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD = 67; /** @hide */ public static final int REASON_OP_ACTIVATE_VPN = 68; /** @hide */ public static final int REASON_OP_ACTIVATE_PLATFORM_VPN = 69; /* BG-FGS-launch is allowed by temp-allow-list or system-allow-list. Reason code for temp and system allow list starts here. Loading Loading @@ -344,6 +348,8 @@ public class PowerExemptionManager { REASON_ALLOWLISTED_PACKAGE, REASON_APPOP, REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD, REASON_OP_ACTIVATE_VPN, REASON_OP_ACTIVATE_PLATFORM_VPN, // temp and system allow list reasons. REASON_GEOFENCING, REASON_PUSH_MESSAGING, Loading Loading @@ -603,6 +609,10 @@ public class PowerExemptionManager { return "APPOP"; case REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD: return "ACTIVITY_VISIBILITY_GRACE_PERIOD"; case REASON_OP_ACTIVATE_VPN: return "OP_ACTIVATE_VPN"; case REASON_OP_ACTIVATE_PLATFORM_VPN: return "OP_ACTIVATE_PLATFORM_VPN"; case REASON_GEOFENCING: return "GEOFENCING"; case REASON_PUSH_MESSAGING: Loading services/core/java/com/android/server/am/ActiveServices.java +13 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import static android.app.ActivityManager.PROCESS_STATE_TOP; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST; import static android.os.PowerExemptionManager.REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD; import static android.os.PowerExemptionManager.REASON_OP_ACTIVATE_PLATFORM_VPN; import static android.os.PowerExemptionManager.REASON_OP_ACTIVATE_VPN; import static android.os.PowerWhitelistManager.REASON_ACTIVITY_STARTER; import static android.os.PowerWhitelistManager.REASON_ALLOWLISTED_PACKAGE; import static android.os.PowerWhitelistManager.REASON_BACKGROUND_ACTIVITY_PERMISSION; Loading Loading @@ -5865,6 +5867,17 @@ public final class ActiveServices { } } if (ret == REASON_DENIED) { final AppOpsManager appOpsManager = mAm.getAppOpsManager(); if (appOpsManager.checkOpNoThrow(AppOpsManager.OP_ACTIVATE_VPN, callingUid, callingPackage) == AppOpsManager.MODE_ALLOWED) { ret = REASON_OP_ACTIVATE_VPN; } else if (appOpsManager.checkOpNoThrow(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN, callingUid, callingPackage) == AppOpsManager.MODE_ALLOWED) { ret = REASON_OP_ACTIVATE_PLATFORM_VPN; } } return ret; } Loading Loading
apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +10 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,10 @@ public class PowerExemptionManager { public static final int REASON_APPOP = 66; /** @hide */ public static final int REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD = 67; /** @hide */ public static final int REASON_OP_ACTIVATE_VPN = 68; /** @hide */ public static final int REASON_OP_ACTIVATE_PLATFORM_VPN = 69; /* BG-FGS-launch is allowed by temp-allow-list or system-allow-list. Reason code for temp and system allow list starts here. Loading Loading @@ -344,6 +348,8 @@ public class PowerExemptionManager { REASON_ALLOWLISTED_PACKAGE, REASON_APPOP, REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD, REASON_OP_ACTIVATE_VPN, REASON_OP_ACTIVATE_PLATFORM_VPN, // temp and system allow list reasons. REASON_GEOFENCING, REASON_PUSH_MESSAGING, Loading Loading @@ -603,6 +609,10 @@ public class PowerExemptionManager { return "APPOP"; case REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD: return "ACTIVITY_VISIBILITY_GRACE_PERIOD"; case REASON_OP_ACTIVATE_VPN: return "OP_ACTIVATE_VPN"; case REASON_OP_ACTIVATE_PLATFORM_VPN: return "OP_ACTIVATE_PLATFORM_VPN"; case REASON_GEOFENCING: return "GEOFENCING"; case REASON_PUSH_MESSAGING: Loading
services/core/java/com/android/server/am/ActiveServices.java +13 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import static android.app.ActivityManager.PROCESS_STATE_TOP; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST; import static android.os.PowerExemptionManager.REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD; import static android.os.PowerExemptionManager.REASON_OP_ACTIVATE_PLATFORM_VPN; import static android.os.PowerExemptionManager.REASON_OP_ACTIVATE_VPN; import static android.os.PowerWhitelistManager.REASON_ACTIVITY_STARTER; import static android.os.PowerWhitelistManager.REASON_ALLOWLISTED_PACKAGE; import static android.os.PowerWhitelistManager.REASON_BACKGROUND_ACTIVITY_PERMISSION; Loading Loading @@ -5865,6 +5867,17 @@ public final class ActiveServices { } } if (ret == REASON_DENIED) { final AppOpsManager appOpsManager = mAm.getAppOpsManager(); if (appOpsManager.checkOpNoThrow(AppOpsManager.OP_ACTIVATE_VPN, callingUid, callingPackage) == AppOpsManager.MODE_ALLOWED) { ret = REASON_OP_ACTIVATE_VPN; } else if (appOpsManager.checkOpNoThrow(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN, callingUid, callingPackage) == AppOpsManager.MODE_ALLOWED) { ret = REASON_OP_ACTIVATE_PLATFORM_VPN; } } return ret; } Loading