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

Commit ab561254 authored by Lucas Silva's avatar Lucas Silva Committed by Android (Google) Code Review
Browse files

Merge changes I3bef6699,I25ee2026 into main

* changes:
  API to notify controls provider which surface they are shown on
  Add a home panel dream flag
parents 89f4a3e5 58bb1949
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ aconfig_srcjars = [
    ":android.credentials.flags-aconfig-java{.generated_srcjars}",
    ":android.view.contentprotection.flags-aconfig-java{.generated_srcjars}",
    ":com.android.server.flags.pinner-aconfig-java{.generated_srcjars}",
    ":android.service.controls.flags-aconfig-java{.generated_srcjars}",
    ":android.service.voice.flags-aconfig-java{.generated_srcjars}",
    ":android.media.tv.flags-aconfig-java{.generated_srcjars}",
    ":android.service.autofill.flags-aconfig-java{.generated_srcjars}",
@@ -598,6 +599,19 @@ java_aconfig_library {
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Controls
aconfig_declarations {
    name: "android.service.controls.flags-aconfig",
    package: "android.service.controls.flags",
    srcs: ["core/java/android/service/controls/flags/*.aconfig"],
}

java_aconfig_library {
    name: "android.service.controls.flags-aconfig-java",
    aconfig_declarations: "android.service.controls.flags-aconfig",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Voice
aconfig_declarations {
    name: "android.service.voice.flags-aconfig",
+3 −0
Original line number Diff line number Diff line
@@ -40109,6 +40109,9 @@ package android.service.controls {
    method public final boolean onUnbind(@NonNull android.content.Intent);
    method public abstract void performControlAction(@NonNull String, @NonNull android.service.controls.actions.ControlAction, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method public static void requestAddControl(@NonNull android.content.Context, @NonNull android.content.ComponentName, @NonNull android.service.controls.Control);
    field @FlaggedApi("android.service.controls.flags.home_panel_dream") public static final int CONTROLS_SURFACE_ACTIVITY_PANEL = 0; // 0x0
    field @FlaggedApi("android.service.controls.flags.home_panel_dream") public static final int CONTROLS_SURFACE_DREAM = 1; // 0x1
    field @FlaggedApi("android.service.controls.flags.home_panel_dream") public static final String EXTRA_CONTROLS_SURFACE = "android.service.controls.extra.CONTROLS_SURFACE";
    field public static final String EXTRA_LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS = "android.service.controls.extra.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS";
    field public static final String META_DATA_PANEL_ACTIVITY = "android.service.controls.META_DATA_PANEL_ACTIVITY";
    field public static final String SERVICE_CONTROLS = "android.service.controls.ControlsProviderService";
+39 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
package android.service.controls;

import android.Manifest;
import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
@@ -33,12 +35,15 @@ import android.os.Message;
import android.os.RemoteException;
import android.service.controls.actions.ControlAction;
import android.service.controls.actions.ControlActionWrapper;
import android.service.controls.flags.Flags;
import android.service.controls.templates.ControlTemplate;
import android.text.TextUtils;
import android.util.Log;

import com.android.internal.util.Preconditions;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
import java.util.concurrent.Flow.Publisher;
import java.util.concurrent.Flow.Subscriber;
@@ -82,6 +87,40 @@ public abstract class ControlsProviderService extends Service {
    public static final String EXTRA_LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS =
            "android.service.controls.extra.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS";

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef({CONTROLS_SURFACE_ACTIVITY_PANEL, CONTROLS_SURFACE_DREAM})
    public @interface ControlsSurface {
    }

    /**
     * Controls are being shown on the device controls activity panel.
     */
    @FlaggedApi(Flags.FLAG_HOME_PANEL_DREAM)
    public static final int CONTROLS_SURFACE_ACTIVITY_PANEL = 0;

    /**
     * Controls are being shown as a dream, while the device is idle.
     */
    @FlaggedApi(Flags.FLAG_HOME_PANEL_DREAM)
    public static final int CONTROLS_SURFACE_DREAM = 1;

    /**
     * Integer extra whose value specifies the surface which controls are being displayed on.
     * <p>
     * The possible values are:
     * <ul>
     * <li>{@link #CONTROLS_SURFACE_ACTIVITY_PANEL}
     * <li>{@link #CONTROLS_SURFACE_DREAM}
     * </ul>
     *
     * This is passed with the intent when the panel specified by {@link #META_DATA_PANEL_ACTIVITY}
     * is launched.
     */
    @FlaggedApi(Flags.FLAG_HOME_PANEL_DREAM)
    public static final String EXTRA_CONTROLS_SURFACE =
            "android.service.controls.extra.CONTROLS_SURFACE";

    /**
     * @hide
     */
+8 −0
Original line number Diff line number Diff line
package: "android.service.controls.flags"

flag {
    name: "home_panel_dream"
    namespace: "systemui"
    description: "Enables the home controls dream feature."
    bug: "298025023"
}