Added a screen to configure wireless scanning
- Created "Scanning" preference screen - Added overflow menu on "Location" settings to access "Scanning" settings - Moved "Wi-Fi scanning always available" from Wi-Fi settings to "Scanning" settings - Added "Bluetooth scanning always available" preference (UI only) Change-Id: I85d8cd60ab309db5db9caee43f4b5a117192d904
This commit is contained in:
@@ -29,6 +29,9 @@ import android.preference.PreferenceCategory;
|
||||
import android.preference.PreferenceGroup;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.Switch;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -66,6 +69,8 @@ public class LocationSettings extends LocationSettingsBase
|
||||
/** Key for preference category "Location services" */
|
||||
private static final String KEY_LOCATION_SERVICES = "location_services";
|
||||
|
||||
private static final int MENU_SCANNING = Menu.FIRST;
|
||||
|
||||
private SwitchBar mSwitchBar;
|
||||
private Switch mSwitch;
|
||||
private boolean mValidListener = false;
|
||||
@@ -249,6 +254,28 @@ public class LocationSettings extends LocationSettingsBase
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
menu.add(0, MENU_SCANNING, 0, R.string.location_menu_scanning);
|
||||
// The super class adds "Help & Feedback" menu item.
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
final SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
switch (item.getItemId()) {
|
||||
case MENU_SCANNING:
|
||||
activity.startPreferencePanel(
|
||||
ScanningSettings.class.getName(), null,
|
||||
R.string.location_scanning_screen_title, null, LocationSettings.this,
|
||||
0);
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHelpResource() {
|
||||
return R.string.help_url_location_access;
|
||||
|
Reference in New Issue
Block a user