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

Commit 5e40aee0 authored by Atneya Nair's avatar Atneya Nair
Browse files

Remove OP_TAKE_AUDIO_FOCUS audio CAP requirement

It was not intended that OP_TAKE_AUDIO_FOCUS requires WIU caps in the
prior release, just that an FGS service was required. Our documentation
also only noted a requirement on an FGS *not* a requirement on an FGS
with a capability.

Since capability enforcement is tied to WIU, we must remove the
capability requirement, and downgrade to a regular MODE_FOREGROUND
enforcement for this OP. Since we didn't require a specific FGS type
either, this change is closer to our desired behavior.

We will add back capability based enforcement in subsequent release(s)
with the correct docs/logs/etc.

Test: compiles
Fixes: 375807626
Flag: EXEMPT bugfix--safe, infeasible
Change-Id: I0144fcbb0cd685a0a0a160fbd1a9b7fcd24f898f
parent 003fca61
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import static android.app.AppOpsManager.OP_CAMERA;
import static android.app.AppOpsManager.OP_NONE;
import static android.app.AppOpsManager.OP_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO;
import static android.app.AppOpsManager.OP_RECORD_AUDIO;
import static android.app.AppOpsManager.OP_TAKE_AUDIO_FOCUS;
import static android.app.AppOpsManager.UID_STATE_FOREGROUND_SERVICE;
import static android.app.AppOpsManager.UID_STATE_MAX_LAST_NON_RESTRICTED;
import static android.app.AppOpsManager.UID_STATE_NONEXISTENT;
@@ -177,8 +176,6 @@ class AppOpsUidStateTrackerImpl implements AppOpsUidStateTracker {
            case OP_RECORD_AUDIO:
            case OP_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO:
                return PROCESS_CAPABILITY_FOREGROUND_MICROPHONE;
            case OP_TAKE_AUDIO_FOCUS:
                return PROCESS_CAPABILITY_FOREGROUND_AUDIO_CONTROL;
            default:
                return PROCESS_CAPABILITY_NONE;
        }