Merge "Make AdvertiseResult object" into androidx-main
diff --git a/bluetooth/bluetooth/api/current.txt b/bluetooth/bluetooth/api/current.txt
index 004a624..066941b 100644
--- a/bluetooth/bluetooth/api/current.txt
+++ b/bluetooth/bluetooth/api/current.txt
@@ -22,16 +22,12 @@
}
public final class AdvertiseResult {
- ctor public AdvertiseResult();
field public static final int ADVERTISE_FAILED_DATA_TOO_LARGE = 102; // 0x66
field public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 103; // 0x67
field public static final int ADVERTISE_FAILED_INTERNAL_ERROR = 104; // 0x68
field public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = 105; // 0x69
field public static final int ADVERTISE_STARTED = 101; // 0x65
- field public static final androidx.bluetooth.AdvertiseResult.Companion Companion;
- }
-
- public static final class AdvertiseResult.Companion {
+ field public static final androidx.bluetooth.AdvertiseResult INSTANCE;
}
public final class BluetoothAddress {
diff --git a/bluetooth/bluetooth/api/restricted_current.txt b/bluetooth/bluetooth/api/restricted_current.txt
index 004a624..066941b 100644
--- a/bluetooth/bluetooth/api/restricted_current.txt
+++ b/bluetooth/bluetooth/api/restricted_current.txt
@@ -22,16 +22,12 @@
}
public final class AdvertiseResult {
- ctor public AdvertiseResult();
field public static final int ADVERTISE_FAILED_DATA_TOO_LARGE = 102; // 0x66
field public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 103; // 0x67
field public static final int ADVERTISE_FAILED_INTERNAL_ERROR = 104; // 0x68
field public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = 105; // 0x69
field public static final int ADVERTISE_STARTED = 101; // 0x65
- field public static final androidx.bluetooth.AdvertiseResult.Companion Companion;
- }
-
- public static final class AdvertiseResult.Companion {
+ field public static final androidx.bluetooth.AdvertiseResult INSTANCE;
}
public final class BluetoothAddress {
diff --git a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/AdvertiseResult.kt b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/AdvertiseResult.kt
index 69f8687..304bdd7 100644
--- a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/AdvertiseResult.kt
+++ b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/AdvertiseResult.kt
@@ -24,7 +24,7 @@
* An advertise result indicates the result of a request to start advertising, whether success
* or failure.
*/
-class AdvertiseResult {
+object AdvertiseResult {
@Target(AnnotationTarget.TYPE)
@RestrictTo(RestrictTo.Scope.LIBRARY)
@Retention(AnnotationRetention.SOURCE)
@@ -37,20 +37,18 @@
)
annotation class ResultType
- companion object {
- /** Advertise started successfully. */
- const val ADVERTISE_STARTED: Int = 101
+ /** Advertise started successfully. */
+ const val ADVERTISE_STARTED: Int = 101
- /** Advertise failed to start because the data is too large. */
- const val ADVERTISE_FAILED_DATA_TOO_LARGE: Int = 102
+ /** Advertise failed to start because the data is too large. */
+ const val ADVERTISE_FAILED_DATA_TOO_LARGE: Int = 102
- /** Advertise failed to start because the advertise feature is not supported. */
- const val ADVERTISE_FAILED_FEATURE_UNSUPPORTED: Int = 103
+ /** Advertise failed to start because the advertise feature is not supported. */
+ const val ADVERTISE_FAILED_FEATURE_UNSUPPORTED: Int = 103
- /** Advertise failed to start because of an internal error. */
- const val ADVERTISE_FAILED_INTERNAL_ERROR: Int = 104
+ /** Advertise failed to start because of an internal error. */
+ const val ADVERTISE_FAILED_INTERNAL_ERROR: Int = 104
- /** Advertise failed to start because of too many advertisers. */
- const val ADVERTISE_FAILED_TOO_MANY_ADVERTISERS: Int = 105
- }
+ /** Advertise failed to start because of too many advertisers. */
+ const val ADVERTISE_FAILED_TOO_MANY_ADVERTISERS: Int = 105
}