Revert "BLE peripheral mode (4/4): Settings change for advertising preference."

This reverts commit eb56b9ccb8.

Conflicts:
	src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java
	src/com/android/settings/bluetooth/BluetoothSettings.java
	src/com/android/settings/bluetooth/LocalDeviceProfilesSettings.java

Change-Id: I2ce6b9eb0e335ba1b9aa4e1cb61a041f00d9aa87
This commit is contained in:
Wei Wang
2014-02-27 16:28:34 -08:00
parent ee4f84b0fb
commit 17d2124c1c
16 changed files with 52 additions and 579 deletions

View File

@@ -51,7 +51,9 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment {
private static final String TAG = "BluetoothSettings";
private static final int MENU_ID_SCAN = Menu.FIRST;
private static final int MENU_ID_SHOW_RECEIVED = Menu.FIRST + 1;
private static final int MENU_ID_RENAME_DEVICE = Menu.FIRST + 1;
private static final int MENU_ID_VISIBILITY_TIMEOUT = Menu.FIRST + 2;
private static final int MENU_ID_SHOW_RECEIVED = Menu.FIRST + 3;
/* Private intent to show the list of received files */
private static final String BTOPP_ACTION_OPEN_RECEIVED_FILES =
@@ -189,6 +191,12 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment {
menu.add(Menu.NONE, MENU_ID_SCAN, 0, textId)
.setEnabled(bluetoothIsEnabled && !isDiscovering)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
menu.add(Menu.NONE, MENU_ID_RENAME_DEVICE, 0, R.string.bluetooth_rename_device)
.setEnabled(bluetoothIsEnabled)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
menu.add(Menu.NONE, MENU_ID_VISIBILITY_TIMEOUT, 0, R.string.bluetooth_visibility_timeout)
.setEnabled(bluetoothIsEnabled)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
menu.add(Menu.NONE, MENU_ID_SHOW_RECEIVED, 0, R.string.bluetooth_show_received_files)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
super.onCreateOptionsMenu(menu, inflater);
@@ -203,6 +211,16 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment {
}
return true;
case MENU_ID_RENAME_DEVICE:
new BluetoothNameDialogFragment().show(
getFragmentManager(), "rename device");
return true;
case MENU_ID_VISIBILITY_TIMEOUT:
new BluetoothVisibilityTimeoutFragment().show(
getFragmentManager(), "visibility timeout");
return true;
case MENU_ID_SHOW_RECEIVED:
Intent intent = new Intent(BTOPP_ACTION_OPEN_RECEIVED_FILES);
getActivity().sendBroadcast(intent);
@@ -247,8 +265,7 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment {
// This device
if (mMyDevicePreference == null) {
mMyDevicePreference = new BluetoothLocalDevicePreference(
getActivity(), mLocalDeviceProfilesListener);
mMyDevicePreference = new Preference(getActivity());
}
mMyDevicePreference.setTitle(mLocalAdapter.getName());
if (getResources().getBoolean(com.android.internal.R.bool.config_voice_capable)) {
@@ -356,18 +373,6 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment {
updateContent(mLocalAdapter.getBluetoothState(), false);
}
// Listener for local device profile fragment.
private final View.OnClickListener mLocalDeviceProfilesListener = new View.OnClickListener() {
public void onClick(View v) {
if (isRestrictedAndNotPinProtected()) return;
((SettingsActivity) getActivity()).startPreferencePanel(
LocalDeviceProfilesSettings.class.getName(), null,
0, mLocalAdapter.getName(), null, 0);
}
};
private final View.OnClickListener mDeviceProfilesListener = new View.OnClickListener() {
public void onClick(View v) {
// User clicked on advanced options icon for a device in the list