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

Commit 92e7334d authored by Evan Chen's avatar Evan Chen
Browse files

Add trunk stable flag for Device Presence APIs

Test: Make
Fix: 306220015
Bug: 304478316
Change-Id: I2a69a5cba289305219d1fae4655d4c2c6b27f6e9
parent 671cd655
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -9641,13 +9641,13 @@ package android.companion {
    method @Deprecated @MainThread public void onDeviceAppeared(@NonNull android.companion.AssociationInfo);
    method @Deprecated @MainThread public void onDeviceDisappeared(@NonNull String);
    method @Deprecated @MainThread public void onDeviceDisappeared(@NonNull android.companion.AssociationInfo);
    method @MainThread public void onDeviceEvent(@NonNull android.companion.AssociationInfo, int);
    field public static final int DEVICE_EVENT_BLE_APPEARED = 0; // 0x0
    field public static final int DEVICE_EVENT_BLE_DISAPPEARED = 1; // 0x1
    field public static final int DEVICE_EVENT_BT_CONNECTED = 2; // 0x2
    field public static final int DEVICE_EVENT_BT_DISCONNECTED = 3; // 0x3
    field public static final int DEVICE_EVENT_SELF_MANAGED_APPEARED = 4; // 0x4
    field public static final int DEVICE_EVENT_SELF_MANAGED_DISAPPEARED = 5; // 0x5
    method @FlaggedApi("android.companion.device_presence") @MainThread public void onDeviceEvent(@NonNull android.companion.AssociationInfo, int);
    field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_BLE_APPEARED = 0; // 0x0
    field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_BLE_DISAPPEARED = 1; // 0x1
    field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_BT_CONNECTED = 2; // 0x2
    field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_BT_DISCONNECTED = 3; // 0x3
    field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_SELF_MANAGED_APPEARED = 4; // 0x4
    field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_SELF_MANAGED_DISAPPEARED = 5; // 0x5
    field public static final String SERVICE_INTERFACE = "android.companion.CompanionDeviceService";
  }
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

package android.companion;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.MainThread;
import android.annotation.NonNull;
@@ -140,24 +141,28 @@ public abstract class CompanionDeviceService extends Service {
     * Companion app receives {@link #onDeviceEvent(AssociationInfo, int)} callback
     * with this event if the device comes into BLE range.
     */
    @FlaggedApi(Flags.FLAG_DEVICE_PRESENCE)
    public static final int DEVICE_EVENT_BLE_APPEARED = 0;

    /**
     * Companion app receives {@link #onDeviceEvent(AssociationInfo, int)} callback
     * with this event if the device is no longer in BLE range.
     */
    @FlaggedApi(Flags.FLAG_DEVICE_PRESENCE)
    public static final int DEVICE_EVENT_BLE_DISAPPEARED = 1;

    /**
     * Companion app receives {@link #onDeviceEvent(AssociationInfo, int)} callback
     * with this event when the bluetooth device is connected.
     */
    @FlaggedApi(Flags.FLAG_DEVICE_PRESENCE)
    public static final int DEVICE_EVENT_BT_CONNECTED = 2;

    /**
     * Companion app receives {@link #onDeviceEvent(AssociationInfo, int)} callback
     * with this event if the bluetooth device is disconnected.
     */
    @FlaggedApi(Flags.FLAG_DEVICE_PRESENCE)
    public static final int DEVICE_EVENT_BT_DISCONNECTED = 3;

    /**
@@ -165,6 +170,7 @@ public abstract class CompanionDeviceService extends Service {
     * {@link #onDeviceEvent(AssociationInfo, int)} if it reports that a device has appeared on its
     * own.
     */
    @FlaggedApi(Flags.FLAG_DEVICE_PRESENCE)
    public static final int DEVICE_EVENT_SELF_MANAGED_APPEARED = 4;

    /**
@@ -172,6 +178,7 @@ public abstract class CompanionDeviceService extends Service {
     * {@link #onDeviceEvent(AssociationInfo, int)} if it reports that a device has disappeared on
     * its own.
     */
    @FlaggedApi(Flags.FLAG_DEVICE_PRESENCE)
    public static final int DEVICE_EVENT_SELF_MANAGED_DISAPPEARED = 5;

    private final Stub mRemote = new Stub();
@@ -348,6 +355,7 @@ public abstract class CompanionDeviceService extends Service {
     * @param associationInfo A record for the companion device.
     * @param event Associated companion device's event.
     */
    @FlaggedApi(Flags.FLAG_DEVICE_PRESENCE)
    @MainThread
    public void onDeviceEvent(@NonNull AssociationInfo associationInfo,
            @DeviceEvent int event) {
+8 −1
Original line number Diff line number Diff line
@@ -20,3 +20,10 @@ flag {
    description: "Enable Association tag APIs "
    bug: "289241123"
}

flag {
    name: "device_presence"
    namespace: "companion"
    description: "Enable device presence APIs"
    bug: "283000075"
}