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

@@ -30,7 +30,7 @@ import android.view.View;
import android.widget.TextView;
/**
* RequestPermissionHelperActivity asks the user whether to enable discovery or advertisement.
* RequestPermissionHelperActivity asks the user whether to enable discovery.
* This is usually started by RequestPermissionActivity.
*/
public class RequestPermissionHelperActivity extends AlertActivity implements
@@ -43,9 +43,6 @@ public class RequestPermissionHelperActivity extends AlertActivity implements
public static final String ACTION_INTERNAL_REQUEST_BT_ON_AND_DISCOVERABLE =
"com.android.settings.bluetooth.ACTION_INTERNAL_REQUEST_BT_ON_AND_DISCOVERABLE";
public static final String ACTION_INTERNAL_REQUEST_BT_ON_AND_START_ADVERTISE =
"com.android.settings.bluetooth.ACTION_INTERNAL_REQUEST_BT_ON_AND_ADVERTISE";
private LocalBluetoothAdapter mLocalAdapter;
private int mTimeout;
@@ -53,7 +50,6 @@ public class RequestPermissionHelperActivity extends AlertActivity implements
// True if requesting BT to be turned on
// False if requesting BT to be turned on + discoverable mode
private boolean mEnableOnly;
private boolean mDiscovery;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -79,15 +75,12 @@ public class RequestPermissionHelperActivity extends AlertActivity implements
if (mEnableOnly) {
p.mMessage = getString(R.string.bluetooth_ask_enablement);
} else if (mDiscovery) {
} else {
if (mTimeout == BluetoothDiscoverableEnabler.DISCOVERABLE_TIMEOUT_NEVER) {
p.mMessage = getString(R.string.bluetooth_ask_enablement_and_lasting_discovery);
} else {
p.mMessage = getString(R.string.bluetooth_ask_enablement_and_discovery, mTimeout);
}
} else {
p.mMessage = getString(R.string.bluetooth_ask_enablement_and_start_broadcast,
Utils.getCallingApp(this));
}
p.mPositiveButtonText = getString(R.string.allow);
@@ -145,14 +138,9 @@ public class RequestPermissionHelperActivity extends AlertActivity implements
} else if (intent != null
&& intent.getAction().equals(ACTION_INTERNAL_REQUEST_BT_ON_AND_DISCOVERABLE)) {
mEnableOnly = false;
mDiscovery = true;
// Value used for display purposes. Not range checking.
mTimeout = intent.getIntExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,
BluetoothDiscoverableEnabler.DEFAULT_DISCOVERABLE_TIMEOUT);
} else if (intent != null
&& intent.getAction().equals(ACTION_INTERNAL_REQUEST_BT_ON_AND_START_ADVERTISE)) {
mEnableOnly = false;
mDiscovery = false;
} else {
setResult(RESULT_CANCELED);
return true;