b/2482585 Bluetooth settings: remove "Scan for devices" from menu
Change-Id: I206794245a6afeb97366dd32e609f4e7f9374c20
This commit is contained in:
@@ -35,7 +35,6 @@ import android.preference.Preference;
|
|||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
import android.view.ContextMenu.ContextMenuInfo;
|
||||||
@@ -53,8 +52,6 @@ public class BluetoothSettings extends PreferenceActivity
|
|||||||
|
|
||||||
private static final String TAG = "BluetoothSettings";
|
private static final String TAG = "BluetoothSettings";
|
||||||
|
|
||||||
private static final int MENU_SCAN = Menu.FIRST;
|
|
||||||
|
|
||||||
private static final String KEY_BT_CHECKBOX = "bt_checkbox";
|
private static final String KEY_BT_CHECKBOX = "bt_checkbox";
|
||||||
private static final String KEY_BT_DISCOVERABLE = "bt_discoverable";
|
private static final String KEY_BT_DISCOVERABLE = "bt_discoverable";
|
||||||
private static final String KEY_BT_DEVICE_LIST = "bt_device_list";
|
private static final String KEY_BT_DEVICE_LIST = "bt_device_list";
|
||||||
@@ -216,33 +213,6 @@ public class BluetoothSettings extends PreferenceActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
menu.add(0, MENU_SCAN, 0, R.string.bluetooth_scan_for_devices)
|
|
||||||
.setIcon(com.android.internal.R.drawable.ic_menu_refresh)
|
|
||||||
.setAlphabeticShortcut('r');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
|
||||||
menu.findItem(MENU_SCAN).setEnabled(mLocalManager.getBluetoothAdapter().isEnabled());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
|
|
||||||
case MENU_SCAN:
|
|
||||||
mLocalManager.startScanning(true);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
|
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
|
||||||
Preference preference) {
|
Preference preference) {
|
||||||
|
Reference in New Issue
Block a user