Update wifi p2p to direct user to enable location
Location is required for Wifi Direct so if it is not enabled we disable the preference. Additionally, this fixes some minor update issues in Wifi Wakeup that was also affecting wifi p2p. Basically they weren't updating when location settings changed until you left the screen and came back. Now they do. Test: robotests, manual Bug: 120552223 Change-Id: Ibd386fcfbef881cae3d871152675f1cab5e4a041
This commit is contained in:
@@ -34,6 +34,7 @@ import androidx.preference.SwitchPreference;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -53,12 +54,14 @@ public class WifiWakeupPreferenceControllerTest {
|
||||
private LocationManager mLocationManager;
|
||||
@Mock
|
||||
private SwitchPreference mPreference;
|
||||
@Mock
|
||||
private Lifecycle mLifecycle;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mController = new WifiWakeupPreferenceController(mContext, mFragment);
|
||||
mController = new WifiWakeupPreferenceController(mContext, mFragment, mLifecycle);
|
||||
mController.mLocationManager = mLocationManager;
|
||||
mController.mPreference = mPreference;
|
||||
|
||||
|
Reference in New Issue
Block a user