Lines Matching refs:conditionId
110 public void onSubscribe(Uri conditionId) {
111 if (DEBUG) Slog.d(TAG, "onSubscribe " + conditionId);
112 if (tryParseNextAlarmCondition(conditionId) == BAD_CONDITION) {
113 notifyCondition(conditionId, null, Condition.STATE_FALSE, "badCondition");
116 mSubscriptions.add(conditionId);
121 public void onUnsubscribe(Uri conditionId) {
122 if (DEBUG) Slog.d(TAG, "onUnsubscribe " + conditionId);
123 mSubscriptions.remove(conditionId);
159 private long tryParseNextAlarmCondition(Uri conditionId) {
160 return conditionId != null && conditionId.getScheme().equals(Condition.SCHEME)
161 && conditionId.getAuthority().equals(ZenModeConfig.SYSTEM_AUTHORITY)
162 && conditionId.getPathSegments().size() == 3
163 && conditionId.getPathSegments().get(0).equals(ZenModeConfig.NEXT_ALARM_PATH)
164 && conditionId.getPathSegments().get(1)
166 ? tryParseLong(conditionId.getPathSegments().get(2), BAD_CONDITION)
196 for (Uri conditionId : conditions) {
197 final long time = tryParseNextAlarmCondition(conditionId);
199 notifyCondition(conditionId, nextAlarm, Condition.STATE_FALSE, "badCondition");
202 if (mSubscriptions.contains(conditionId)) {
203 notifyCondition(conditionId, nextAlarm, Condition.STATE_UNKNOWN, "!booted");
207 notifyCondition(conditionId, nextAlarm, Condition.STATE_FALSE, "changed");
210 notifyCondition(conditionId, nextAlarm, Condition.STATE_FALSE, "!within");
213 notifyCondition(conditionId, nextAlarm, Condition.STATE_TRUE, "within");