Loading src/com/android/settings/bluetooth/BluetoothDevicePreference.java +9 −2 Original line number Diff line number Diff line Loading @@ -190,9 +190,8 @@ public final class BluetoothDevicePreference extends GearPreference { setTitle(mCachedDevice.getName()); try { ThreadUtils.postOnBackgroundThread(() -> { String summary = mCachedDevice.getConnectionSummary(); // Null check is done at the framework ThreadUtils.postOnMainThread(() -> setSummary(summary)); ThreadUtils.postOnMainThread(() -> setSummary(getConnectionSummary())); }); } catch (RejectedExecutionException e) { Log.w(TAG, "Handler thread unavailable, skipping getConnectionSummary!"); Loading Loading @@ -319,4 +318,12 @@ public final class BluetoothDevicePreference extends GearPreference { R.string.bluetooth_pairing_error_message); } } private String getConnectionSummary() { String summary = null; if (mCachedDevice.getBondState() != BluetoothDevice.BOND_NONE) { summary = mCachedDevice.getConnectionSummary(); } return summary; } } Loading
src/com/android/settings/bluetooth/BluetoothDevicePreference.java +9 −2 Original line number Diff line number Diff line Loading @@ -190,9 +190,8 @@ public final class BluetoothDevicePreference extends GearPreference { setTitle(mCachedDevice.getName()); try { ThreadUtils.postOnBackgroundThread(() -> { String summary = mCachedDevice.getConnectionSummary(); // Null check is done at the framework ThreadUtils.postOnMainThread(() -> setSummary(summary)); ThreadUtils.postOnMainThread(() -> setSummary(getConnectionSummary())); }); } catch (RejectedExecutionException e) { Log.w(TAG, "Handler thread unavailable, skipping getConnectionSummary!"); Loading Loading @@ -319,4 +318,12 @@ public final class BluetoothDevicePreference extends GearPreference { R.string.bluetooth_pairing_error_message); } } private String getConnectionSummary() { String summary = null; if (mCachedDevice.getBondState() != BluetoothDevice.BOND_NONE) { summary = mCachedDevice.getConnectionSummary(); } return summary; } }