Fix bug: "Hotspot & Tethering" preference doesn't get updated
Aissign the value of mPrefrence when displayPrefrence() being called. This can fix the preference doesn't get updated bug. Added test to ensure it. Bug: 160169699 Test: make RunSettingsRoboTests ROBOTEST_FILTER=AllInOneTetherPreferenceController Change-Id: If0e7ce421cc46cff2b92837d2d07ea0ff4dc5fd9
This commit is contained in:
@@ -37,6 +37,7 @@ import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.Lifecycle.Event;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.lifecycle.OnLifecycleEvent;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
@@ -93,6 +94,12 @@ public class AllInOneTetherPreferenceController extends BasePreferenceController
|
||||
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
mPreference = screen.findPreference(mPreferenceKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (!TetherUtil.isTetherAvailable(mContext)
|
||||
|
Reference in New Issue
Block a user