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

Commit c1006a33 authored by Svet Ganov's avatar Svet Ganov
Browse files

Don't record audio if UID is idle - framework

To protect user's privacy if a UID is in an idle state we allow
recording but report silence (all zeros in the byte array) and once
the process goes in an active state we report the real mic data.
This avoids the race between the app being notified aboout its
lifecycle and the audio system being notified about the state
of a UID.

Test: Added - AudioRecordTest#testRecordNoDataForIdleUids
      Passing - cts-tradefed run cts-dev -m CtsMediaTestCases
             -t android.media.cts.AudioRecordTest

bug:63938985

Change-Id: I8b0a0889c4aee07f4e1d3c7e4cee0821f2f8cd91
parent 8bd13958
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3694,6 +3694,10 @@
    <permission android:name="android.permission.READ_RUNTIME_PROFILES"
                android:protectionLevel="signature|privileged" />

    <!-- @hide Allows audio policy management. -->
    <permission android:name="android.permission.MANAGE_AUDIO_POLICY"
        android:protectionLevel="signature" />

    <!-- @SystemApi Allows an application to turn on / off quiet mode.
         @hide <p>Not for use by third-party applications. -->
    <permission android:name="android.permission.MODIFY_QUIET_MODE"
+2 −0
Original line number Diff line number Diff line
@@ -137,6 +137,8 @@
    <uses-permission android:name="android.permission.SET_HARMFUL_APP_WARNINGS" />
    <uses-permission android:name="android.permission.MANAGE_SENSORS" />

    <uses-permission android:name="android.permission.MANAGE_AUDIO_POLICY" />

    <application android:label="@string/app_label"
                 android:defaultToDeviceProtectedStorage="true"
                 android:directBootAware="true">