Add feature flag for connected device
Add feature flag to toggle connected device between new and old feature. ConnectedDeviceDashboardFragment will contain new feature will ConnectedDeviceDashboardFragment2 will hold old feature. Bug: 69333961 Test: Build Change-Id: I0ea932c69dea5242129aab994d5142b1f87fbea0
This commit is contained in:
@@ -202,6 +202,31 @@
|
||||
android:value="true" />
|
||||
</activity>
|
||||
|
||||
<activity android:name=".Settings$ConnectedDeviceDashboardActivityOld"
|
||||
android:taskAffinity="com.android.settings"
|
||||
android:label="@string/connected_devices_dashboard_title"
|
||||
android:icon="@drawable/ic_devices_other"
|
||||
android:parentActivityName="Settings">
|
||||
<intent-filter android:priority="1">
|
||||
<action android:name="android.settings.NFC_SETTINGS" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.VOICE_LAUNCH" />
|
||||
</intent-filter>
|
||||
<intent-filter android:priority="10">
|
||||
<action android:name="com.android.settings.action.SETTINGS"/>
|
||||
</intent-filter>
|
||||
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
||||
android:value="com.android.settings.connecteddevice.ConnectedDeviceDashboardFragmentOld"/>
|
||||
<meta-data android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.homepage"/>
|
||||
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
|
||||
android:value="true" />
|
||||
</activity>
|
||||
|
||||
<activity android:name="AirplaneModeVoiceActivity"
|
||||
android:label="@string/wireless_networks_settings_title"
|
||||
android:theme="@*android:style/Theme.DeviceDefault.Light.Voice"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2016 The Android Open Source Project
|
||||
<!-- Copyright (C) 2017 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.
|
||||
@@ -19,45 +19,4 @@
|
||||
android:key="connected_devices_screen"
|
||||
android:title="@string/connected_devices_dashboard_title">
|
||||
|
||||
<com.android.settings.widget.MasterSwitchPreference
|
||||
android:key="toggle_bluetooth"
|
||||
android:title="@string/bluetooth_settings_title"
|
||||
android:icon="@drawable/ic_settings_bluetooth"
|
||||
android:order="-7"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="toggle_nfc"
|
||||
android:title="@string/nfc_quick_toggle_title"
|
||||
android:icon="@drawable/ic_nfc"
|
||||
android:summary="@string/nfc_quick_toggle_summary"
|
||||
android:order="-5"/>
|
||||
|
||||
<com.android.settingslib.RestrictedPreference
|
||||
android:fragment="com.android.settings.nfc.AndroidBeam"
|
||||
android:key="android_beam_settings"
|
||||
android:title="@string/android_beam_settings_title"
|
||||
android:icon="@drawable/ic_android"
|
||||
android:order="-4"/>
|
||||
|
||||
<Preference
|
||||
android:key="sms_mirroring"
|
||||
android:title="@string/sms_mirroring_pref"
|
||||
android:icon="@drawable/ic_sms_mirroring_24dp"
|
||||
android:summary="@string/summary_placeholder"
|
||||
android:order="-3"/>
|
||||
|
||||
<Preference
|
||||
android:key="usb_mode"
|
||||
android:title="@string/usb_pref"
|
||||
android:icon="@drawable/ic_usb"
|
||||
android:order="-2">
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="com.android.settings"
|
||||
android:targetClass="com.android.settings.deviceinfo.UsbModeChooserActivity"/>
|
||||
</Preference>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="dashboard_tile_placeholder"
|
||||
android:order="50"/>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
63
res/xml/connected_devices_old.xml
Normal file
63
res/xml/connected_devices_old.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2016 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.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:key="connected_devices_screen"
|
||||
android:title="@string/connected_devices_dashboard_title">
|
||||
|
||||
<com.android.settings.widget.MasterSwitchPreference
|
||||
android:key="toggle_bluetooth"
|
||||
android:title="@string/bluetooth_settings_title"
|
||||
android:icon="@drawable/ic_settings_bluetooth"
|
||||
android:order="-7"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="toggle_nfc"
|
||||
android:title="@string/nfc_quick_toggle_title"
|
||||
android:icon="@drawable/ic_nfc"
|
||||
android:summary="@string/nfc_quick_toggle_summary"
|
||||
android:order="-5"/>
|
||||
|
||||
<com.android.settingslib.RestrictedPreference
|
||||
android:fragment="com.android.settings.nfc.AndroidBeam"
|
||||
android:key="android_beam_settings"
|
||||
android:title="@string/android_beam_settings_title"
|
||||
android:icon="@drawable/ic_android"
|
||||
android:order="-4"/>
|
||||
|
||||
<Preference
|
||||
android:key="sms_mirroring"
|
||||
android:title="@string/sms_mirroring_pref"
|
||||
android:icon="@drawable/ic_sms_mirroring_24dp"
|
||||
android:summary="@string/summary_placeholder"
|
||||
android:order="-3"/>
|
||||
|
||||
<Preference
|
||||
android:key="usb_mode"
|
||||
android:title="@string/usb_pref"
|
||||
android:icon="@drawable/ic_usb"
|
||||
android:order="-2">
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="com.android.settings"
|
||||
android:targetClass="com.android.settings.deviceinfo.UsbModeChooserActivity"/>
|
||||
</Preference>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="dashboard_tile_placeholder"
|
||||
android:order="50"/>
|
||||
|
||||
</PreferenceScreen>
|
@@ -16,7 +16,10 @@
|
||||
|
||||
package com.android.settings;
|
||||
|
||||
import static com.android.settings.core.FeatureFlags.CONNECTED_DEVICE_V2;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import com.android.settings.enterprise.EnterprisePrivacySettings;
|
||||
|
||||
@@ -165,7 +168,12 @@ public class Settings extends SettingsActivity {
|
||||
|
||||
// Top level categories for new IA
|
||||
public static class NetworkDashboardActivity extends SettingsActivity {}
|
||||
public static class ConnectedDeviceDashboardActivity extends SettingsActivity {}
|
||||
public static class ConnectedDeviceDashboardActivity extends SettingsActivity {
|
||||
public static final boolean isEnabled() {
|
||||
return FeatureFlagUtils.isEnabled(null /* context */, CONNECTED_DEVICE_V2);
|
||||
}
|
||||
}
|
||||
public static class ConnectedDeviceDashboardActivityOld extends SettingsActivity {}
|
||||
public static class AppAndNotificationDashboardActivity extends SettingsActivity {}
|
||||
public static class StorageDashboardActivity extends SettingsActivity {}
|
||||
public static class UserAndAccountDashboardActivity extends SettingsActivity {}
|
||||
|
@@ -789,6 +789,21 @@ public class SettingsActivity extends SettingsDrawerActivity
|
||||
Utils.isBandwidthControlEnabled() /* enabled */,
|
||||
isAdmin) || somethingChanged;
|
||||
|
||||
final boolean isConnectedDeviceV2Enabled =
|
||||
Settings.ConnectedDeviceDashboardActivity.isEnabled();
|
||||
// Enable new connected page if v2 enabled
|
||||
somethingChanged = setTileEnabled(
|
||||
new ComponentName(packageName,
|
||||
Settings.ConnectedDeviceDashboardActivity.class.getName()),
|
||||
isConnectedDeviceV2Enabled && !UserManager.isDeviceInDemoMode(this) /* enabled */,
|
||||
isAdmin) || somethingChanged;
|
||||
// Enable old connected page if v2 disabled
|
||||
somethingChanged = setTileEnabled(
|
||||
new ComponentName(packageName,
|
||||
Settings.ConnectedDeviceDashboardActivityOld.class.getName()),
|
||||
!isConnectedDeviceV2Enabled && !UserManager.isDeviceInDemoMode(this) /* enabled */,
|
||||
isAdmin) || somethingChanged;
|
||||
|
||||
somethingChanged = setTileEnabled(new ComponentName(packageName,
|
||||
Settings.SimSettingsActivity.class.getName()),
|
||||
Utils.showSimCardTile(this), isAdmin)
|
||||
@@ -809,11 +824,6 @@ public class SettingsActivity extends SettingsDrawerActivity
|
||||
!UserManager.isDeviceInDemoMode(this), isAdmin)
|
||||
|| somethingChanged;
|
||||
|
||||
somethingChanged = setTileEnabled(new ComponentName(packageName,
|
||||
Settings.ConnectedDeviceDashboardActivity.class.getName()),
|
||||
!UserManager.isDeviceInDemoMode(this), isAdmin)
|
||||
|| somethingChanged;
|
||||
|
||||
somethingChanged = setTileEnabled(new ComponentName(packageName,
|
||||
Settings.DateTimeSettingsActivity.class.getName()),
|
||||
!UserManager.isDeviceInDemoMode(this), isAdmin)
|
||||
|
@@ -43,7 +43,6 @@ import java.util.List;
|
||||
public class ConnectedDeviceDashboardFragment extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "ConnectedDeviceFrag";
|
||||
private UsbModePreferenceController mUsbPrefController;
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
@@ -67,28 +66,7 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
|
||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
final Lifecycle lifecycle = getLifecycle();
|
||||
final NfcPreferenceController nfcPreferenceController =
|
||||
new NfcPreferenceController(context);
|
||||
lifecycle.addObserver(nfcPreferenceController);
|
||||
controllers.add(nfcPreferenceController);
|
||||
mUsbPrefController = new UsbModePreferenceController(context, new UsbBackend(context));
|
||||
lifecycle.addObserver(mUsbPrefController);
|
||||
controllers.add(mUsbPrefController);
|
||||
final BluetoothMasterSwitchPreferenceController bluetoothPreferenceController =
|
||||
new BluetoothMasterSwitchPreferenceController(
|
||||
context, Utils.getLocalBtManager(context), this,
|
||||
(SettingsActivity) getActivity());
|
||||
lifecycle.addObserver(bluetoothPreferenceController);
|
||||
controllers.add(bluetoothPreferenceController);
|
||||
|
||||
SmsMirroringFeatureProvider smsMirroringFeatureProvider =
|
||||
FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
||||
AbstractPreferenceController smsMirroringController =
|
||||
smsMirroringFeatureProvider.getController(context);
|
||||
controllers.add(smsMirroringController);
|
||||
return controllers;
|
||||
return null;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -136,28 +114,14 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
|
||||
@Override
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(
|
||||
Context context, boolean enabled) {
|
||||
final SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.connected_devices;
|
||||
return Arrays.asList(sir);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
final List<String> keys = super.getNonIndexableKeys(context);
|
||||
PackageManager pm = context.getPackageManager();
|
||||
if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC)) {
|
||||
keys.add(NfcPreferenceController.KEY_TOGGLE_NFC);
|
||||
keys.add(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
|
||||
}
|
||||
keys.add(BluetoothMasterSwitchPreferenceController.KEY_TOGGLE_BLUETOOTH);
|
||||
|
||||
SmsMirroringFeatureProvider smsMirroringFeatureProvider =
|
||||
FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
||||
SmsMirroringPreferenceController smsMirroringController =
|
||||
smsMirroringFeatureProvider.getController(context);
|
||||
smsMirroringController.updateNonIndexableKeys(keys);
|
||||
|
||||
return keys;
|
||||
return new ArrayList<>();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
* Copyright (C) 2016 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.connecteddevice;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.bluetooth.BluetoothMasterSwitchPreferenceController;
|
||||
import com.android.settings.bluetooth.Utils;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.dashboard.SummaryLoader;
|
||||
import com.android.settings.deviceinfo.UsbBackend;
|
||||
import com.android.settings.nfc.NfcPreferenceController;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This is the previous {@link ConnectedDeviceDashboardFragment} in Android O, in Android P the
|
||||
* main entry will be {@link ConnectedDeviceDashboardFragment}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public class ConnectedDeviceDashboardFragmentOld extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "ConnectedDeviceFrag2";
|
||||
private UsbModePreferenceController mUsbPrefController;
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.SETTINGS_CONNECTED_DEVICE_CATEGORY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLogTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getHelpResource() {
|
||||
return R.string.help_url_connected_devices;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.connected_devices_old;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
|
||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
final Lifecycle lifecycle = getLifecycle();
|
||||
final NfcPreferenceController nfcPreferenceController =
|
||||
new NfcPreferenceController(context);
|
||||
lifecycle.addObserver(nfcPreferenceController);
|
||||
controllers.add(nfcPreferenceController);
|
||||
mUsbPrefController = new UsbModePreferenceController(context, new UsbBackend(context));
|
||||
lifecycle.addObserver(mUsbPrefController);
|
||||
controllers.add(mUsbPrefController);
|
||||
final BluetoothMasterSwitchPreferenceController bluetoothPreferenceController =
|
||||
new BluetoothMasterSwitchPreferenceController(
|
||||
context, Utils.getLocalBtManager(context), this,
|
||||
(SettingsActivity) getActivity());
|
||||
lifecycle.addObserver(bluetoothPreferenceController);
|
||||
controllers.add(bluetoothPreferenceController);
|
||||
|
||||
SmsMirroringFeatureProvider smsMirroringFeatureProvider =
|
||||
FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
||||
AbstractPreferenceController smsMirroringController =
|
||||
smsMirroringFeatureProvider.getController(context);
|
||||
controllers.add(smsMirroringController);
|
||||
return controllers;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
static class SummaryProvider implements SummaryLoader.SummaryProvider {
|
||||
|
||||
private final Context mContext;
|
||||
private final SummaryLoader mSummaryLoader;
|
||||
private final NfcPreferenceController mNfcPreferenceController;
|
||||
|
||||
public SummaryProvider(Context context, SummaryLoader summaryLoader) {
|
||||
mContext = context;
|
||||
mSummaryLoader = summaryLoader;
|
||||
mNfcPreferenceController = new NfcPreferenceController(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListening(boolean listening) {
|
||||
if (listening) {
|
||||
if (mNfcPreferenceController.isAvailable()) {
|
||||
mSummaryLoader.setSummary(this,
|
||||
mContext.getString(R.string.connected_devices_dashboard_summary));
|
||||
} else {
|
||||
mSummaryLoader.setSummary(this, mContext.getString(
|
||||
R.string.connected_devices_dashboard_no_nfc_summary));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY
|
||||
= new SummaryLoader.SummaryProviderFactory() {
|
||||
@Override
|
||||
public SummaryLoader.SummaryProvider createSummaryProvider(Activity activity,
|
||||
SummaryLoader summaryLoader) {
|
||||
return new SummaryProvider(activity, summaryLoader);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* For Search.
|
||||
*/
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(
|
||||
Context context, boolean enabled) {
|
||||
final SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.connected_devices_old;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
final List<String> keys = super.getNonIndexableKeys(context);
|
||||
PackageManager pm = context.getPackageManager();
|
||||
if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC)) {
|
||||
keys.add(NfcPreferenceController.KEY_TOGGLE_NFC);
|
||||
keys.add(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
|
||||
}
|
||||
keys.add(BluetoothMasterSwitchPreferenceController.KEY_TOGGLE_BLUETOOTH);
|
||||
|
||||
SmsMirroringFeatureProvider smsMirroringFeatureProvider =
|
||||
FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
||||
SmsMirroringPreferenceController smsMirroringController =
|
||||
smsMirroringFeatureProvider.getController(context);
|
||||
smsMirroringController.updateNonIndexableKeys(keys);
|
||||
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
}
|
@@ -24,4 +24,5 @@ public class FeatureFlags {
|
||||
public static final String SEARCH_V2 = "settings_search_v2";
|
||||
public static final String SUGGESTIONS_V2 = "new_settings_suggestion";
|
||||
public static final String APP_INFO_V2 = "settings_app_info_v2";
|
||||
public static final String CONNECTED_DEVICE_V2 = "settings_connected_device_v2";
|
||||
}
|
||||
|
@@ -58,6 +58,7 @@ import com.android.settings.applications.manageapplications.ManageApplications;
|
||||
import com.android.settings.bluetooth.BluetoothDeviceDetailsFragment;
|
||||
import com.android.settings.bluetooth.BluetoothSettings;
|
||||
import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment;
|
||||
import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragmentOld;
|
||||
import com.android.settings.dashboard.SupportFragment;
|
||||
import com.android.settings.datausage.DataPlanUsageSummary;
|
||||
import com.android.settings.datausage.DataUsageList;
|
||||
@@ -248,6 +249,7 @@ public class SettingsGateway {
|
||||
SystemDashboardFragment.class.getName(),
|
||||
NetworkDashboardFragment.class.getName(),
|
||||
ConnectedDeviceDashboardFragment.class.getName(),
|
||||
ConnectedDeviceDashboardFragmentOld.class.getName(),
|
||||
AppAndNotificationDashboardFragment.class.getName(),
|
||||
UserAndAccountDashboardFragment.class.getName(),
|
||||
EnterprisePrivacySettings.class.getName(),
|
||||
@@ -261,6 +263,7 @@ public class SettingsGateway {
|
||||
// Home page
|
||||
Settings.NetworkDashboardActivity.class.getName(),
|
||||
Settings.ConnectedDeviceDashboardActivity.class.getName(),
|
||||
Settings.ConnectedDeviceDashboardActivityOld.class.getName(),
|
||||
Settings.AppAndNotificationDashboardActivity.class.getName(),
|
||||
Settings.DisplaySettingsActivity.class.getName(),
|
||||
Settings.SoundSettingsActivity.class.getName(),
|
||||
|
@@ -23,7 +23,7 @@ import com.android.settings.accounts.AccountDetailDashboardFragment;
|
||||
import com.android.settings.accounts.UserAndAccountDashboardFragment;
|
||||
import com.android.settings.applications.AppAndNotificationDashboardFragment;
|
||||
import com.android.settings.applications.DefaultAppSettings;
|
||||
import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment;
|
||||
import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragmentOld;
|
||||
import com.android.settings.development.DevelopmentSettingsDashboardFragment;
|
||||
import com.android.settings.deviceinfo.StorageDashboardFragment;
|
||||
import com.android.settings.fuelgauge.PowerUsageSummary;
|
||||
@@ -59,7 +59,8 @@ public class DashboardFragmentRegistry {
|
||||
PARENT_TO_CATEGORY_KEY_MAP = new ArrayMap<>();
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(
|
||||
NetworkDashboardFragment.class.getName(), CategoryKey.CATEGORY_NETWORK);
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(ConnectedDeviceDashboardFragment.class.getName(),
|
||||
//TODO(b/69471219): update ConnectedDeviceDashboardFragment once new feature is done.
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(ConnectedDeviceDashboardFragmentOld.class.getName(),
|
||||
CategoryKey.CATEGORY_DEVICE);
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(AppAndNotificationDashboardFragment.class.getName(),
|
||||
CategoryKey.CATEGORY_APPS);
|
||||
|
@@ -34,6 +34,7 @@ import com.android.settings.backup.BackupSettingsActivity;
|
||||
import com.android.settings.backup.BackupSettingsFragment;
|
||||
import com.android.settings.bluetooth.BluetoothSettings;
|
||||
import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment;
|
||||
import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragmentOld;
|
||||
import com.android.settings.datausage.DataUsageMeteredSettings;
|
||||
import com.android.settings.datausage.DataUsageSummary;
|
||||
import com.android.settings.deletionhelper.AutomaticStorageManagerSettings;
|
||||
@@ -154,6 +155,7 @@ public final class SearchIndexableResources {
|
||||
addIndex(ResetDashboardFragment.class);
|
||||
addIndex(StorageDashboardFragment.class);
|
||||
addIndex(ConnectedDeviceDashboardFragment.class);
|
||||
addIndex(ConnectedDeviceDashboardFragmentOld.class);
|
||||
addIndex(EnterprisePrivacySettings.class);
|
||||
addIndex(PaymentSettings.class);
|
||||
addIndex(TextToSpeechSettings.class);
|
||||
|
@@ -51,7 +51,7 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
@RunWith(SettingsRobolectricTestRunner.class)
|
||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||
public class ConnectedDeviceDashboardFragmentTest {
|
||||
public class ConnectedDeviceDashboardFragment2Test {
|
||||
|
||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||
Context mContext;
|
||||
@@ -61,7 +61,7 @@ public class ConnectedDeviceDashboardFragmentTest {
|
||||
|
||||
private FakeFeatureFactory mFeatureFactory;
|
||||
private SmsMirroringFeatureProvider mFeatureProvider;
|
||||
private ConnectedDeviceDashboardFragment mFragment;
|
||||
private ConnectedDeviceDashboardFragmentOld mFragment;
|
||||
private TestSmsMirroringPreferenceController mSmsMirroringPreferenceController;
|
||||
|
||||
private static final class TestSmsMirroringPreferenceController
|
||||
@@ -86,7 +86,7 @@ public class ConnectedDeviceDashboardFragmentTest {
|
||||
mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
|
||||
mFeatureProvider = mFeatureFactory.smsMirroringFeatureProvider;
|
||||
|
||||
mFragment = new ConnectedDeviceDashboardFragment();
|
||||
mFragment = new ConnectedDeviceDashboardFragmentOld();
|
||||
when(mContext.getPackageManager()).thenReturn(mManager);
|
||||
|
||||
mSmsMirroringPreferenceController = new TestSmsMirroringPreferenceController(mContext);
|
Reference in New Issue
Block a user