Use new apply() instead of commit().
apply() starts an async disk write and doesn't have a return value but is otherwise identical in observable effects. Change-Id: I0f528607319d7eb5136bb11fce0b24d8741ccdf9
This commit is contained in:
@@ -356,7 +356,7 @@ public class LocalBluetoothManager {
|
||||
deviceAddress);
|
||||
editor.putLong(LocalBluetoothManager.SHARED_PREFERENCES_KEY_LAST_SELECTED_DEVICE_TIME,
|
||||
System.currentTimeMillis());
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public boolean hasDockAutoConnectSetting(String addr) {
|
||||
@@ -371,12 +371,12 @@ public class LocalBluetoothManager {
|
||||
public void saveDockAutoConnectSetting(String addr, boolean autoConnect) {
|
||||
SharedPreferences.Editor editor = getSharedPreferences().edit();
|
||||
editor.putBoolean(SHARED_PREFERENCES_KEY_DOCK_AUTO_CONNECT + addr, autoConnect);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public void removeDockAutoConnectSetting(String addr) {
|
||||
SharedPreferences.Editor editor = getSharedPreferences().edit();
|
||||
editor.remove(SHARED_PREFERENCES_KEY_DOCK_AUTO_CONNECT + addr);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user