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

Commit 2e998fc4 authored by Philip Junker's avatar Philip Junker Committed by Android (Google) Code Review
Browse files

Merge changes from topic "home_sound_exceptions" into sc-dev

* changes:
  Check if package matches home package and allow exceptions.
  Define private manifest flag for home sound exception and add permission
parents 956dd283 f3c1ab44
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -92,6 +92,7 @@ package android {
    field public static final String CREATE_USERS = "android.permission.CREATE_USERS";
    field public static final String CREATE_USERS = "android.permission.CREATE_USERS";
    field public static final String CRYPT_KEEPER = "android.permission.CRYPT_KEEPER";
    field public static final String CRYPT_KEEPER = "android.permission.CRYPT_KEEPER";
    field public static final String DEVICE_POWER = "android.permission.DEVICE_POWER";
    field public static final String DEVICE_POWER = "android.permission.DEVICE_POWER";
    field public static final String DISABLE_SYSTEM_SOUND_EFFECTS = "android.permission.DISABLE_SYSTEM_SOUND_EFFECTS";
    field public static final String DISPATCH_PROVISIONING_MESSAGE = "android.permission.DISPATCH_PROVISIONING_MESSAGE";
    field public static final String DISPATCH_PROVISIONING_MESSAGE = "android.permission.DISPATCH_PROVISIONING_MESSAGE";
    field public static final String DOMAIN_VERIFICATION_AGENT = "android.permission.DOMAIN_VERIFICATION_AGENT";
    field public static final String DOMAIN_VERIFICATION_AGENT = "android.permission.DOMAIN_VERIFICATION_AGENT";
    field public static final String ENTER_CAR_MODE_PRIORITIZED = "android.permission.ENTER_CAR_MODE_PRIORITIZED";
    field public static final String ENTER_CAR_MODE_PRIORITIZED = "android.permission.ENTER_CAR_MODE_PRIORITIZED";
@@ -311,6 +312,7 @@ package android {
    field public static final int hotwordDetectionService = 16844326; // 0x1010626
    field public static final int hotwordDetectionService = 16844326; // 0x1010626
    field public static final int isVrOnly = 16844152; // 0x1010578
    field public static final int isVrOnly = 16844152; // 0x1010578
    field public static final int minExtensionVersion = 16844305; // 0x1010611
    field public static final int minExtensionVersion = 16844305; // 0x1010611
    field public static final int playHomeTransitionSound = 16844358; // 0x1010646
    field public static final int requiredSystemPropertyName = 16844133; // 0x1010565
    field public static final int requiredSystemPropertyName = 16844133; // 0x1010565
    field public static final int requiredSystemPropertyValue = 16844134; // 0x1010566
    field public static final int requiredSystemPropertyValue = 16844134; // 0x1010566
    field public static final int sdkVersion = 16844304; // 0x1010610
    field public static final int sdkVersion = 16844304; // 0x1010610
+10 −1
Original line number Original line Diff line number Diff line
@@ -549,10 +549,19 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
     */
     */
    public static final int FLAG_INHERIT_SHOW_WHEN_LOCKED = 0x1;
    public static final int FLAG_INHERIT_SHOW_WHEN_LOCKED = 0x1;


    /**
     * Bit in {@link #privateFlags} indicating whether a home sound effect should be played if the
     * home app moves to front after the activity with this flag set.
     * Set from the {@link android.R.attr#playHomeTransitionSound} attribute.
     * @hide
     */
    public static final int PRIVATE_FLAG_HOME_TRANSITION_SOUND = 0x2;

    /**
    /**
     * Options that have been set in the activity declaration in the manifest.
     * Options that have been set in the activity declaration in the manifest.
     * These include:
     * These include:
     * {@link #FLAG_INHERIT_SHOW_WHEN_LOCKED}.
     * {@link #FLAG_INHERIT_SHOW_WHEN_LOCKED},
     * {@link #PRIVATE_FLAG_HOME_TRANSITION_SOUND}.
     * @hide
     * @hide
     */
     */
    public int privateFlags;
    public int privateFlags;
+4 −1
Original line number Original line Diff line number Diff line
@@ -149,7 +149,10 @@ public class ParsedActivityUtils {
                        | flag(ActivityInfo.FLAG_TURN_SCREEN_ON, R.styleable.AndroidManifestActivity_turnScreenOn, sa)
                        | flag(ActivityInfo.FLAG_TURN_SCREEN_ON, R.styleable.AndroidManifestActivity_turnScreenOn, sa)
                        | flag(ActivityInfo.FLAG_PREFER_MINIMAL_POST_PROCESSING, R.styleable.AndroidManifestActivity_preferMinimalPostProcessing, sa);
                        | flag(ActivityInfo.FLAG_PREFER_MINIMAL_POST_PROCESSING, R.styleable.AndroidManifestActivity_preferMinimalPostProcessing, sa);


                activity.privateFlags |= flag(ActivityInfo.FLAG_INHERIT_SHOW_WHEN_LOCKED, R.styleable.AndroidManifestActivity_inheritShowWhenLocked, sa);
                activity.privateFlags |= flag(ActivityInfo.FLAG_INHERIT_SHOW_WHEN_LOCKED,
                        R.styleable.AndroidManifestActivity_inheritShowWhenLocked, sa)
                        | flag(ActivityInfo.PRIVATE_FLAG_HOME_TRANSITION_SOUND,
                        R.styleable.AndroidManifestActivity_playHomeTransitionSound, true, sa);


                activity.colorMode = sa.getInt(R.styleable.AndroidManifestActivity_colorMode, ActivityInfo.COLOR_MODE_DEFAULT);
                activity.colorMode = sa.getInt(R.styleable.AndroidManifestActivity_colorMode, ActivityInfo.COLOR_MODE_DEFAULT);
                activity.documentLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_documentLaunchMode, ActivityInfo.DOCUMENT_LAUNCH_NONE);
                activity.documentLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_documentLaunchMode, ActivityInfo.DOCUMENT_LAUNCH_NONE);
+7 −0
Original line number Original line Diff line number Diff line
@@ -4440,6 +4440,13 @@
    <permission android:name="android.permission.MODIFY_DEFAULT_AUDIO_EFFECTS"
    <permission android:name="android.permission.MODIFY_DEFAULT_AUDIO_EFFECTS"
        android:protectionLevel="signature|privileged" />
        android:protectionLevel="signature|privileged" />


    <!-- @SystemApi Allows an application to disable system sound effects when the user exits one of
         the application's activities.
         <p>Not for use by third-party applications.</p>
         @hide -->
    <permission android:name="android.permission.DISABLE_SYSTEM_SOUND_EFFECTS"
        android:protectionLevel="signature|privileged" />

    <!-- @SystemApi Allows an application to provide remote displays.
    <!-- @SystemApi Allows an application to provide remote displays.
         <p>Not for use by third-party applications.</p>
         <p>Not for use by third-party applications.</p>
         @hide -->
         @hide -->
+7 −0
Original line number Original line Diff line number Diff line
@@ -2862,6 +2862,13 @@
            {@link android.content.Context#sendBroadcast(Intent, String)} being used.
            {@link android.content.Context#sendBroadcast(Intent, String)} being used.
            Multiple tags can be specified separated by '|'. -->
            Multiple tags can be specified separated by '|'. -->
        <attr name="attributionTags"/>
        <attr name="attributionTags"/>
        <!-- Specifies whether a home sound effect should be played if the home app moves to
             front after an activity with this flag set to <code>true</code>.
             <p>The default value of this attribute is <code>true</code>.
             <p>Also note that home sounds are only played if the device supports home sounds,
             usually TVs.
             <p>Requires permission {@code android.permission.DISABLE_SYSTEM_SOUND_EFFECTS}. -->
        <attr name="playHomeTransitionSound" format="boolean"/>
    </declare-styleable>
    </declare-styleable>


    <!-- The <code>activity-alias</code> tag declares a new
    <!-- The <code>activity-alias</code> tag declares a new
Loading