From 547853d4c34bf121c7be0faa9979034d5e101bfd Mon Sep 17 00:00:00 2001 From: Pulkit Bhuwalka Date: Mon, 25 Sep 2017 17:55:12 -0700 Subject: Persist Bluetooth CoD config value across reboot Create new Settings key for storage and update the API doc. Bug: 36015415 Test: Verified by storing a value through a test app and restarting the machine to ensure it's picked up. Change-Id: I94aa054e525c4656bb3a824a29cae9c88f8904e0 --- core/java/android/bluetooth/BluetoothAdapter.java | 6 ++++-- core/java/android/provider/Settings.java | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 84765f6d7280..5c26232726bf 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1134,8 +1134,10 @@ public final class BluetoothAdapter { } /** - * Sets the {@link BluetoothClass} Bluetooth Class of Device (CoD) of - * the local Bluetooth adapter. + * Sets the {@link BluetoothClass} Bluetooth Class of Device (CoD) of the local Bluetooth + * adapter. + * + *

Note: This value persists across system reboot. * * @param bluetoothClass {@link BluetoothClass} to set the local Bluetooth adapter to. * @return true if successful, false if unsuccessful. diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 74bb618976b7..4b95bf8e6d61 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -7402,6 +7402,13 @@ public final class Settings { */ public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; + /** + * An integer representing the Bluetooth Class of Device (CoD). + * + * @hide + */ + public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; + /** * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. * See {@link android.bluetooth.BluetoothProfile}. -- cgit v1.2.3-59-g8ed1b