• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 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 import android.os.IUpdateEngineCallback;
20 import android.os.ParcelFileDescriptor;
21 
22 /** @hide */
23 interface IUpdateEngine {
24   /** @hide */
applyPayload(String url, in long payload_offset, in long payload_size, in String[] headerKeyValuePairs)25   void applyPayload(String url,
26                     in long payload_offset,
27                     in long payload_size,
28                     in String[] headerKeyValuePairs);
29   /** @hide */
applyPayloadFd(in ParcelFileDescriptor pfd, in long payload_offset, in long payload_size, in String[] headerKeyValuePairs)30   void applyPayloadFd(in ParcelFileDescriptor pfd,
31                       in long payload_offset,
32                       in long payload_size,
33                       in String[] headerKeyValuePairs);
34   /** @hide */
bind(IUpdateEngineCallback callback)35   boolean bind(IUpdateEngineCallback callback);
36   /** @hide */
unbind(IUpdateEngineCallback callback)37   boolean unbind(IUpdateEngineCallback callback);
38   /** @hide */
suspend()39   void suspend();
40   /** @hide */
resume()41   void resume();
42   /** @hide */
cancel()43   void cancel();
44   /** @hide */
resetStatus()45   void resetStatus();
46   /** @hide */
setShouldSwitchSlotOnReboot(in String metadataFilename)47   void setShouldSwitchSlotOnReboot(in String metadataFilename);
48   /** @hide */
resetShouldSwitchSlotOnReboot()49   void resetShouldSwitchSlotOnReboot();
50 
51   /** @hide */
verifyPayloadApplicable(in String metadataFilename)52   boolean verifyPayloadApplicable(in String metadataFilename);
53   /**
54    * Allocate space on userdata partition.
55    *
56    * @return 0 indicates allocation is successful.
57    *   Non-zero indicates space is insufficient. The returned value is the
58    *   total required space (in bytes) on userdata partition.
59    *
60    * @throws ServiceSpecificException for other errors.
61    *
62    * @hide
63    */
allocateSpaceForPayload(in String metadataFilename, in String[] headerKeyValuePairs)64   long allocateSpaceForPayload(in String metadataFilename,
65                                in String[] headerKeyValuePairs);
66   /** @hide
67    *
68    * Wait for merge to finish, and clean up necessary files.
69    *
70    * @param callback Report status updates in callback (not the one previously
71    * bound with {@link #bind()}).
72    * {@link IUpdateEngineCallback#onStatusUpdate} is called with
73    * CLEANUP_PREVIOUS_UPDATE and a progress value during the cleanup.
74    * {@link IUpdateEngineCallback#onPayloadApplicationComplete} is called at
75    * the end with SUCCESS if successful. ERROR if transient errors (e.g. merged
76    * but needs reboot). DEVICE_CORRUPTED for permanent errors.
77    */
cleanupSuccessfulUpdate(IUpdateEngineCallback callback)78   void cleanupSuccessfulUpdate(IUpdateEngineCallback callback);
79 }
80