[Wi-Fi] Use new defined proto field for adding new networks panel page.
Use new metric, PANEL_ADD_WIFI_NETWORKS, for proto upload log use. For R feature: Add a mechanism for apps to add saved networks to the device, need to apply new metrics category. Bug: 144891278 Test: Add following test case for testing metric: getMetricsCategory_shouldReturnPanelAddWifiNetworks() Change-Id: I7cde8057c5f2b01c951b1de4203ab1c1a2f0f40a
This commit is contained in:
@@ -164,7 +164,6 @@ public class AddAppNetworksFragment extends InstrumentedFragment {
|
||||
return inflater.inflate(R.layout.wifi_add_app_networks, container, false);
|
||||
}
|
||||
|
||||
// TODO: Makesure function work correctly after rotate.
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
@@ -585,8 +584,7 @@ public class AddAppNetworksFragment extends InstrumentedFragment {
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
// TODO(b/144891278): Need to define a new metric for this page, use the WIFI item first.
|
||||
return SettingsEnums.WIFI;
|
||||
return SettingsEnums.PANEL_ADD_WIFI_NETWORKS;
|
||||
}
|
||||
|
||||
private void showSaveStatusByState(int status) {
|
||||
|
@@ -21,6 +21,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.spy;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.net.wifi.WifiConfiguration;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
@@ -139,6 +140,12 @@ public class AddAppNetworksFragmentTest {
|
||||
0).mWifiConfiguration.SSID).isEqualTo(FAKE_NEW_OPEN_SSID);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMetricsCategory_shouldReturnPanelAddWifiNetworks() {
|
||||
assertThat(mAddAppNetworksFragment.getMetricsCategory()).isEqualTo(
|
||||
SettingsEnums.PANEL_ADD_WIFI_NETWORKS);
|
||||
}
|
||||
|
||||
private void addOneSavedNetworkConfig(@NonNull WifiConfiguration wifiConfiguration) {
|
||||
if (mFakeSavedNetworksList == null) {
|
||||
mFakeSavedNetworksList = new ArrayList<>();
|
||||
@@ -180,5 +187,4 @@ public class AddAppNetworksFragmentTest {
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user