Remove Index.java from old Search and its dependents
Test: make RunSettingsRoboTests Bug: 35763944, 36192909 Change-Id: If216e1eeb4c29e7372720c6228fa4e99ea2a9904
This commit is contained in:
@@ -38,8 +38,6 @@ import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.search.Index;
|
||||
import com.android.settings.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.HidProfile;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothProfile;
|
||||
@@ -250,17 +248,6 @@ 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.className = BluetoothSettings.class.getName();
|
||||
data.title = mCachedDevice.getName();
|
||||
data.screenTitle = context.getResources().getString(R.string.bluetooth_settings);
|
||||
data.iconResId = R.drawable.ic_settings_bluetooth;
|
||||
data.enabled = true;
|
||||
|
||||
Index.getInstance(context).updateFromSearchIndexableData(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -21,15 +21,12 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.widget.Switch;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
|
||||
import com.android.settings.search.Index;
|
||||
import com.android.settings.widget.SwitchWidgetController;
|
||||
import com.android.settingslib.WirelessUtils;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothAdapter;
|
||||
@@ -53,19 +50,6 @@ public final class BluetoothEnabler implements SwitchWidgetController.OnSwitchCh
|
||||
private static final int EVENT_UPDATE_INDEX = 0;
|
||||
private final int mMetricsEvent;
|
||||
|
||||
private Handler mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case EVENT_UPDATE_INDEX:
|
||||
final boolean isBluetoothOn = msg.getData().getBoolean(EVENT_DATA_IS_BT_ON);
|
||||
Index.getInstance(mContext).updateFromClassNameResource(
|
||||
BluetoothSettings.class.getName(), true, isBluetoothOn);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
@@ -142,7 +126,6 @@ public final class BluetoothEnabler implements SwitchWidgetController.OnSwitchCh
|
||||
case BluetoothAdapter.STATE_ON:
|
||||
setChecked(true);
|
||||
mSwitchWidget.setEnabled(true);
|
||||
updateSearchIndex(true);
|
||||
break;
|
||||
case BluetoothAdapter.STATE_TURNING_OFF:
|
||||
mSwitchWidget.setEnabled(false);
|
||||
@@ -150,12 +133,10 @@ public final class BluetoothEnabler implements SwitchWidgetController.OnSwitchCh
|
||||
case BluetoothAdapter.STATE_OFF:
|
||||
setChecked(false);
|
||||
mSwitchWidget.setEnabled(true);
|
||||
updateSearchIndex(false);
|
||||
break;
|
||||
default:
|
||||
setChecked(false);
|
||||
mSwitchWidget.setEnabled(true);
|
||||
updateSearchIndex(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,15 +154,6 @@ public final class BluetoothEnabler implements SwitchWidgetController.OnSwitchCh
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSearchIndex(boolean isBluetoothOn) {
|
||||
mHandler.removeMessages(EVENT_UPDATE_INDEX);
|
||||
|
||||
Message msg = new Message();
|
||||
msg.what = EVENT_UPDATE_INDEX;
|
||||
msg.getData().putBoolean(EVENT_DATA_IS_BT_ON, isBluetoothOn);
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSwitchToggled(boolean isChecked) {
|
||||
// Show toast message if Bluetooth is not allowed in airplane mode
|
||||
|
@@ -18,7 +18,6 @@ package com.android.settings.bluetooth;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.BluetoothProfile;
|
||||
import android.content.Context;
|
||||
@@ -117,10 +116,6 @@ public final class DeviceProfilesSettings extends InstrumentedDialogFragment imp
|
||||
break;
|
||||
case DialogInterface.BUTTON_NEUTRAL:
|
||||
mCachedDevice.unpair();
|
||||
com.android.settings.bluetooth.Utils.updateSearchIndex(getContext(),
|
||||
BluetoothSettings.class.getName(), mCachedDevice.getName(),
|
||||
getString(R.string.bluetooth_settings),
|
||||
R.drawable.ic_settings_bluetooth, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -27,8 +27,6 @@ import android.widget.Toast;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.search.Index;
|
||||
import com.android.settings.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager.BluetoothManagerCallback;
|
||||
import com.android.settingslib.bluetooth.Utils.ErrorListener;
|
||||
@@ -116,21 +114,6 @@ public final class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the search Index for a specific class name and resources.
|
||||
*/
|
||||
public static void updateSearchIndex(Context context, String className, String title,
|
||||
String screenTitle, int iconResId, boolean enabled) {
|
||||
SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||
data.className = className;
|
||||
data.title = title;
|
||||
data.screenTitle = screenTitle;
|
||||
data.iconResId = iconResId;
|
||||
data.enabled = enabled;
|
||||
|
||||
Index.getInstance(context).updateFromSearchIndexableData(data);
|
||||
}
|
||||
|
||||
public static LocalBluetoothManager getLocalBtManager(Context context) {
|
||||
return LocalBluetoothManager.getInstance(context, mOnInitCallback);
|
||||
}
|
||||
|
Reference in New Issue
Block a user