diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java index 80a3d1f01c7..12d25e5adb4 100644 --- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java +++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java @@ -35,6 +35,8 @@ import android.view.View.OnClickListener; import android.widget.ImageView; import com.android.settings.R; +import com.android.settings.search.Index; +import com.android.settings.search.SearchIndexableRaw; import java.util.List; @@ -209,6 +211,15 @@ public final class BluetoothDevicePreference extends Preference implements if (!mCachedDevice.startPairing()) { Utils.showError(getContext(), mCachedDevice.getName(), R.string.bluetooth_pairing_error_message); + } else { + final Context context = getContext(); + + SearchIndexableRaw data = new SearchIndexableRaw(context); + data.title = mCachedDevice.getName(); + data.screenTitle = context.getResources().getString(R.string.bluetooth_settings); + data.enabled = true; + + Index.getInstance(context).updateFromSearchIndexableData(data); } } diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java index 335d88835d4..821013d8974 100755 --- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java +++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java @@ -38,6 +38,8 @@ import android.widget.Button; import android.text.Editable; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; +import com.android.settings.search.Index; +import com.android.settings.search.SearchIndexableRaw; import java.util.HashMap; @@ -230,6 +232,14 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment if (key.equals(KEY_UNPAIR)) { unpairDevice(); finish(); + final Context context = preference.getContext(); + + SearchIndexableRaw data = new SearchIndexableRaw(context); + data.title = mCachedDevice.getName(); + data.screenTitle = context.getResources().getString(R.string.bluetooth_settings); + data.enabled = false; + + Index.getInstance(context).updateFromSearchIndexableData(data); return true; } diff --git a/src/com/android/settings/search/Index.java b/src/com/android/settings/search/Index.java index 138c896d4b9..374894b1741 100644 --- a/src/com/android/settings/search/Index.java +++ b/src/com/android/settings/search/Index.java @@ -239,8 +239,9 @@ public class Index { return result; } - private boolean updateFromSearchIndexableData(SearchIndexableData data) { + public boolean updateFromSearchIndexableData(SearchIndexableData data) { addIndexableData(data); + mDataToProcess.forceUpdate = true; return updateInternal(); }