Loading core/java/android/provider/Settings.java +21 −0 Original line number Diff line number Diff line Loading @@ -6331,6 +6331,27 @@ public final class Settings { @Readable public static final String ALLOW_MOCK_LOCATION = "mock_location"; /** * This is used by Bluetooth Manager to store adapter name * @hide */ @Readable(maxTargetSdk = Build.VERSION_CODES.S) public static final String BLUETOOTH_NAME = "bluetooth_name"; /** * This is used by Bluetooth Manager to store adapter address * @hide */ @Readable(maxTargetSdk = Build.VERSION_CODES.S) public static final String BLUETOOTH_ADDRESS = "bluetooth_address"; /** * This is used by Bluetooth Manager to store whether adapter address is valid * @hide */ @Readable(maxTargetSdk = Build.VERSION_CODES.S) public static final String BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid"; /** * Setting to indicate that on device captions are enabled. * Loading services/core/java/com/android/server/BluetoothManagerService.java +8 −12 Original line number Diff line number Diff line Loading @@ -110,10 +110,6 @@ class BluetoothManagerService extends IBluetoothManager.Stub { private static final String BLUETOOTH_PRIVILEGED = android.Manifest.permission.BLUETOOTH_PRIVILEGED; private static final String SECURE_SETTINGS_BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid"; private static final String SECURE_SETTINGS_BLUETOOTH_ADDRESS = "bluetooth_address"; private static final String SECURE_SETTINGS_BLUETOOTH_NAME = "bluetooth_name"; private static final int ACTIVE_LOG_MAX_SIZE = 20; private static final int CRASH_LOG_MAX_SIZE = 100; Loading Loading @@ -636,7 +632,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { if (mContext.getResources() .getBoolean(com.android.internal.R.bool.config_bluetooth_address_validation) && Settings.Secure.getIntForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDR_VALID, 0, mUserId) Settings.Secure.BLUETOOTH_NAME, 0, mUserId) == 0) { // if the valid flag is not set, don't load the address and name if (DBG) { Loading @@ -645,9 +641,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub { return; } mName = Settings.Secure.getStringForUser( mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME, mUserId); mContentResolver, Settings.Secure.BLUETOOTH_NAME, mUserId); mAddress = Settings.Secure.getStringForUser( mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS, mUserId); mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS, mUserId); if (DBG) { Slog.d(TAG, "Stored bluetooth Name=" + mName + ",Address=" + mAddress); } Loading @@ -661,30 +657,30 @@ class BluetoothManagerService extends IBluetoothManager.Stub { */ private void storeNameAndAddress(String name, String address) { if (name != null) { Settings.Secure.putStringForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME, name, Settings.Secure.putStringForUser(mContentResolver, Settings.Secure.BLUETOOTH_NAME, name, mUserId); mName = name; if (DBG) { Slog.d(TAG, "Stored Bluetooth name: " + Settings.Secure.getStringForUser( mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME, mContentResolver, Settings.Secure.BLUETOOTH_NAME, mUserId)); } } if (address != null) { Settings.Secure.putStringForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS, Settings.Secure.putStringForUser(mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS, address, mUserId); mAddress = address; if (DBG) { Slog.d(TAG, "Stored Bluetoothaddress: " + Settings.Secure.getStringForUser( mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS, mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS, mUserId)); } } if ((name != null) && (address != null)) { Settings.Secure.putIntForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDR_VALID, 1, Settings.Secure.putIntForUser(mContentResolver, Settings.Secure.BLUETOOTH_ADDR_VALID, 1, mUserId); } } Loading Loading
core/java/android/provider/Settings.java +21 −0 Original line number Diff line number Diff line Loading @@ -6331,6 +6331,27 @@ public final class Settings { @Readable public static final String ALLOW_MOCK_LOCATION = "mock_location"; /** * This is used by Bluetooth Manager to store adapter name * @hide */ @Readable(maxTargetSdk = Build.VERSION_CODES.S) public static final String BLUETOOTH_NAME = "bluetooth_name"; /** * This is used by Bluetooth Manager to store adapter address * @hide */ @Readable(maxTargetSdk = Build.VERSION_CODES.S) public static final String BLUETOOTH_ADDRESS = "bluetooth_address"; /** * This is used by Bluetooth Manager to store whether adapter address is valid * @hide */ @Readable(maxTargetSdk = Build.VERSION_CODES.S) public static final String BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid"; /** * Setting to indicate that on device captions are enabled. * Loading
services/core/java/com/android/server/BluetoothManagerService.java +8 −12 Original line number Diff line number Diff line Loading @@ -110,10 +110,6 @@ class BluetoothManagerService extends IBluetoothManager.Stub { private static final String BLUETOOTH_PRIVILEGED = android.Manifest.permission.BLUETOOTH_PRIVILEGED; private static final String SECURE_SETTINGS_BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid"; private static final String SECURE_SETTINGS_BLUETOOTH_ADDRESS = "bluetooth_address"; private static final String SECURE_SETTINGS_BLUETOOTH_NAME = "bluetooth_name"; private static final int ACTIVE_LOG_MAX_SIZE = 20; private static final int CRASH_LOG_MAX_SIZE = 100; Loading Loading @@ -636,7 +632,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { if (mContext.getResources() .getBoolean(com.android.internal.R.bool.config_bluetooth_address_validation) && Settings.Secure.getIntForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDR_VALID, 0, mUserId) Settings.Secure.BLUETOOTH_NAME, 0, mUserId) == 0) { // if the valid flag is not set, don't load the address and name if (DBG) { Loading @@ -645,9 +641,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub { return; } mName = Settings.Secure.getStringForUser( mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME, mUserId); mContentResolver, Settings.Secure.BLUETOOTH_NAME, mUserId); mAddress = Settings.Secure.getStringForUser( mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS, mUserId); mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS, mUserId); if (DBG) { Slog.d(TAG, "Stored bluetooth Name=" + mName + ",Address=" + mAddress); } Loading @@ -661,30 +657,30 @@ class BluetoothManagerService extends IBluetoothManager.Stub { */ private void storeNameAndAddress(String name, String address) { if (name != null) { Settings.Secure.putStringForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME, name, Settings.Secure.putStringForUser(mContentResolver, Settings.Secure.BLUETOOTH_NAME, name, mUserId); mName = name; if (DBG) { Slog.d(TAG, "Stored Bluetooth name: " + Settings.Secure.getStringForUser( mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME, mContentResolver, Settings.Secure.BLUETOOTH_NAME, mUserId)); } } if (address != null) { Settings.Secure.putStringForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS, Settings.Secure.putStringForUser(mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS, address, mUserId); mAddress = address; if (DBG) { Slog.d(TAG, "Stored Bluetoothaddress: " + Settings.Secure.getStringForUser( mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS, mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS, mUserId)); } } if ((name != null) && (address != null)) { Settings.Secure.putIntForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDR_VALID, 1, Settings.Secure.putIntForUser(mContentResolver, Settings.Secure.BLUETOOTH_ADDR_VALID, 1, mUserId); } } Loading