Fix switch bar in location settings
When user rotates the device in location settings, the swtich bar with "Use Location" is gone. This change fixes the problem. Also, remove override getInitialExpandedChildCount() in LocationSettings. We will use nested PreferenceCategory instead once the support is ready. Bug: 73872033 Bug: 70843646 Test: Manual Change-Id: I343b549398ef2b3d64ca7962b5f2a4ef0441c7f5
This commit is contained in:
@@ -16,7 +16,6 @@ package com.android.settings.location;
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
import android.widget.Switch;
|
||||
|
||||
import com.android.settings.widget.SwitchBar;
|
||||
import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
@@ -48,12 +47,10 @@ public class LocationSwitchBarController implements SwitchBar.OnSwitchChangeList
|
||||
mSwitchBar.addOnSwitchChangeListener(this);
|
||||
mValidListener = true;
|
||||
}
|
||||
mSwitchBar.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
mSwitchBar.hide();
|
||||
if (mValidListener) {
|
||||
mSwitchBar.removeOnSwitchChangeListener(this);
|
||||
mValidListener = false;
|
||||
|
||||
Reference in New Issue
Block a user