Merge "feat(brightness suw): adjust brightness toggles UI and remove autobrightness standalone page" into main
This commit is contained in:
@@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2024 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.
|
|
||||||
-->
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="@dimen/accessibility_icon_foreground_size"
|
|
||||||
android:height="@dimen/accessibility_icon_foreground_size"
|
|
||||||
android:viewportWidth="960"
|
|
||||||
android:viewportHeight="960">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M312,640L376,640L408,548L554,548L586,640L648,640L512,280L448,280L312,640ZM426,496L478,346L482,346L534,496L426,496ZM480,932L346,800L160,800L160,614L28,480L160,346L160,160L346,160L480,28L614,160L800,160L800,346L932,480L800,614L800,800L614,800L480,932ZM480,820L580,720L720,720L720,580L820,480L720,380L720,240L580,240L480,140L380,240L240,240L240,380L140,480L240,580L240,720L380,720L480,820ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z"/>
|
|
||||||
</vector>
|
|
@@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2024 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.
|
|
||||||
-->
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="@dimen/accessibility_icon_foreground_size"
|
|
||||||
android:height="@dimen/accessibility_icon_foreground_size"
|
|
||||||
android:viewportWidth="960"
|
|
||||||
android:viewportHeight="960">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M480,932L346,800L160,800L160,614L28,480L160,346L160,160L346,160L480,28L614,160L800,160L800,346L932,480L800,614L800,800L614,800L480,932ZM480,680Q563,680 621.5,621.5Q680,563 680,480Q680,397 621.5,338.5Q563,280 480,280L480,680ZM480,820L580,720L720,720L720,580L820,480L720,380L720,240L580,240L480,140L380,240L240,240L240,380L140,480L240,580L240,720L380,720L480,820ZM480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480L480,480Z"/>
|
|
||||||
</vector>
|
|
@@ -21,6 +21,15 @@
|
|||||||
android:height="@dimen/accessibility_icon_size"
|
android:height="@dimen/accessibility_icon_size"
|
||||||
android:color="@color/accessibility_feature_background"/>
|
android:color="@color/accessibility_feature_background"/>
|
||||||
</item>
|
</item>
|
||||||
<item android:gravity="center"
|
<item android:gravity="center">
|
||||||
android:drawable="@drawable/ic_brightness_auto"/>
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="@dimen/accessibility_icon_foreground_size"
|
||||||
|
android:height="@dimen/accessibility_icon_foreground_size"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M2 15V13H5V15H2ZM6.35 9.75L4.225 7.625L5.625 6.225L7.75 8.35L6.35 9.75ZM7 18V15H17V18H7ZM11 7V4H13V7H11ZM17.65 9.775L16.25 8.35L18.375 6.225L19.775 7.65L17.65 9.775ZM19 15V13H22V15H19Z"/>
|
||||||
|
</vector>
|
||||||
|
</item>
|
||||||
</layer-list>
|
</layer-list>
|
@@ -21,6 +21,15 @@
|
|||||||
android:height="@dimen/accessibility_icon_size"
|
android:height="@dimen/accessibility_icon_size"
|
||||||
android:color="@color/accessibility_feature_background"/>
|
android:color="@color/accessibility_feature_background"/>
|
||||||
</item>
|
</item>
|
||||||
<item android:gravity="center"
|
<item android:gravity="center">
|
||||||
android:drawable="@drawable/ic_brightness_medium"/>
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="@dimen/accessibility_icon_foreground_size"
|
||||||
|
android:height="@dimen/accessibility_icon_foreground_size"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M9 14.5V13H15V14.5H9ZM8 11.5V10H16V11.5H8ZM7 23C6.45 23 5.975 22.8083 5.575 22.425C5.19167 22.025 5 21.55 5 21V3C5 2.45 5.19167 1.98333 5.575 1.6C5.975 1.2 6.45 0.999999 7 0.999999H17C17.55 0.999999 18.0167 1.2 18.4 1.6C18.8 1.98333 19 2.45 19 3V21C19 21.55 18.8 22.025 18.4 22.425C18.0167 22.8083 17.55 23 17 23H7ZM7 20V21H17V20H7ZM7 18H17V6H7V18ZM7 4H17V3H7V4ZM7 4V3V4ZM7 20V21V20Z"/>
|
||||||
|
</vector>
|
||||||
|
</item>
|
||||||
</layer-list>
|
</layer-list>
|
@@ -2869,16 +2869,12 @@
|
|||||||
<string name="brightness">Brightness level</string>
|
<string name="brightness">Brightness level</string>
|
||||||
<!-- Sound & display settings screen, setting option name to enable adaptive brightness [CHAR LIMIT=30] -->
|
<!-- Sound & display settings screen, setting option name to enable adaptive brightness [CHAR LIMIT=30] -->
|
||||||
<string name="auto_brightness_title">Adaptive brightness</string>
|
<string name="auto_brightness_title">Adaptive brightness</string>
|
||||||
<!-- Note: The content description title is only applied in adaptive brightness detailed page in setup wizard flow, to make the consistency with other accessibility suw pages. -->
|
|
||||||
<!-- ContentDescription title for adaptive brightness detailed page footer. [CHAR LIMIT=60] -->
|
|
||||||
<string name="auto_brightness_content_description_title">About adaptive brightness</string>
|
|
||||||
<!-- Description about the feature adaptive brightness -->
|
<!-- Description about the feature adaptive brightness -->
|
||||||
<string name="auto_brightness_description">Your screen brightness will automatically adjust to your environment and activities. You can move the slider manually to help adaptive brightness learn your preferences.</string>
|
<string name="auto_brightness_description">Your screen brightness will automatically adjust to your environment and activities. You can move the slider manually to help adaptive brightness learn your preferences.</string>
|
||||||
<!-- Setting option summary when adaptive brightness is on [CHAR LIMIT=NONE] -->
|
<!-- Setting option summary when adaptive brightness is on [CHAR LIMIT=NONE] -->
|
||||||
<string name="auto_brightness_summary_on">On</string>
|
<string name="auto_brightness_summary_on">On</string>
|
||||||
<!-- Setting option summary when adaptive brightness is off [CHAR LIMIT=NONE] -->
|
<!-- Setting option summary when adaptive brightness is off [CHAR LIMIT=NONE] -->
|
||||||
<string name="auto_brightness_summary_off">Off</string>
|
<string name="auto_brightness_summary_off">Off</string>
|
||||||
|
|
||||||
<!-- Display settings screen, display white balance settings title [CHAR LIMIT=30] -->
|
<!-- Display settings screen, display white balance settings title [CHAR LIMIT=30] -->
|
||||||
<string name="display_white_balance_title">Display white balance</string>
|
<string name="display_white_balance_title">Display white balance</string>
|
||||||
<!-- Display settings screen, display white balance settings summary [CHAR LIMIT=NONE] -->
|
<!-- Display settings screen, display white balance settings summary [CHAR LIMIT=NONE] -->
|
||||||
|
@@ -37,11 +37,10 @@
|
|||||||
settings:useAdminDisabledSummary="true"
|
settings:useAdminDisabledSummary="true"
|
||||||
settings:userRestriction="no_config_brightness"/>
|
settings:userRestriction="no_config_brightness"/>
|
||||||
|
|
||||||
<com.android.settingslib.PrimarySwitchPreference
|
<com.android.settingslib.RestrictedSwitchPreference
|
||||||
android:key="@string/preference_key_auto_brightness"
|
android:key="@string/preference_key_auto_brightness"
|
||||||
android:icon="@drawable/ic_suw_brightness_auto"
|
android:icon="@drawable/ic_suw_brightness_auto"
|
||||||
android:title="@string/auto_brightness_title"
|
android:title="@string/auto_brightness_title"
|
||||||
android:fragment="com.android.settings.accessibility.AutoBrightnessPreferenceFragmentForSetupWizard"
|
|
||||||
settings:useAdminDisabledSummary="true"
|
settings:useAdminDisabledSummary="true"
|
||||||
settings:userRestriction="no_config_brightness"
|
settings:userRestriction="no_config_brightness"
|
||||||
settings:controller="com.android.settings.display.AutoBrightnessPreferenceControllerForSetupWizard"/>
|
settings:controller="com.android.settings.display.AutoBrightnessPreferenceControllerForSetupWizard"/>
|
||||||
|
@@ -1,98 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2024 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.accessibility;
|
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_CANCELED;
|
|
||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.preference.PreferenceScreen;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.android.settings.R;
|
|
||||||
import com.android.settings.display.AutoBrightnessSettings;
|
|
||||||
import com.android.settingslib.Utils;
|
|
||||||
import com.android.settingslib.widget.FooterPreference;
|
|
||||||
|
|
||||||
import com.google.android.setupcompat.template.FooterBarMixin;
|
|
||||||
import com.google.android.setupdesign.GlifPreferenceLayout;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fragment for adaptive brightness settings in the SetupWizard.
|
|
||||||
*/
|
|
||||||
public class AutoBrightnessPreferenceFragmentForSetupWizard extends AutoBrightnessSettings {
|
|
||||||
|
|
||||||
private static final String FOOTER_PREFERENCE_KEY = "auto_brightness_footer";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
|
|
||||||
updateFooterContentDescription();
|
|
||||||
|
|
||||||
if (view instanceof GlifPreferenceLayout) {
|
|
||||||
final GlifPreferenceLayout layout = (GlifPreferenceLayout) view;
|
|
||||||
final String title = getContext().getString(
|
|
||||||
R.string.auto_brightness_title);
|
|
||||||
final Drawable icon = getContext().getDrawable(R.drawable.ic_accessibility_visibility);
|
|
||||||
icon.setTintList(Utils.getColorAttr(getContext(), android.R.attr.colorPrimary));
|
|
||||||
AccessibilitySetupWizardUtils.updateGlifPreferenceLayout(getContext(), layout, title,
|
|
||||||
/* description= */ null, icon);
|
|
||||||
|
|
||||||
final FooterBarMixin mixin = layout.getMixin(FooterBarMixin.class);
|
|
||||||
AccessibilitySetupWizardUtils.setPrimaryButton(getContext(), mixin, R.string.done,
|
|
||||||
() -> {
|
|
||||||
setResult(RESULT_CANCELED);
|
|
||||||
finish();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public RecyclerView onCreateRecyclerView(@NonNull LayoutInflater inflater,
|
|
||||||
@NonNull ViewGroup parent, @Nullable Bundle savedInstanceState) {
|
|
||||||
if (parent instanceof GlifPreferenceLayout) {
|
|
||||||
final GlifPreferenceLayout layout = (GlifPreferenceLayout) parent;
|
|
||||||
return layout.onCreateRecyclerView(inflater, parent, savedInstanceState);
|
|
||||||
}
|
|
||||||
return super.onCreateRecyclerView(inflater, parent, savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMetricsCategory() {
|
|
||||||
return SettingsEnums.SUW_ACCESSIBILITY_AUTO_BRIGHTNESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateFooterContentDescription() {
|
|
||||||
final PreferenceScreen screen = getPreferenceScreen();
|
|
||||||
final FooterPreference footerPreference = screen.findPreference(FOOTER_PREFERENCE_KEY);
|
|
||||||
if (footerPreference != null) {
|
|
||||||
String title = getString(R.string.auto_brightness_content_description_title);
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append(title).append("\n\n").append(footerPreference.getTitle());
|
|
||||||
footerPreference.setContentDescription(sb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -28,7 +28,6 @@ import com.android.settings.accessibility.AccessibilityDetailsSettingsFragment;
|
|||||||
import com.android.settings.accessibility.AccessibilityHearingAidsFragment;
|
import com.android.settings.accessibility.AccessibilityHearingAidsFragment;
|
||||||
import com.android.settings.accessibility.AccessibilitySettings;
|
import com.android.settings.accessibility.AccessibilitySettings;
|
||||||
import com.android.settings.accessibility.AccessibilitySettingsForSetupWizard;
|
import com.android.settings.accessibility.AccessibilitySettingsForSetupWizard;
|
||||||
import com.android.settings.accessibility.AutoBrightnessPreferenceFragmentForSetupWizard;
|
|
||||||
import com.android.settings.accessibility.CaptioningPropertiesFragment;
|
import com.android.settings.accessibility.CaptioningPropertiesFragment;
|
||||||
import com.android.settings.accessibility.ColorAndMotionFragment;
|
import com.android.settings.accessibility.ColorAndMotionFragment;
|
||||||
import com.android.settings.accessibility.HearingDevicePairingFragment;
|
import com.android.settings.accessibility.HearingDevicePairingFragment;
|
||||||
@@ -268,7 +267,6 @@ public class SettingsGateway {
|
|||||||
EditShortcutsPreferenceFragment.class.getName(),
|
EditShortcutsPreferenceFragment.class.getName(),
|
||||||
TextReadingPreferenceFragment.class.getName(),
|
TextReadingPreferenceFragment.class.getName(),
|
||||||
TextReadingPreferenceFragmentForSetupWizard.class.getName(),
|
TextReadingPreferenceFragmentForSetupWizard.class.getName(),
|
||||||
AutoBrightnessPreferenceFragmentForSetupWizard.class.getName(),
|
|
||||||
CaptioningPropertiesFragment.class.getName(),
|
CaptioningPropertiesFragment.class.getName(),
|
||||||
ToggleDaltonizerPreferenceFragment.class.getName(),
|
ToggleDaltonizerPreferenceFragment.class.getName(),
|
||||||
ToggleColorInversionPreferenceFragment.class.getName(),
|
ToggleColorInversionPreferenceFragment.class.getName(),
|
||||||
|
@@ -41,4 +41,9 @@ public class AutoBrightnessPreferenceControllerForSetupWizard
|
|||||||
}
|
}
|
||||||
return super.getAvailabilityStatus();
|
return super.getAvailabilityStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CharSequence getSummary() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,119 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2024 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.accessibility;
|
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
|
||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
|
|
||||||
import androidx.fragment.app.FragmentFactory;
|
|
||||||
import androidx.fragment.app.testing.FragmentScenario;
|
|
||||||
import androidx.lifecycle.Lifecycle;
|
|
||||||
import androidx.preference.Preference;
|
|
||||||
|
|
||||||
import com.android.settings.R;
|
|
||||||
import com.android.settingslib.widget.FooterPreference;
|
|
||||||
|
|
||||||
import com.google.android.setupcompat.template.FooterBarMixin;
|
|
||||||
import com.google.android.setupdesign.GlifLayout;
|
|
||||||
import com.google.android.setupdesign.GlifPreferenceLayout;
|
|
||||||
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.robolectric.RobolectricTestRunner;
|
|
||||||
|
|
||||||
/** Tests for {@link AutoBrightnessPreferenceFragmentForSetupWizard}. */
|
|
||||||
@RunWith(RobolectricTestRunner.class)
|
|
||||||
public class AutoBrightnessPreferenceFragmentForSetupWizardTest {
|
|
||||||
|
|
||||||
// Same as AutoBrightnessPreferenceFragmentForSetupWizard#FOOTER_PREFERENCE_KEY
|
|
||||||
private static final String FOOTER_PREFERENCE_KEY = "auto_brightness_footer";
|
|
||||||
|
|
||||||
private FragmentScenario<AutoBrightnessPreferenceFragmentForSetupWizard> mFragmentScenario;
|
|
||||||
|
|
||||||
private AutoBrightnessPreferenceFragmentForSetupWizard mFragment;
|
|
||||||
private GlifLayout mGlifLayout;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setUp() {
|
|
||||||
mFragmentScenario = FragmentScenario
|
|
||||||
.launch(
|
|
||||||
AutoBrightnessPreferenceFragmentForSetupWizard.class,
|
|
||||||
/* fragmentArgs= */ (Bundle) null,
|
|
||||||
R.style.GlifTheme,
|
|
||||||
/* factory= */ (FragmentFactory) null)
|
|
||||||
.moveToState(Lifecycle.State.RESUMED);
|
|
||||||
mFragmentScenario.onFragment(fragment -> mFragment = fragment);
|
|
||||||
|
|
||||||
View view = mFragment.getView();
|
|
||||||
assertThat(view).isInstanceOf(GlifPreferenceLayout.class);
|
|
||||||
mGlifLayout = (GlifLayout) view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@After
|
|
||||||
public void tearDown() {
|
|
||||||
mFragmentScenario.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void onViewCreated_verifyGlifHerderText() {
|
|
||||||
assertThat(mGlifLayout.getHeaderText())
|
|
||||||
.isEqualTo(mFragment.getString(R.string.auto_brightness_title));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void onViewCreated_verifyGlifFooter() {
|
|
||||||
FooterBarMixin footerMixin = mGlifLayout.getMixin(FooterBarMixin.class);
|
|
||||||
assertThat(footerMixin).isNotNull();
|
|
||||||
|
|
||||||
Button footerButton = footerMixin.getPrimaryButtonView();
|
|
||||||
assertThat(footerButton).isNotNull();
|
|
||||||
assertThat(footerButton.getText().toString()).isEqualTo(mFragment.getString(R.string.done));
|
|
||||||
|
|
||||||
footerButton.performClick();
|
|
||||||
assertThat(mFragment.getActivity().isFinishing()).isTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void onViewCreated_verifyFooterPreference() {
|
|
||||||
Preference pref = mFragment.findPreference(FOOTER_PREFERENCE_KEY);
|
|
||||||
assertThat(pref).isInstanceOf(FooterPreference.class);
|
|
||||||
|
|
||||||
FooterPreference footerPref = (FooterPreference) pref;
|
|
||||||
String exactTitle = footerPref.getTitle().toString();
|
|
||||||
assertThat(exactTitle).isEqualTo(mFragment.getString(R.string.auto_brightness_description));
|
|
||||||
|
|
||||||
// Ensure that footer content description has "About XXX" prefix for consistency with other
|
|
||||||
// accessibility suw pages
|
|
||||||
String expectedContentDescription =
|
|
||||||
mFragment.getString(R.string.auto_brightness_content_description_title)
|
|
||||||
+ "\n\n" + exactTitle;
|
|
||||||
assertThat(footerPref.getContentDescription().toString())
|
|
||||||
.isEqualTo(expectedContentDescription);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void getMetricsCategory_returnsCorrectCategory() {
|
|
||||||
assertThat(mFragment.getMetricsCategory()).isEqualTo(
|
|
||||||
SettingsEnums.SUW_ACCESSIBILITY_AUTO_BRIGHTNESS);
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user