1fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller/*
2fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Copyright (C) 2017 The Android Open Source Project
3fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller *
4fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Licensed under the Apache License, Version 2.0 (the "License");
5fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * you may not use this file except in compliance with the License.
6fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * You may obtain a copy of the License at
7fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller *
8fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller *      http://www.apache.org/licenses/LICENSE-2.0
9fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller *
10fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Unless required by applicable law or agreed to in writing, software
11fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * distributed under the License is distributed on an "AS IS" BASIS,
12fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * See the License for the specific language governing permissions and
14fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * limitations under the License.
15fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */
16fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
17fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fullerpackage android.app.timezone;
18fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
19fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fullerimport android.annotation.IntDef;
20fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
21fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fullerimport java.lang.annotation.Retention;
22fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fullerimport java.lang.annotation.RetentionPolicy;
23fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
24fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller/**
25fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Callback interface for receiving information about an async time zone operation.
26fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * The methods will be called on your application's main thread.
27fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller *
28fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * @hide
29fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */
30fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fullerpublic abstract class Callback {
31fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
32fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    @Retention(RetentionPolicy.SOURCE)
33fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    @IntDef({SUCCESS, ERROR_UNKNOWN_FAILURE, ERROR_INSTALL_BAD_DISTRO_STRUCTURE,
34fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller        ERROR_INSTALL_BAD_DISTRO_FORMAT_VERSION, ERROR_INSTALL_RULES_TOO_OLD,
35fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller        ERROR_INSTALL_VALIDATION_ERROR})
36fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    public @interface AsyncResultCode {}
37fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
38fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    /**
39fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * Indicates that an operation succeeded.
40fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     */
41fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    public static final int SUCCESS = 0;
42fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
43fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    /**
44fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * Indicates an install / uninstall did not fully succeed for an unknown reason.
45fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     */
46fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    public static final int ERROR_UNKNOWN_FAILURE = 1;
47fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
48fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    /**
49fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * Indicates an install failed because of a structural issue with the provided distro,
50fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * e.g. it wasn't in the right format or the contents were structured incorrectly.
51fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     */
52fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    public static final int ERROR_INSTALL_BAD_DISTRO_STRUCTURE = 2;
53fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
54fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    /**
55fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * Indicates an install failed because of a versioning issue with the provided distro,
56fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * e.g. it was created for a different version of Android.
57fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     */
58fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    public static final int ERROR_INSTALL_BAD_DISTRO_FORMAT_VERSION = 3;
59fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
60fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    /**
61fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * Indicates an install failed because the rules provided are too old for the device,
62fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * e.g. the Android device shipped with a newer rules version.
63fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     */
64fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    public static final int ERROR_INSTALL_RULES_TOO_OLD = 4;
65fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
66fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    /**
67fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * Indicates an install failed because the distro contents failed validation.
68fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     */
69fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    public static final int ERROR_INSTALL_VALIDATION_ERROR = 5;
70fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller
71fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    /**
72fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     * Reports the result of an async time zone operation.
73fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller     */
74fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller    public abstract void onFinished(@AsyncResultCode int status);
75fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller}
76