Added WifiSettings -> WifiSettings2 redirection behind feature flag
Use WifiSettings2 if settings_wifitracker2 feature flag is enabled. WifiSettings2 will be used for changes to WifiSettings to incorporate the WifiTracker2 refactor. Bug: 70983952 Test: make, set feature flag, open Wifi settings to verify new page opens. Change-Id: I08edc227bf38ab4b3b785180bf123815bf95da81
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
java_library {
|
||||
name: "settings-logtags",
|
||||
srcs: ["src/**/*.logtags"],
|
||||
static_libs: ["WifiTrackerLib"],
|
||||
}
|
||||
|
||||
// Build the Settings APK
|
||||
|
@@ -268,6 +268,26 @@
|
||||
android:value="true" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="Settings$WifiSettings2Activity"
|
||||
android:label="@string/wifi_settings"
|
||||
android:icon="@drawable/ic_settings_wireless"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:parentActivityName="Settings">
|
||||
<intent-filter android:priority="1">
|
||||
<action android:name="android.settings.WIFI_SETTINGS2" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter android:priority="1">
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="com.android.settings.SHORTCUT" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
||||
android:value="com.android.settings.wifi.WifiSettings2" />
|
||||
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
|
||||
android:value="true" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".wifi.WifiPickerActivity"
|
||||
android:parentActivityName="Settings">
|
||||
|
@@ -43,6 +43,7 @@ public class Settings extends SettingsActivity {
|
||||
public static class PrivateVolumeSettingsActivity extends SettingsActivity { /* empty */ }
|
||||
public static class PublicVolumeSettingsActivity extends SettingsActivity { /* empty */ }
|
||||
public static class WifiSettingsActivity extends SettingsActivity { /* empty */ }
|
||||
public static class WifiSettings2Activity extends SettingsActivity { /* empty */ }
|
||||
public static class WifiP2pSettingsActivity extends SettingsActivity { /* empty */ }
|
||||
public static class AvailableVirtualKeyboardActivity extends SettingsActivity { /* empty */ }
|
||||
public static class KeyboardLayoutPickerActivity extends SettingsActivity { /* empty */ }
|
||||
|
@@ -141,6 +141,7 @@ import com.android.settings.wifi.ConfigureWifiSettings;
|
||||
import com.android.settings.wifi.WifiAPITest;
|
||||
import com.android.settings.wifi.WifiInfo;
|
||||
import com.android.settings.wifi.WifiSettings;
|
||||
import com.android.settings.wifi.WifiSettings2;
|
||||
import com.android.settings.wifi.calling.WifiCallingDisclaimerFragment;
|
||||
import com.android.settings.wifi.calling.WifiCallingSettings;
|
||||
import com.android.settings.wifi.p2p.WifiP2pSettings;
|
||||
@@ -157,6 +158,7 @@ public class SettingsGateway {
|
||||
AdvancedConnectedDeviceDashboardFragment.class.getName(),
|
||||
CreateShortcut.class.getName(),
|
||||
WifiSettings.class.getName(),
|
||||
WifiSettings2.class.getName(),
|
||||
ConfigureWifiSettings.class.getName(),
|
||||
SavedAccessPointsWifiSettings.class.getName(),
|
||||
SimSettings.class.getName(),
|
||||
@@ -301,6 +303,7 @@ public class SettingsGateway {
|
||||
SupportDashboardActivity.class.getName(),
|
||||
// Home page > Network & Internet
|
||||
Settings.WifiSettingsActivity.class.getName(),
|
||||
Settings.WifiSettings2Activity.class.getName(),
|
||||
Settings.DataUsageSummaryActivity.class.getName(),
|
||||
// Home page > Connected devices
|
||||
Settings.BluetoothSettingsActivity.class.getName(),
|
||||
|
@@ -224,6 +224,12 @@ public class WifiSettings extends RestrictedSettingsFragment
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
|
||||
if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlagUtils.SETTINGS_WIFITRACKER2)) {
|
||||
getContext().startActivity(new Intent("android.settings.WIFI_SETTINGS2"));
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO(b/37429702): Add animations and preference comparator back after initial screen is
|
||||
// loaded (ODR).
|
||||
setAnimationAllowed(false);
|
||||
|
35
src/com/android/settings/wifi/WifiSettings2.java
Normal file
35
src/com/android/settings/wifi/WifiSettings2.java
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.wifi;
|
||||
|
||||
import static android.os.UserManager.DISALLOW_CONFIG_WIFI;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
|
||||
import com.android.settings.RestrictedSettingsFragment;
|
||||
|
||||
public class WifiSettings2 extends RestrictedSettingsFragment {
|
||||
|
||||
public WifiSettings2() {
|
||||
super(DISALLOW_CONFIG_WIFI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return SettingsEnums.WIFI;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user