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

Commit f729fb2f authored by Chris Li's avatar Chris Li
Browse files

Add ActivityEmbedding Property key

Allow apps to define ActivityEmbedding related flags in AndroidManifest
using <property> tags, so that the system can read the info before the
apps launch.

The property is for apps to provide consent to allow the System to
override ActivityEmbedding rules for the apps.

Bug: 236778622
Test: atest
      CtsWindowManagerJetpackTestCases:ActivityEmbeddingPropertyTests
Change-Id: Ibd5f9ed41b94de0bf9ff2c81a7ffa19d1067b769
parent 9475638a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -51530,6 +51530,7 @@ package android.view {
    method public default boolean isCrossWindowBlurEnabled();
    method public default void removeCrossWindowBlurEnabledListener(@NonNull java.util.function.Consumer<java.lang.Boolean>);
    method public void removeViewImmediate(android.view.View);
    field public static final String PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE = "android.window.PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE";
  }
  public static class WindowManager.BadTokenException extends java.lang.RuntimeException {
+27 −0
Original line number Diff line number Diff line
@@ -819,6 +819,33 @@ public interface WindowManager extends ViewManager {
     */
    public static final String PARCEL_KEY_SHORTCUTS_ARRAY = "shortcuts_array";

    /**
     * Application level {@link android.content.pm.PackageManager.Property} tag for developers to
     * provide consent for their app to allow OEMs to manually provide ActivityEmbedding split
     * rule configuration on behalf of the app.
     *
     * <p>If {@code true}, the system CAN override the windowing behaviors for the app, such as
     * showing some activities side-by-side. In this case, it will report that ActivityEmbedding
     * APIs are disabled for the app to avoid conflict.
     *
     * <p>If {@code false}, the system MUST NOT override the window behavior for the app. It should
     * be used if the app wants to provide their own ActivityEmbedding split rules, or if the app
     * wants to opt-out of system overrides for any other reason.
     *
     * <p>Default is {@code false}.
     *
     * <p>Example usage:
     * <pre>
     * &lt;application&gt;
     *   &lt;property
     *     android:name="android.window.PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE"
     *     android:value="true|false"/&gt;
     * &lt;/application&gt;
     * </pre>
     */
    String PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE =
            "android.window.PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE";

    /**
     * Request for keyboard shortcuts to be retrieved asynchronously.
     *