Loading apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,8 @@ public class PowerExemptionManager { * @hide */ public static final int REASON_TEMP_ALLOWED_WHILE_IN_USE = 70; /** @hide */ public static final int REASON_CURRENT_INPUT_METHOD = 71; /* 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 @@ -381,6 +383,7 @@ public class PowerExemptionManager { REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD, REASON_OP_ACTIVATE_VPN, REASON_OP_ACTIVATE_PLATFORM_VPN, REASON_CURRENT_INPUT_METHOD, REASON_TEMP_ALLOWED_WHILE_IN_USE, // temp and system allow list reasons. REASON_GEOFENCING, Loading Loading @@ -649,6 +652,8 @@ public class PowerExemptionManager { return "OP_ACTIVATE_VPN"; case REASON_OP_ACTIVATE_PLATFORM_VPN: return "OP_ACTIVATE_PLATFORM_VPN"; case REASON_CURRENT_INPUT_METHOD: return "CURRENT_INPUT_METHOD"; case REASON_TEMP_ALLOWED_WHILE_IN_USE: return "TEMP_ALLOWED_WHILE_IN_USE"; case REASON_GEOFENCING: Loading services/core/java/com/android/server/am/ActiveServices.java +15 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import static android.os.PowerExemptionManager.REASON_DENIED; import static android.os.PowerExemptionManager.REASON_DEVICE_DEMO_MODE; import static android.os.PowerExemptionManager.REASON_DEVICE_OWNER; import static android.os.PowerExemptionManager.REASON_FGS_BINDING; import static android.os.PowerExemptionManager.REASON_CURRENT_INPUT_METHOD; import static android.os.PowerExemptionManager.REASON_INSTR_BACKGROUND_ACTIVITY_PERMISSION; import static android.os.PowerExemptionManager.REASON_INSTR_BACKGROUND_FGS_PERMISSION; import static android.os.PowerExemptionManager.REASON_OPT_OUT_REQUESTED; Loading Loading @@ -6162,6 +6163,20 @@ public final class ActiveServices { ret = REASON_OP_ACTIVATE_PLATFORM_VPN; } } if (ret == REASON_DENIED) { final String inputMethod = Settings.Secure.getStringForUser(mAm.mContext.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD, UserHandle.getUserId(callingUid)); if (inputMethod != null) { final ComponentName cn = ComponentName.unflattenFromString(inputMethod); if (cn != null && cn.getPackageName().equals(callingPackage)) { ret = REASON_CURRENT_INPUT_METHOD; } } } if (ret == REASON_DENIED) { if (mAm.mConstants.mFgsAllowOptOut && targetService != null Loading Loading
apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,8 @@ public class PowerExemptionManager { * @hide */ public static final int REASON_TEMP_ALLOWED_WHILE_IN_USE = 70; /** @hide */ public static final int REASON_CURRENT_INPUT_METHOD = 71; /* 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 @@ -381,6 +383,7 @@ public class PowerExemptionManager { REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD, REASON_OP_ACTIVATE_VPN, REASON_OP_ACTIVATE_PLATFORM_VPN, REASON_CURRENT_INPUT_METHOD, REASON_TEMP_ALLOWED_WHILE_IN_USE, // temp and system allow list reasons. REASON_GEOFENCING, Loading Loading @@ -649,6 +652,8 @@ public class PowerExemptionManager { return "OP_ACTIVATE_VPN"; case REASON_OP_ACTIVATE_PLATFORM_VPN: return "OP_ACTIVATE_PLATFORM_VPN"; case REASON_CURRENT_INPUT_METHOD: return "CURRENT_INPUT_METHOD"; case REASON_TEMP_ALLOWED_WHILE_IN_USE: return "TEMP_ALLOWED_WHILE_IN_USE"; case REASON_GEOFENCING: Loading
services/core/java/com/android/server/am/ActiveServices.java +15 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import static android.os.PowerExemptionManager.REASON_DENIED; import static android.os.PowerExemptionManager.REASON_DEVICE_DEMO_MODE; import static android.os.PowerExemptionManager.REASON_DEVICE_OWNER; import static android.os.PowerExemptionManager.REASON_FGS_BINDING; import static android.os.PowerExemptionManager.REASON_CURRENT_INPUT_METHOD; import static android.os.PowerExemptionManager.REASON_INSTR_BACKGROUND_ACTIVITY_PERMISSION; import static android.os.PowerExemptionManager.REASON_INSTR_BACKGROUND_FGS_PERMISSION; import static android.os.PowerExemptionManager.REASON_OPT_OUT_REQUESTED; Loading Loading @@ -6162,6 +6163,20 @@ public final class ActiveServices { ret = REASON_OP_ACTIVATE_PLATFORM_VPN; } } if (ret == REASON_DENIED) { final String inputMethod = Settings.Secure.getStringForUser(mAm.mContext.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD, UserHandle.getUserId(callingUid)); if (inputMethod != null) { final ComponentName cn = ComponentName.unflattenFromString(inputMethod); if (cn != null && cn.getPackageName().equals(callingPackage)) { ret = REASON_CURRENT_INPUT_METHOD; } } } if (ret == REASON_DENIED) { if (mAm.mConstants.mFgsAllowOptOut && targetService != null Loading