blob: 3753ece03bb0b3016feb2895a6ce4113bd50bcbb [file] [log] [blame]
Neil Fuller328532a2017-03-16 18:32:21 +00001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server.timezone;
18
19/**
20 * An easy-to-mock interface around intent sending / receiving for use by {@link PackageTracker};
21 * it is not possible to test various cases with the real one because of the need to simulate
22 * receiving and broadcasting intents.
23 */
Neil Fullerb1442272017-12-18 15:59:50 +000024interface PackageTrackerIntentHelper {
Neil Fuller328532a2017-03-16 18:32:21 +000025
Neil Fullercd1a1092017-09-13 21:59:59 +010026 void initialize(String updateAppPackageName, String dataAppPackageName,
27 PackageTracker packageTracker);
Neil Fuller328532a2017-03-16 18:32:21 +000028
29 void sendTriggerUpdateCheck(CheckToken checkToken);
30
Neil Fullercd1a1092017-09-13 21:59:59 +010031 /**
32 * Schedule a "reliability trigger" after at least minimumDelayMillis, replacing any existing
33 * scheduled one. A reliability trigger ensures that the {@link PackageTracker} can pick up
34 * reliably if a previous update check did not complete for some reason. It can happen when
35 * the device is idle. The trigger is expected to call
36 * {@link PackageTracker#triggerUpdateIfNeeded(boolean)} with a {@code false} value.
37 */
38 void scheduleReliabilityTrigger(long minimumDelayMillis);
Neil Fuller328532a2017-03-16 18:32:21 +000039
Neil Fullercd1a1092017-09-13 21:59:59 +010040 /**
41 * Make sure there is no reliability trigger scheduled. No-op if there wasn't one.
42 */
43 void unscheduleReliabilityTrigger();
Neil Fuller328532a2017-03-16 18:32:21 +000044}