1 /*
2  * Copyright (C) 2024 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 
17 package android.os;
18 
19 /**
20  * Callback function for UpdateEngineStable. Used to keep the caller up to date with progress, so
21  * the UI (if any) can be updated.
22  *
23  * <p>The APIs defined in this class and UpdateEngineStable class must be in sync with the ones in
24  * system/update_engine/stable/android/os/IUpdateEngineStable.aidl and
25  * system/update_engine/stable/android/os/IUpdateEngineStableCallback.aidl.
26  *
27  * <p>{@hide}
28  */
29 public abstract class UpdateEngineStableCallback {
30 
31     /**
32      * Invoked when anything changes. The value of {@code status} will be one of the values from
33      * {@link UpdateEngine.UpdateStatusConstants}, and {@code percent} will be valid
34      *
35      * @hide
36      */
onStatusUpdate(int status, float percent)37     public abstract void onStatusUpdate(int status, float percent);
38 
39     /**
40      * Invoked when the payload has been applied, whether successfully or unsuccessfully. The value
41      * of {@code errorCode} will be one of the values from {@link UpdateEngine.ErrorCodeConstants}.
42      *
43      * @hide
44      */
onPayloadApplicationComplete(@pdateEngineStable.ErrorCode int errorCode)45     public abstract void onPayloadApplicationComplete(@UpdateEngineStable.ErrorCode int errorCode);
46 }
47