Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +8 −19 Original line number Diff line number Diff line Loading @@ -806,14 +806,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { Log.d(TAG, "updateBroadcastInfoFromContentProvider: mContentResolver is null"); return; } String programInfo = Settings.Secure.getString( mContentResolver, Settings.Secure.BLUETOOTH_LE_BROADCAST_PROGRAM_INFO); if (programInfo == null) { programInfo = getDefaultValueOfProgramInfo(); } setProgramInfo(programInfo, /* updateContentResolver= */ false); String broadcastName = Settings.Secure.getString( mContentResolver, Settings.Secure.BLUETOOTH_LE_BROADCAST_NAME); Loading @@ -822,6 +814,14 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { } setBroadcastName(broadcastName, /* updateContentResolver= */ false); String programInfo = Settings.Secure.getString( mContentResolver, Settings.Secure.BLUETOOTH_LE_BROADCAST_PROGRAM_INFO); if (programInfo == null) { programInfo = broadcastName; } setProgramInfo(programInfo, /* updateContentResolver= */ false); String prefBroadcastCode = Settings.Secure.getString( mContentResolver, Settings.Secure.BLUETOOTH_LE_BROADCAST_CODE); Loading Loading @@ -1143,17 +1143,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { BROADCAST_NAME_PREFIX_MAX_LENGTH)) + UNDERLINE + postfix; } private String getDefaultValueOfProgramInfo() { // set the default value; int postfix = ThreadLocalRandom.current().nextInt(DEFAULT_CODE_MIN, DEFAULT_CODE_MAX); String name = BluetoothAdapter.getDefaultAdapter().getName(); if (name == null || name.isEmpty()) { name = DEFAULT_BROADCAST_NAME_PREFIX; } return (name.length() < BROADCAST_NAME_PREFIX_MAX_LENGTH ? name : name.substring(0, BROADCAST_NAME_PREFIX_MAX_LENGTH)) + UNDERLINE + postfix; } private byte[] getDefaultValueOfBroadcastCode() { // set the default value; return generateRandomPassword().getBytes(StandardCharsets.UTF_8); Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +8 −19 Original line number Diff line number Diff line Loading @@ -806,14 +806,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { Log.d(TAG, "updateBroadcastInfoFromContentProvider: mContentResolver is null"); return; } String programInfo = Settings.Secure.getString( mContentResolver, Settings.Secure.BLUETOOTH_LE_BROADCAST_PROGRAM_INFO); if (programInfo == null) { programInfo = getDefaultValueOfProgramInfo(); } setProgramInfo(programInfo, /* updateContentResolver= */ false); String broadcastName = Settings.Secure.getString( mContentResolver, Settings.Secure.BLUETOOTH_LE_BROADCAST_NAME); Loading @@ -822,6 +814,14 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { } setBroadcastName(broadcastName, /* updateContentResolver= */ false); String programInfo = Settings.Secure.getString( mContentResolver, Settings.Secure.BLUETOOTH_LE_BROADCAST_PROGRAM_INFO); if (programInfo == null) { programInfo = broadcastName; } setProgramInfo(programInfo, /* updateContentResolver= */ false); String prefBroadcastCode = Settings.Secure.getString( mContentResolver, Settings.Secure.BLUETOOTH_LE_BROADCAST_CODE); Loading Loading @@ -1143,17 +1143,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { BROADCAST_NAME_PREFIX_MAX_LENGTH)) + UNDERLINE + postfix; } private String getDefaultValueOfProgramInfo() { // set the default value; int postfix = ThreadLocalRandom.current().nextInt(DEFAULT_CODE_MIN, DEFAULT_CODE_MAX); String name = BluetoothAdapter.getDefaultAdapter().getName(); if (name == null || name.isEmpty()) { name = DEFAULT_BROADCAST_NAME_PREFIX; } return (name.length() < BROADCAST_NAME_PREFIX_MAX_LENGTH ? name : name.substring(0, BROADCAST_NAME_PREFIX_MAX_LENGTH)) + UNDERLINE + postfix; } private byte[] getDefaultValueOfBroadcastCode() { // set the default value; return generateRandomPassword().getBytes(StandardCharsets.UTF_8); Loading