Loading services/core/java/com/android/server/am/OomAdjuster.java +1 −2 Original line number Diff line number Diff line Loading @@ -1994,12 +1994,11 @@ public final class OomAdjuster { if (app.hasForegroundServices()) { capability |= capabilityFromFGS; } else if (!ActivityManager.isProcStateBackground(procState)) { // procState higher than PROCESS_STATE_TRANSIENT_BACKGROUND implicitly has // procState higher than PROCESS_STATE_BOUND_FOREGROUND_SERVICE implicitly has // camera/microphone capability if (procState == PROCESS_STATE_FOREGROUND_SERVICE && procStateFromFGSClient) { // if the FGS state is passed down from client, do not grant implicit capabilities. } else { //TODO: remove this line when enforcing the feature. capability |= PROCESS_CAPABILITY_ALL_IMPLICIT; } } Loading services/core/java/com/android/server/appop/AppOpsService.java +5 −10 Original line number Diff line number Diff line Loading @@ -536,9 +536,8 @@ public class AppOpsService extends IAppOpsService.Stub { // The FGS has the location capability, but due to FGS BG start // restriction it lost the capability, use temp location capability // to mark this case. // TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } else { return AppOpsManager.MODE_IGNORED; } Loading @@ -546,17 +545,15 @@ public class AppOpsService extends IAppOpsService.Stub { if ((capability & PROCESS_CAPABILITY_FOREGROUND_CAMERA) != 0) { return AppOpsManager.MODE_ALLOWED; } else { //TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } case OP_RECORD_AUDIO: if ((capability & PROCESS_CAPABILITY_FOREGROUND_MICROPHONE) != 0) { return AppOpsManager.MODE_ALLOWED; } else { //TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } default: return AppOpsManager.MODE_ALLOWED; Loading @@ -571,17 +568,15 @@ public class AppOpsService extends IAppOpsService.Stub { if ((capability & PROCESS_CAPABILITY_FOREGROUND_CAMERA) != 0) { return AppOpsManager.MODE_ALLOWED; } else { //TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } case OP_RECORD_AUDIO: if ((capability & PROCESS_CAPABILITY_FOREGROUND_MICROPHONE) != 0) { return AppOpsManager.MODE_ALLOWED; } else { //TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } default: return MODE_ALLOWED; Loading Loading
services/core/java/com/android/server/am/OomAdjuster.java +1 −2 Original line number Diff line number Diff line Loading @@ -1994,12 +1994,11 @@ public final class OomAdjuster { if (app.hasForegroundServices()) { capability |= capabilityFromFGS; } else if (!ActivityManager.isProcStateBackground(procState)) { // procState higher than PROCESS_STATE_TRANSIENT_BACKGROUND implicitly has // procState higher than PROCESS_STATE_BOUND_FOREGROUND_SERVICE implicitly has // camera/microphone capability if (procState == PROCESS_STATE_FOREGROUND_SERVICE && procStateFromFGSClient) { // if the FGS state is passed down from client, do not grant implicit capabilities. } else { //TODO: remove this line when enforcing the feature. capability |= PROCESS_CAPABILITY_ALL_IMPLICIT; } } Loading
services/core/java/com/android/server/appop/AppOpsService.java +5 −10 Original line number Diff line number Diff line Loading @@ -536,9 +536,8 @@ public class AppOpsService extends IAppOpsService.Stub { // The FGS has the location capability, but due to FGS BG start // restriction it lost the capability, use temp location capability // to mark this case. // TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } else { return AppOpsManager.MODE_IGNORED; } Loading @@ -546,17 +545,15 @@ public class AppOpsService extends IAppOpsService.Stub { if ((capability & PROCESS_CAPABILITY_FOREGROUND_CAMERA) != 0) { return AppOpsManager.MODE_ALLOWED; } else { //TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } case OP_RECORD_AUDIO: if ((capability & PROCESS_CAPABILITY_FOREGROUND_MICROPHONE) != 0) { return AppOpsManager.MODE_ALLOWED; } else { //TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } default: return AppOpsManager.MODE_ALLOWED; Loading @@ -571,17 +568,15 @@ public class AppOpsService extends IAppOpsService.Stub { if ((capability & PROCESS_CAPABILITY_FOREGROUND_CAMERA) != 0) { return AppOpsManager.MODE_ALLOWED; } else { //TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } case OP_RECORD_AUDIO: if ((capability & PROCESS_CAPABILITY_FOREGROUND_MICROPHONE) != 0) { return AppOpsManager.MODE_ALLOWED; } else { //TODO change to MODE_IGNORED when enforcing the feature. maybeShowWhileInUseDebugToast(op, mode); return AppOpsManager.MODE_ALLOWED; return AppOpsManager.MODE_IGNORED; } default: return MODE_ALLOWED; Loading