Loading core/api/current.txt +7 −7 Original line number Diff line number Diff line Loading @@ -9644,13 +9644,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"; } core/java/android/companion/CompanionDeviceService.java +8 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.companion; import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.MainThread; import android.annotation.NonNull; Loading Loading @@ -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; /** Loading @@ -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; /** Loading @@ -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(); Loading Loading @@ -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) { Loading core/java/android/companion/flags.aconfig +8 −1 Original line number Diff line number Diff line Loading @@ -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" } Loading
core/api/current.txt +7 −7 Original line number Diff line number Diff line Loading @@ -9644,13 +9644,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"; }
core/java/android/companion/CompanionDeviceService.java +8 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.companion; import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.MainThread; import android.annotation.NonNull; Loading Loading @@ -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; /** Loading @@ -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; /** Loading @@ -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(); Loading Loading @@ -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) { Loading
core/java/android/companion/flags.aconfig +8 −1 Original line number Diff line number Diff line Loading @@ -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" }