Merge "Map the new category keys to the corresponding fragment." into pi-dev

am: be5fa599be

Change-Id: Ie55eee4ac77b9ce9be5f9d1ff3a0bb769fb2f5b9
This commit is contained in:
Doris Ling
2018-05-10 18:03:05 -07:00
committed by android-build-merger
3 changed files with 47 additions and 0 deletions

View File

@@ -27,7 +27,9 @@ import com.android.settings.connecteddevice.AdvancedConnectedDeviceDashboardFrag
import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment;
import com.android.settings.development.DevelopmentSettingsDashboardFragment;
import com.android.settings.deviceinfo.StorageDashboardFragment;
import com.android.settings.display.NightDisplaySettings;
import com.android.settings.fuelgauge.PowerUsageSummary;
import com.android.settings.gestures.GestureSettings;
import com.android.settings.language.LanguageAndInputSettings;
import com.android.settings.network.NetworkDashboardFragment;
import com.android.settings.notification.ConfigureNotificationSettings;
@@ -95,6 +97,10 @@ public class DashboardFragmentRegistry {
CategoryKey.CATEGORY_SECURITY_LOCKSCREEN);
PARENT_TO_CATEGORY_KEY_MAP.put(ZenModeSettings.class.getName(),
CategoryKey.CATEGORY_DO_NOT_DISTURB);
PARENT_TO_CATEGORY_KEY_MAP.put(GestureSettings.class.getName(),
CategoryKey.CATEGORY_GESTURES);
PARENT_TO_CATEGORY_KEY_MAP.put(NightDisplaySettings.class.getName(),
CategoryKey.CATEGORY_NIGHT_LIGHT);
CATEGORY_KEY_TO_PARENT_MAP = new ArrayMap<>(PARENT_TO_CATEGORY_KEY_MAP.size());

View File

@@ -22,6 +22,7 @@ import android.provider.SearchIndexableResource;
import com.android.settings.R;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.drawer.CategoryKey;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RuntimeEnvironment;
@@ -45,4 +46,10 @@ public class NightDisplaySettingsTest {
assertThat(indexedXml).contains(R.xml.night_display_settings);
}
@Test
public void getCategoryKey_isCategoryNightLight() {
NightDisplaySettings settings = new NightDisplaySettings();
assertThat(settings.getCategoryKey()).isEqualTo(CategoryKey.CATEGORY_NIGHT_LIGHT);
}
}

View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) 2018 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.gestures;
import static com.google.common.truth.Truth.assertThat;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.drawer.CategoryKey;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(SettingsRobolectricTestRunner.class)
public class GestureSettingsTest {
@Test
public void getCategoryKey_isCategoryGestures() {
GestureSettings settings = new GestureSettings();
assertThat(settings.getCategoryKey()).isEqualTo(CategoryKey.CATEGORY_GESTURES);
}
}