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

Commit 265752d8 authored by Oli Lan's avatar Oli Lan
Browse files

Add SET_CLIP_SOURCE permission.

This adds a permission that allows the holder to provide the source
package when setting the primary clip in clipboard. This will be done
using a new system API.

This is needed to ensure that the clipboard access notifications can be
properly attributed. For example, when a copy is performed through the
share sheet, the data should be attributed to the app that opened the
share sheet, not Android System.

Bug: 180577866
Test: builds
Change-Id: If3193d476fa923b849b505ad8b6dd893a2feae8f
parent 22a93daf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -247,6 +247,7 @@ package android {
    field public static final String SEND_SMS_NO_CONFIRMATION = "android.permission.SEND_SMS_NO_CONFIRMATION";
    field public static final String SERIAL_PORT = "android.permission.SERIAL_PORT";
    field public static final String SET_ACTIVITY_WATCHER = "android.permission.SET_ACTIVITY_WATCHER";
    field public static final String SET_CLIP_SOURCE = "android.permission.SET_CLIP_SOURCE";
    field public static final String SET_HARMFUL_APP_WARNINGS = "android.permission.SET_HARMFUL_APP_WARNINGS";
    field public static final String SET_MEDIA_KEY_LISTENER = "android.permission.SET_MEDIA_KEY_LISTENER";
    field public static final String SET_ORIENTATION = "android.permission.SET_ORIENTATION";
+6 −0
Original line number Diff line number Diff line
@@ -5566,6 +5566,12 @@
    <permission android:name="android.permission.RENOUNCE_PERMISSIONS"
                android:protectionLevel="signature|privileged" />

    <!-- @SystemApi Allows the holder to set the source of the data when setting a clip on the
         clipboard.
         @hide -->
    <permission android:name="android.permission.SET_CLIP_SOURCE"
                android:protectionLevel="signature|recents" />

    <!-- Attribution for Geofencing service. -->
    <attribution android:tag="GeofencingService" android:label="@string/geofencing_service"/>
    <!-- Attribution for Country Detector. -->
+2 −0
Original line number Diff line number Diff line
@@ -486,6 +486,8 @@ applications that come with the platform
        <permission name="android.permission.READ_PEOPLE_DATA" />
        <!-- Permission required for CTS test - UiTranslationManagerTest -->
        <permission name="android.permission.MANAGE_UI_TRANSLATION" />
        <!-- Permission required for CTS test - ClipboardManagerTest -->
        <permission name="android.permission.SET_CLIP_SOURCE" />
    </privapp-permissions>

    <privapp-permissions package="com.android.statementservice">
+3 −0
Original line number Diff line number Diff line
@@ -421,6 +421,9 @@
    <!-- Permission required for CTS test - CtsGameManagerTestCases -->
    <uses-permission android:name="android.permission.MANAGE_GAME_MODE" />

    <!-- Permission required for CTS test - ClipboardManagerTest -->
    <uses-permission android:name="android.permission.SET_CLIP_SOURCE" />

    <application android:label="@string/app_label"
                android:theme="@android:style/Theme.DeviceDefault.DayNight"
                android:defaultToDeviceProtectedStorage="true"