Merge "Changes event handling phases for DeviceListPreferenceFragment."
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java
index 3dfcfc7..9b222fa 100644
--- a/src/com/android/settings/bluetooth/BluetoothSettings.java
+++ b/src/com/android/settings/bluetooth/BluetoothSettings.java
@@ -180,13 +180,13 @@
}
@Override
- public void onResume() {
- // resume BluetoothEnabler before calling super.onResume() so we don't get
+ public void onStart() {
+ // resume BluetoothEnabler before calling super.onStart() so we don't get
// any onDeviceAdded() callbacks before setting up view in updateContent()
if (mBluetoothEnabler != null) {
mBluetoothEnabler.resume(getActivity());
}
- super.onResume();
+ super.onStart();
mInitiateDiscoverable = true;
@@ -206,8 +206,8 @@
}
@Override
- public void onPause() {
- super.onPause();
+ public void onStop() {
+ super.onStop();
if (mBluetoothEnabler != null) {
mBluetoothEnabler.pause();
}
diff --git a/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java b/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
index e6fcbcb..c132163 100644
--- a/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
+++ b/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
@@ -98,8 +98,8 @@
abstract void addPreferencesForActivity();
@Override
- public void onResume() {
- super.onResume();
+ public void onStart() {
+ super.onStart();
if (mLocalManager == null || isUiRestricted()) return;
mLocalManager.setForegroundActivity(getActivity());
@@ -109,8 +109,8 @@
}
@Override
- public void onPause() {
- super.onPause();
+ public void onStop() {
+ super.onStop();
if (mLocalManager == null || isUiRestricted()) {
return;
}
diff --git a/src/com/android/settings/bluetooth/DevicePickerFragment.java b/src/com/android/settings/bluetooth/DevicePickerFragment.java
index 3fbd7bd..066f5d2 100644
--- a/src/com/android/settings/bluetooth/DevicePickerFragment.java
+++ b/src/com/android/settings/bluetooth/DevicePickerFragment.java
@@ -47,7 +47,7 @@
private boolean mNeedAuth;
private String mLaunchPackage;
private String mLaunchClass;
- private boolean mStartScanOnResume;
+ private boolean mStartScanOnStart;
@Override
void addPreferencesForActivity() {
@@ -94,18 +94,18 @@
super.onCreate(savedInstanceState);
getActivity().setTitle(getString(R.string.device_picker));
UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
- mStartScanOnResume = !um.hasUserRestriction(DISALLOW_CONFIG_BLUETOOTH)
+ mStartScanOnStart = !um.hasUserRestriction(DISALLOW_CONFIG_BLUETOOTH)
&& (savedInstanceState == null); // don't start scan after rotation
setHasOptionsMenu(true);
}
@Override
- public void onResume() {
- super.onResume();
+ public void onStart() {
+ super.onStart();
addCachedDevices();
- if (mStartScanOnResume) {
+ if (mStartScanOnStart) {
mLocalAdapter.startScanning(true);
- mStartScanOnResume = false;
+ mStartScanOnStart = false;
}
}