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

Commit eb8d1be6 authored by John Spurlock's avatar John Spurlock
Browse files

Add a BIND_DREAM_SERVICE signature-level permission.

Starting in api 21, will be required to bind to a
declared dream or doze service.

Also added to aapt dump badging output.

Bug:15862654
Change-Id: Ifa0a594eeecf21e6146176c7810a847e1d08fe3b
parent 81af3aef
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ package android {
    field public static final java.lang.String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE";
    field public static final java.lang.String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET";
    field public static final java.lang.String BIND_DEVICE_ADMIN = "android.permission.BIND_DEVICE_ADMIN";
    field public static final java.lang.String BIND_DREAM_SERVICE = "android.permission.BIND_DREAM_SERVICE";
    field public static final java.lang.String BIND_INPUT_METHOD = "android.permission.BIND_INPUT_METHOD";
    field public static final java.lang.String BIND_NFC_SERVICE = "android.permission.BIND_NFC_SERVICE";
    field public static final java.lang.String BIND_NOTIFICATION_LISTENER_SERVICE = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE";
+13 −0
Original line number Diff line number Diff line
@@ -124,6 +124,19 @@ import com.android.internal.util.DumpUtils.Dump;
 *     }
 * }
 * </pre>
 *
 * <p>When targeting api level 21 and above, you must declare the service in your manifest file
 * with the {@link android.Manifest.permission#BIND_DREAM_SERVICE} permission. For example:</p>
 * <pre>
 * &lt;service
 *     android:name=".MyDream"
 *     android:exported="true"
 *     android:icon="@drawable/my_icon"
 *     android:label="@string/my_dream_label"
 *     android:permission="android.permission.BIND_DREAM_SERVICE" >
 *  ...
 * &lt;/service>
 * </pre>
 */
public class DreamService extends Service implements Window.Callback {
    private final String TAG = DreamService.class.getSimpleName() + "[" + getClass().getSimpleName() + "]";
+7 −0
Original line number Diff line number Diff line
@@ -2719,6 +2719,13 @@
        android:description="@string/permdesc_bindConditionProviderService"
        android:protectionLevel="signature" />

    <!-- Must be required by an {@link android.service.dreams.DreamService},
         to ensure that only the system can bind to it. -->
    <permission android:name="android.permission.BIND_DREAM_SERVICE"
        android:label="@string/permlab_bindDreamService"
        android:description="@string/permdesc_bindDreamService"
        android:protectionLevel="signature" />

    <!-- @SystemApi Allows an application to call into a carrier setup flow. It is up to the
         carrier setup application to enforce that this permission is required
         @hide This is not a third-party API (intended for OEMs and system apps). -->
+5 −0
Original line number Diff line number Diff line
@@ -2121,6 +2121,11 @@
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_bindConditionProviderService">Allows the holder to bind to the top-level interface of a condition provider service. Should never be needed for normal apps.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_bindDreamService">bind to a dream service</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_bindDreamService">Allows the holder to bind to the top-level interface of a dream service. Should never be needed for normal apps.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_invokeCarrierSetup">invoke the carrier-provided configuration app</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+3 −1
Original line number Diff line number Diff line
@@ -267,6 +267,7 @@
            android:name=".DessertCaseDream"
            android:exported="true"
            android:label="@string/dessert_case"
            android:permission="android.permission.BIND_DREAM_SERVICE"
            android:enabled="false"
            android:process=":sweetsweetdesserts"
            >
@@ -305,6 +306,7 @@
        <!-- I dream of notifications -->
        <service
            android:name=".doze.DozeService"
            android:exported="true" />
            android:exported="true"
            android:permission="android.permission.BIND_DREAM_SERVICE" />
    </application>
</manifest>
Loading