diff --git a/src/com/android/settings/bluetooth/LocalBluetoothPreferences.java b/src/com/android/settings/bluetooth/LocalBluetoothPreferences.java index 6a0bdcf4b21..5ada9658fbf 100644 --- a/src/com/android/settings/bluetooth/LocalBluetoothPreferences.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothPreferences.java @@ -148,6 +148,20 @@ final class LocalBluetoothPreferences { editor.apply(); } + static void persistDiscoveringTimestamp(final Context context) { + // Load the shared preferences and edit it on a background + // thread (but serialized!). + QueuedWork.queue(new Runnable() { + public void run() { + SharedPreferences.Editor editor = getSharedPreferences(context).edit(); + editor.putLong( + KEY_DISCOVERING_TIMESTAMP, + System.currentTimeMillis()); + editor.apply(); + } + }, false); + } + static boolean hasDockAutoConnectSetting(Context context, String addr) { return getSharedPreferences(context).contains(KEY_DOCK_AUTO_CONNECT + addr); }