private void persistCandidateDiscoveredDevices() { // TODO I don't think the MULTI_PROCESS flag is necessary SharedPreferences.Editor editor = getContext().getSharedPreferences( DeviceManager.KNOWN_BLUETOOTH_DEVICE_PREFERENCES, Context.MODE_MULTI_PROCESS).edit(); Set<String> candidates = new HashSet<String>(); for(Map.Entry<String, String> device : mDiscoveredDevices.entrySet()) { if(device.getValue().toUpperCase().startsWith( BluetoothVehicleInterface.DEVICE_NAME_PREFIX)) { candidates.add(device.getKey()); } } SupportSettingsUtils.putStringSet(editor, DeviceManager.KNOWN_BLUETOOTH_DEVICE_PREF_KEY, candidates); editor.commit(); } }