Snap for 12439515 from bdd8c89ed2 to 25Q1-release
Change-Id: I8ae9054529bed05da9bf51ea7764ad8e9366b388
This commit is contained in:
@@ -1503,12 +1503,14 @@
|
||||
|
||||
<!-- A locale list of not supporting Terms of Address. [DO NOT TRANSLATE] -->
|
||||
<string-array name="terms_of_address_unsupported_locales">
|
||||
<item>fr-CA</item> <!-- French (Canada) -->
|
||||
</string-array>
|
||||
|
||||
<!-- A language list of supporting Terms of Address. [DO NOT TRANSLATE] -->
|
||||
<string-array name="terms_of_address_supported_languages">
|
||||
<item>fr</item> <!-- French -->
|
||||
<item>es</item> <!-- Spanish -->
|
||||
<item>it</item> <!-- Italian -->
|
||||
<item>de</item> <!-- German -->
|
||||
</string-array>
|
||||
|
||||
<!-- Entries for private space auto lock option -->
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.homepage.contextualcards.conditional;
|
||||
|
||||
import android.app.Flags;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -153,7 +154,9 @@ public class ConditionManager {
|
||||
new BackgroundDataConditionController(mAppContext, this /* manager */));
|
||||
mCardControllers.add(new BatterySaverConditionController(mAppContext, this /* manager */));
|
||||
mCardControllers.add(new CellularDataConditionController(mAppContext, this /* manager */));
|
||||
mCardControllers.add(new DndConditionCardController(mAppContext, this /* manager */));
|
||||
if (!Flags.modesUi()) {
|
||||
mCardControllers.add(new DndConditionCardController(mAppContext, this /* manager */));
|
||||
}
|
||||
mCardControllers.add(new HotspotConditionController(mAppContext, this /* manager */));
|
||||
mCardControllers.add(new NightDisplayConditionController(mAppContext, this /* manager */));
|
||||
mCardControllers.add(new RingerVibrateConditionController(mAppContext, this /* manager */));
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.android.settings.notification.zen.ZenModeSettings;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
// TODO: b/368247671 - Remove entirely when inlining MODES_UI
|
||||
public class DndConditionCardController implements ConditionalCardController {
|
||||
static final int ID = Objects.hash("DndConditionCardController");
|
||||
|
||||
|
||||
@@ -25,8 +25,12 @@ import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
import android.platform.test.annotations.DisableFlags;
|
||||
import android.platform.test.annotations.EnableFlags;
|
||||
import android.platform.test.flag.junit.SetFlagsRule;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -39,6 +43,9 @@ public class ConditionManagerTest {
|
||||
|
||||
private static final long ID = 123L;
|
||||
|
||||
@Rule
|
||||
public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
|
||||
|
||||
@Mock
|
||||
private ConditionalCardController mController;
|
||||
@Mock
|
||||
@@ -66,6 +73,22 @@ public class ConditionManagerTest {
|
||||
assertThat(mManager.getDisplayableCards()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisableFlags(android.app.Flags.FLAG_MODES_UI)
|
||||
public void cardControllers_beforeModesUi_includesDnd() {
|
||||
ConditionManager manager = new ConditionManager(mContext, mConditionListener);
|
||||
assertThat(manager.mCardControllers.stream()
|
||||
.filter(c -> c instanceof DndConditionCardController).toList()).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(android.app.Flags.FLAG_MODES_UI)
|
||||
public void cardControllers_doesNotIncludeDnd() {
|
||||
ConditionManager manager = new ConditionManager(mContext, mConditionListener);
|
||||
assertThat(manager.mCardControllers.stream()
|
||||
.filter(c -> c instanceof DndConditionCardController).toList()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onPrimaryClick_shouldRelayToController() {
|
||||
mManager.onPrimaryClick(mContext, ID);
|
||||
|
||||
Reference in New Issue
Block a user