Fixed a Null Pointer Error in Bluetooth Settings.
+ The root of the problem is that the callback for a device change may be set before the fragment has a layout. Then if a change does come in, getView() would return null. This fix delays registering the callback until appropiate. Bug: 17404518 Change-Id: Ibd0e90f82593d45729f427bcc2e40fe9195eb42a
This commit is contained in:
@@ -132,8 +132,8 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment
|
|||||||
public void setDevice(CachedBluetoothDevice cachedDevice) {
|
public void setDevice(CachedBluetoothDevice cachedDevice) {
|
||||||
mCachedDevice = cachedDevice;
|
mCachedDevice = cachedDevice;
|
||||||
|
|
||||||
mCachedDevice.registerCallback(this);
|
|
||||||
if (isResumed()) {
|
if (isResumed()) {
|
||||||
|
mCachedDevice.registerCallback(this);
|
||||||
addPreferencesForProfiles();
|
addPreferencesForProfiles();
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user