Home
last modified time | relevance | path

Searched refs:condition (Results 1 – 25 of 173) sorted by relevance

1234567

/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/shared/condition/
DConditionExtensionsTest.kt1 package com.android.systemui.shared.condition
35 val condition = flow.toCondition(scope = this, Condition.START_EAGERLY) in flowInitiallyTrue() constant
38 assertThat(condition.isConditionSet).isFalse() in flowInitiallyTrue()
40 condition.start() in flowInitiallyTrue()
42 assertThat(condition.isConditionSet).isTrue() in flowInitiallyTrue()
43 assertThat(condition.isConditionMet).isTrue() in flowInitiallyTrue()
50 val condition = flow.toCondition(scope = this, Condition.START_EAGERLY) in flowInitiallyFalse() constant
53 assertThat(condition.isConditionSet).isFalse() in flowInitiallyFalse()
55 condition.start() in flowInitiallyFalse()
57 assertThat(condition.isConditionSet).isTrue() in flowInitiallyFalse()
[all …]
DConditionMonitorTest.java17 package com.android.systemui.shared.condition;
88 final Condition condition = Mockito.mock( in createMockCondition() local
90 when(condition.isConditionSet()).thenReturn(true); in createMockCondition()
91 return condition; in createMockCondition()
209 mConditions.forEach(condition -> verify(condition).addCallback(any())); in addCallback_addFirstCallback_addCallbackToAllConditions()
215 mConditions.forEach(condition -> verify(condition, times(1)).addCallback(any())); in addCallback_addFirstCallback_addCallbackToAllConditions()
231 final Condition condition = mock( in addCallback_addSecondCallback_reportWithExistingValue() local
233 when(condition.isConditionMet()).thenReturn(true); in addCallback_addSecondCallback_reportWithExistingValue()
237 .addCondition(condition) in addCallback_addSecondCallback_reportWithExistingValue()
243 .addCondition(condition) in addCallback_addSecondCallback_reportWithExistingValue()
[all …]
/frameworks/base/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/conditions/
DDreamConditionTest.java35 import com.android.systemui.shared.condition.Condition;
73 final DreamCondition condition = new DreamCondition(mScope, mDreamManager, in testInitialDreamingState() local
75 condition.addCallback(mCallback); in testInitialDreamingState()
77 verify(mCallback).onConditionChanged(eq(condition)); in testInitialDreamingState()
78 assertThat(condition.isConditionMet()).isTrue(); in testInitialDreamingState()
87 final DreamCondition condition = new DreamCondition(mScope, mDreamManager, in testInitialNonDreamingState() local
89 condition.addCallback(mCallback); in testInitialNonDreamingState()
91 verify(mCallback, never()).onConditionChanged(eq(condition)); in testInitialNonDreamingState()
92 assertThat(condition.isConditionMet()).isFalse(); in testInitialNonDreamingState()
103 final DreamCondition condition = new DreamCondition(mScope, mDreamManager, in testChange() local
[all …]
/frameworks/base/packages/SystemUI/shared/src/com/android/systemui/shared/condition/
DMonitor.java17 package com.android.systemui.shared.condition;
148 public void onConditionChanged(Condition condition) {
149 mExecutor.execute(() -> updateConditionMetState(condition));
177 private void updateConditionMetState(Condition condition) { in updateConditionMetState() argument
179 mLogBuffer.logChange(/* prefix= */ "", condition.getTag(), condition.getState()); in updateConditionMetState()
182 final ArraySet<Subscription.Token> subscriptions = mConditions.get(condition); in updateConditionMetState()
218 normalizedCondition.getConditions().forEach(condition -> { in addSubscription()
219 if (!mConditions.containsKey(condition)) { in addSubscription()
220 mConditions.put(condition, new ArraySet<>()); in addSubscription()
221 condition.addCallback(mConditionCallback); in addSubscription()
[all …]
DConditionExtensions.kt1 package com.android.systemui.shared.condition in <lambda>()
3 import com.android.systemui.shared.condition.Condition.StartStrategy in <lambda>()
39 Condition.Callback { condition -> in Condition() method
40 if (condition.isConditionSet) { in Condition()
41 trySend(condition.isConditionMet) in Condition()
DEvaluator.kt17 package com.android.systemui.shared.condition in <lambda>()
77 .map { condition -> in <lambda>() method
78 if (condition.isConditionSet) { in <lambda>()
79 condition.isConditionMet in <lambda>()
DCombinedCondition.kt17 package com.android.systemui.shared.condition in <lambda>()
147 for ((index, condition) in conditions.withIndex()) { in <lambda>() variable
148 if (condition.startStrategy == START_EAGERLY) { in <lambda>()
177 for (condition in conditions) { in <lambda>() variable
178 when (condition.startStrategy) { in <lambda>()
/frameworks/native/services/surfaceflinger/tests/
DCredentials_test.cpp120 void checkWithPrivileges(std::function<T()> condition, T privilegedValue, T unprivilegedValue) { in checkWithPrivileges() argument
124 ASSERT_EQ(privilegedValue, condition()); in checkWithPrivileges()
130 ASSERT_EQ(privilegedValue, condition()); in checkWithPrivileges()
136 ASSERT_EQ(privilegedValue, condition()); in checkWithPrivileges()
142 ASSERT_EQ(unprivilegedValue, condition()); in checkWithPrivileges()
148 ASSERT_EQ(privilegedValue, condition()); in checkWithPrivileges()
178 std::function<bool()> condition = [] { return getFirstDisplayToken() != nullptr; }; in TEST_F() local
180 ASSERT_NO_FATAL_FAILURE(checkWithPrivileges(condition, true, false)); in TEST_F()
196 std::function<status_t()> condition = [=]() { in TEST_F() local
200 ASSERT_NO_FATAL_FAILURE(checkWithPrivileges<status_t>(condition, NO_ERROR, NO_ERROR)); in TEST_F()
[all …]
/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/
DScheduleConditionProviderTest.java100 Condition condition = mService.evaluateSubscriptionLocked( in testEvaluateSubscription_noAlarmExit_InSchedule() local
103 assertEquals(Condition.STATE_TRUE, condition.state); in testEvaluateSubscription_noAlarmExit_InSchedule()
126 Condition condition = mService.evaluateSubscriptionLocked( in testEvaluateSubscription_noAlarmExit_InScheduleSnoozed() local
129 assertEquals(Condition.STATE_FALSE, condition.state); in testEvaluateSubscription_noAlarmExit_InScheduleSnoozed()
154 Condition condition = mService.evaluateSubscriptionLocked( in testEvaluateSubscription_noAlarmExit_beforeSchedule() local
157 assertEquals(Condition.STATE_FALSE, condition.state); in testEvaluateSubscription_noAlarmExit_beforeSchedule()
177 Condition condition = mService.evaluateSubscriptionLocked( in testEvaluateSubscription_noAlarmExit_endSchedule() local
180 assertEquals(Condition.STATE_FALSE, condition.state); in testEvaluateSubscription_noAlarmExit_endSchedule()
198 Condition condition = mService.evaluateSubscriptionLocked( in testEvaluateSubscription_alarmSetBeforeInSchedule() local
200 assertEquals(Condition.STATE_TRUE, condition.state); in testEvaluateSubscription_alarmSetBeforeInSchedule()
[all …]
/frameworks/base/core/tests/hosttests/test-apps/MultiDexLegacyAndException/src/com/android/multidexlegacyandexception/
DIntermediateClass.java20 public static int get1(boolean condition) { in get1() argument
21 return new ClassInSecondaryDex(condition).get1(); in get1()
24 public static int get2(boolean condition) { in get2() argument
25 return new ClassInSecondaryDex(condition).get2(); in get2()
28 public static int get3(boolean condition) { in get3() argument
29 ClassInSecondaryDex thrower = new ClassInSecondaryDex(condition); in get3()
53 public static int get4(boolean condition) { in get4() argument
54 ClassInSecondaryDex thrower = new ClassInSecondaryDex(condition); in get4()
DMainActivity.java33 public int get1(boolean condition) { in get1() argument
34 return IntermediateClass.get1(condition); in get1()
37 public int get2(boolean condition) { in get2() argument
38 return IntermediateClass.get2(condition); in get2()
40 public int get3(boolean condition) { in get3() argument
41 return MiniIntermediateClass.get3(condition); in get3()
DClassInSecondaryDex.java20 private boolean condition; field in ClassInSecondaryDex
22 public ClassInSecondaryDex(boolean condition) { in ClassInSecondaryDex() argument
23 this.condition = condition; in ClassInSecondaryDex()
28 if (condition) { in canThrow1()
35 if (condition) { in canThrow2()
DTestApplication.java23 private static void canThrow1(boolean condition) throws ExceptionInMainDex { in canThrow1() argument
24 if (condition) { in canThrow1()
30 public static int get(boolean condition) { in get() argument
32 canThrow1(condition); in get()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/notification/
DEnableZenModeDialog.java138 if (isForever(tag.condition)) { in createDialog()
140 } else if (isAlarm(tag.condition)) { in createDialog()
142 } else if (isCountdown(tag.condition)) { in createDialog()
145 Slog.d(TAG, "Invalid manual condition: " + tag.condition); in createDialog()
151 getRealConditionId(tag.condition), TAG, in createDialog()
156 getRealConditionId(tag.condition), TAG); in createDialog()
211 protected void bind(final Condition condition, final View row, final int rowId) { in bind() argument
212 if (condition == null) throw new IllegalArgumentException("condition must not be null"); in bind()
214 final boolean enabled = condition.state == Condition.STATE_TRUE; in bind()
222 tag.condition = condition; in bind()
[all …]
/frameworks/base/tests/testables/src/android/testing/
DPollingCheck.java62 public static void check(CharSequence message, long timeout, Callable<Boolean> condition) in check() argument
65 if (condition.call()) { in check()
76 public static void waitFor(final PollingCheckCondition condition) { in waitFor() argument
80 return condition.canProceed(); in waitFor()
85 public static void waitFor(long timeout, final PollingCheckCondition condition) { in waitFor() argument
89 return condition.canProceed(); in waitFor()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/process/condition/
DSystemProcessConditionTest.java17 package com.android.systemui.process.condition;
29 import com.android.systemui.shared.condition.Condition;
30 import com.android.systemui.shared.condition.Monitor;
69 final Condition condition = new SystemProcessCondition(mScope, mProcessWrapper); in testConditionFailsWithNonSystemProcess() local
75 .addCondition(condition) in testConditionFailsWithNonSystemProcess()
90 final Condition condition = new SystemProcessCondition(mScope, mProcessWrapper); in testConditionSucceedsWithSystemProcess() local
96 .addCondition(condition) in testConditionSucceedsWithSystemProcess()
/frameworks/base/core/tests/coretests/src/android/util/
DPollingCheck.java80 public static void waitFor(final PollingCheckCondition condition) { in waitFor() argument
84 return condition.canProceed(); in waitFor()
95 public static void waitFor(long timeout, final PollingCheckCondition condition) { in waitFor() argument
99 return condition.canProceed(); in waitFor()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/flags/
DScreenIdleConditionTest.kt39 private lateinit var condition: ScreenIdleCondition variable in com.android.systemui.flags.ScreenIdleConditionTest
51 condition = ScreenIdleCondition({ powerInteractor }) in setup()
57 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_awake()
67 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_asleep()
77 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_invokesRetry()
DPluggedInConditionTest.kt40 private lateinit var condition: PluggedInCondition variable in com.android.systemui.flags.PluggedInConditionTest
52 condition = PluggedInCondition({ batteryController }) in setup()
60 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_unplugged()
70 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_pluggedIn()
80 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_invokesRetry()
DNotOccludedConditionTest.kt43 private lateinit var condition: NotOccludedCondition variable in com.android.systemui.flags.NotOccludedConditionTest
56 condition = NotOccludedCondition({ keyguardTransitionInteractor }) in setup()
63 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_occluded()
72 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_notOccluded()
81 val canRestart by collectLastValue(condition.canRestartNow) in testCondition_invokesRetry()
/frameworks/base/tests/SmokeTest/tests/src/com/android/smoketest/
DProcessErrorsTest.java291 String condition; in reportListContents() local
292 switch (entry.condition) { in reportListContents()
294 condition = "a CRASH"; in reportListContents()
297 condition = "an ANR"; in reportListContents()
300 condition = "an unknown error"; in reportListContents()
305 condition, entry.shortMsg)); in reportListContents()
306 if (entry.condition == ActivityManager.ProcessErrorStateInfo.CRASHED) { in reportListContents()
354 return (info.condition == peOther.info.condition) in equals()
375 code += info.condition; in hashCode()
/frameworks/base/test-junit/src/junit/framework/
DAssert.java18 static public void assertTrue(String message, boolean condition) { in assertTrue() argument
19 if (!condition) in assertTrue()
26 static public void assertTrue(boolean condition) { in assertTrue() argument
27 assertTrue(null, condition); in assertTrue()
33 static public void assertFalse(String message, boolean condition) { in assertFalse() argument
34 assertTrue(message, !condition); in assertFalse()
40 static public void assertFalse(boolean condition) { in assertFalse() argument
41 assertFalse(null, condition); in assertFalse()
/frameworks/base/services/core/java/com/android/server/notification/
DZenModeConditions.java72 && config.manualRule.condition != null in evaluateConfig()
122 public void onConditionChanged(Uri id, Condition condition) { in onConditionChanged() argument
123 if (DEBUG) Log.d(TAG, "onConditionChanged " + id + " " + condition); in onConditionChanged()
127 mHelper.setAutomaticZenRuleState(id, condition, in onConditionChanged()
176 rule.condition = null; in evaluateRule()
181 if (rule.component != null && rule.condition == null) { in evaluateRule()
182 rule.condition = mConditionProviders.findCondition(rule.component, rule.conditionId); in evaluateRule()
183 if (rule.condition != null && DEBUG) Log.d(TAG, "Found existing condition for: " in evaluateRule()
DScheduleConditionProvider.java173 Condition condition = in evaluateSubscriptions() local
176 if (condition != null) { in evaluateSubscriptions()
177 conditionsToNotify.add(condition); in evaluateSubscriptions()
191 Condition condition; in evaluateSubscriptionLocked() local
193 condition = createCondition(conditionId, Condition.STATE_ERROR, "!invalidId"); in evaluateSubscriptionLocked()
195 return condition; in evaluateSubscriptionLocked()
199 condition = createCondition(conditionId, Condition.STATE_FALSE, "snoozed"); in evaluateSubscriptionLocked()
201 condition = createCondition(conditionId, Condition.STATE_FALSE, "alarmCanceled"); in evaluateSubscriptionLocked()
204 condition = createCondition(conditionId, Condition.STATE_TRUE, "meetsSchedule"); in evaluateSubscriptionLocked()
207 condition = createCondition(conditionId, Condition.STATE_FALSE, "!meetsSchedule"); in evaluateSubscriptionLocked()
[all …]
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/accessibility/utils/
DTestUtils.java50 public static void waitForCondition(BooleanSupplier condition, String message) { in waitForCondition() argument
51 waitForCondition(condition, message, DEFAULT_CONDITION_DURATION); in waitForCondition()
62 public static void waitForCondition(BooleanSupplier condition, String message, long duration) { in waitForCondition() argument
65 while (!condition.getAsBoolean()) { in waitForCondition()

1234567