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) 33ce8db9911494225fcd99711d7df85a130de5a6ceJeff Sharkey @IntDef(prefix = { "SUCCESS", "ERROR_" }, value = { 34ce8db9911494225fcd99711d7df85a130de5a6ceJeff Sharkey SUCCESS, 35ce8db9911494225fcd99711d7df85a130de5a6ceJeff Sharkey ERROR_UNKNOWN_FAILURE, 36ce8db9911494225fcd99711d7df85a130de5a6ceJeff Sharkey ERROR_INSTALL_BAD_DISTRO_STRUCTURE, 37ce8db9911494225fcd99711d7df85a130de5a6ceJeff Sharkey ERROR_INSTALL_BAD_DISTRO_FORMAT_VERSION, 38ce8db9911494225fcd99711d7df85a130de5a6ceJeff Sharkey ERROR_INSTALL_RULES_TOO_OLD, 39ce8db9911494225fcd99711d7df85a130de5a6ceJeff Sharkey ERROR_INSTALL_VALIDATION_ERROR 40ce8db9911494225fcd99711d7df85a130de5a6ceJeff Sharkey }) 41fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller public @interface AsyncResultCode {} 42fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller 43fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller /** 44fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Indicates that an operation succeeded. 45fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */ 46fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller public static final int SUCCESS = 0; 47fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller 48fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller /** 49fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Indicates an install / uninstall did not fully succeed for an unknown reason. 50fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */ 51fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller public static final int ERROR_UNKNOWN_FAILURE = 1; 52fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller 53fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller /** 54fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Indicates an install failed because of a structural issue with the provided distro, 55fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * e.g. it wasn't in the right format or the contents were structured incorrectly. 56fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */ 57fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller public static final int ERROR_INSTALL_BAD_DISTRO_STRUCTURE = 2; 58fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller 59fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller /** 60fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Indicates an install failed because of a versioning issue with the provided distro, 61fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * e.g. it was created for a different version of Android. 62fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */ 63fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller public static final int ERROR_INSTALL_BAD_DISTRO_FORMAT_VERSION = 3; 64fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller 65fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller /** 66fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Indicates an install failed because the rules provided are too old for the device, 67fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * e.g. the Android device shipped with a newer rules version. 68fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */ 69fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller public static final int ERROR_INSTALL_RULES_TOO_OLD = 4; 70fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller 71fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller /** 72fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Indicates an install failed because the distro contents failed validation. 73fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */ 74fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller public static final int ERROR_INSTALL_VALIDATION_ERROR = 5; 75fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller 76fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller /** 77fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller * Reports the result of an async time zone operation. 78fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller */ 79fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller public abstract void onFinished(@AsyncResultCode int status); 80fe6ec56cce981731be7d0bc0e61a0411d0a0d2cfNeil Fuller} 81