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

Commit e96b5668 authored by Ricardo Correa's avatar Ricardo Correa
Browse files

Include an AppOp to allow dialer role app to record and play audio into calls

This change includes an AppOp that will be used to grant access to telephony call audio (RX and TX) to the default dialer application (assigned to the Dialer role).
A new permission was created so only apps that also require this permission will be granted. It will also be used to keep track of usage (audit).

Test: Compilation and manual verification
Bug: 135197853

Change-Id: I5d042f667ca5fe64f8048b8aff7b98f51b3c1500
parent 38c4fcf9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ package android {
    ctor public Manifest.permission();
    field public static final String ACCEPT_HANDOVER = "android.permission.ACCEPT_HANDOVER";
    field public static final String ACCESS_BACKGROUND_LOCATION = "android.permission.ACCESS_BACKGROUND_LOCATION";
    field public static final String ACCESS_CALL_AUDIO = "android.permission.ACCESS_CALL_AUDIO";
    field public static final String ACCESS_CHECKIN_PROPERTIES = "android.permission.ACCESS_CHECKIN_PROPERTIES";
    field public static final String ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION";
    field public static final String ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION";
+1 −0
Original line number Diff line number Diff line
@@ -375,6 +375,7 @@ package android.app {
    method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setUidMode(String, int, int);
    field public static final String OPSTR_ACCEPT_HANDOVER = "android:accept_handover";
    field public static final String OPSTR_ACCESS_ACCESSIBILITY = "android:access_accessibility";
    field public static final String OPSTR_ACCESS_CALL_AUDIO = "android:access_call_audio";
    field public static final String OPSTR_ACCESS_NOTIFICATIONS = "android:access_notifications";
    field public static final String OPSTR_ACTIVATE_VPN = "android:activate_vpn";
    field public static final String OPSTR_ASSIST_SCREENSHOT = "android:assist_screenshot";
+15 −1
Original line number Diff line number Diff line
@@ -995,10 +995,12 @@ public class AppOpsManager {
    public static final int OP_ACTIVATE_PLATFORM_VPN = 94;
    /** @hide */
    public static final int OP_LOADER_USAGE_STATS = 95;
    /** @hide Access telephony call audio */
    public static final int OP_ACCESS_CALL_AUDIO = 96;

    /** @hide */
    @UnsupportedAppUsage
    public static final int _NUM_OP = 96;
    public static final int _NUM_OP = 97;

    /** Access to coarse location information. */
    public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -1289,6 +1291,9 @@ public class AppOpsManager {
    @SystemApi
    public static final String OPSTR_MANAGE_EXTERNAL_STORAGE =
            "android:manage_external_storage";
    /** @hide Access telephony call audio */
    @SystemApi
    public static final String OPSTR_ACCESS_CALL_AUDIO = "android:access_call_audio";

    /** @hide Communicate cross-profile within the same profile group. */
    @SystemApi
@@ -1378,6 +1383,7 @@ public class AppOpsManager {
            OP_MANAGE_EXTERNAL_STORAGE,
            OP_INTERACT_ACROSS_PROFILES,
            OP_LOADER_USAGE_STATS,
            OP_ACCESS_CALL_AUDIO,
    };

    /**
@@ -1485,6 +1491,7 @@ public class AppOpsManager {
            OP_INTERACT_ACROSS_PROFILES,        //INTERACT_ACROSS_PROFILES
            OP_ACTIVATE_PLATFORM_VPN,           // ACTIVATE_PLATFORM_VPN
            OP_LOADER_USAGE_STATS,              // LOADER_USAGE_STATS
            OP_ACCESS_CALL_AUDIO,               // ACCESS_CALL_AUDIO
    };

    /**
@@ -1587,6 +1594,7 @@ public class AppOpsManager {
            OPSTR_INTERACT_ACROSS_PROFILES,
            OPSTR_ACTIVATE_PLATFORM_VPN,
            OPSTR_LOADER_USAGE_STATS,
            OPSTR_ACCESS_CALL_AUDIO,
    };

    /**
@@ -1690,6 +1698,7 @@ public class AppOpsManager {
            "INTERACT_ACROSS_PROFILES",
            "ACTIVATE_PLATFORM_VPN",
            "LOADER_USAGE_STATS",
            "ACCESS_CALL_AUDIO",
    };

    /**
@@ -1794,6 +1803,7 @@ public class AppOpsManager {
            android.Manifest.permission.INTERACT_ACROSS_PROFILES,
            null, // no permission for OP_ACTIVATE_PLATFORM_VPN
            android.Manifest.permission.LOADER_USAGE_STATS,
            Manifest.permission.ACCESS_CALL_AUDIO,
    };

    /**
@@ -1898,6 +1908,7 @@ public class AppOpsManager {
            null, // INTERACT_ACROSS_PROFILES
            null, // ACTIVATE_PLATFORM_VPN
            null, // LOADER_USAGE_STATS
            null, // ACCESS_CALL_AUDIO
    };

    /**
@@ -2001,6 +2012,7 @@ public class AppOpsManager {
            false, // INTERACT_ACROSS_PROFILES
            false, // ACTIVATE_PLATFORM_VPN
            false, // LOADER_USAGE_STATS
            false, // ACCESS_CALL_AUDIO
    };

    /**
@@ -2103,6 +2115,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_DEFAULT, // INTERACT_ACROSS_PROFILES
            AppOpsManager.MODE_IGNORED, // ACTIVATE_PLATFORM_VPN
            AppOpsManager.MODE_DEFAULT, // LOADER_USAGE_STATS
            AppOpsManager.MODE_DEFAULT, // ACCESS_CALL_AUDIO
    };

    /**
@@ -2209,6 +2222,7 @@ public class AppOpsManager {
            false, // INTERACT_ACROSS_PROFILES
            false, // ACTIVATE_PLATFORM_VPN
            false, // LOADER_USAGE_STATS
            false, // ACCESS_CALL_AUDIO
    };

    /**
+2 −2
Original line number Diff line number Diff line
@@ -256,10 +256,10 @@ public final class AsyncNotedAppOp implements Parcelable {
    };

    @DataClass.Generated(
            time = 1580158740502L,
            time = 1581728574427L,
            codegenVersion = "1.0.14",
            sourceFile = "frameworks/base/core/java/android/app/AsyncNotedAppOp.java",
            inputSignatures = "private final @android.annotation.IntRange(from=0L, to=95L) int mOpCode\nprivate final @android.annotation.IntRange(from=0L) int mNotingUid\nprivate final @android.annotation.Nullable java.lang.String mFeatureId\nprivate final @android.annotation.NonNull java.lang.String mMessage\nprivate final @android.annotation.IntRange(from=0L) long mTime\npublic @android.annotation.NonNull java.lang.String getOp()\nclass AsyncNotedAppOp extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true, genHiddenConstructor=true)")
            inputSignatures = "private final @android.annotation.IntRange(from=0L, to=96L) int mOpCode\nprivate final @android.annotation.IntRange(from=0L) int mNotingUid\nprivate final @android.annotation.Nullable java.lang.String mFeatureId\nprivate final @android.annotation.NonNull java.lang.String mMessage\nprivate final @android.annotation.IntRange(from=0L) long mTime\npublic @android.annotation.NonNull java.lang.String getOp()\nclass AsyncNotedAppOp extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true, genHiddenConstructor=true)")
    @Deprecated
    private void __metadata() {}

+9 −0
Original line number Diff line number Diff line
@@ -1197,6 +1197,15 @@
                android:description="@string/permdesc_acceptHandovers"
                android:protectionLevel="dangerous" />

    <!-- Allows an application assigned to the Dialer role to be granted access to the telephony
         call audio streams, both TX and RX.
         <p>Protection level: signature|appop
    -->
    <permission android:name="android.permission.ACCESS_CALL_AUDIO"
                android.label="@string/permlab_accessCallAudio"
                android:description="@string/permdesc_accessCallAudio"
                android:protectionLevel="signature|appop" />

    <!-- ====================================================================== -->
    <!-- Permissions for accessing the device microphone                        -->
    <!-- ====================================================================== -->
Loading