1 /* 2 ** 3 ** Copyright 2016, The Android Open Source Project 4 ** 5 ** Licensed under the Apache License, Version 2.0 (the "License"); 6 ** you may not use this file except in compliance with the License. 7 ** You may obtain a copy of the License at 8 ** 9 ** http://www.apache.org/licenses/LICENSE-2.0 10 ** 11 ** Unless required by applicable law or agreed to in writing, software 12 ** distributed under the License is distributed on an "AS IS" BASIS, 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ** See the License for the specific language governing permissions and 15 ** limitations under the License. 16 */ 17 18 package android.content.pm; 19 20 /** 21 * A/B OTA dexopting service. 22 * 23 * {@hide} 24 */ 25 interface IOtaDexopt { 26 /** 27 * Prepare for A/B OTA dexopt. Initialize internal structures. 28 * 29 * Calls to the other methods are only valid after a call to prepare. You may not call 30 * prepare twice without a cleanup call. 31 */ prepare()32 void prepare(); 33 34 /** 35 * Clean up all internal state. 36 */ cleanup()37 void cleanup(); 38 39 /** 40 * Check whether all updates have been performed. 41 */ isDone()42 boolean isDone(); 43 44 /** 45 * Return the progress (0..1) made in this session. When {@link #isDone() isDone} returns 46 * true, the progress value will be 1. 47 */ getProgress()48 float getProgress(); 49 50 /** 51 * Optimize the next package. Note: this command is synchronous, that is, only returns after 52 * the package has been dexopted (or dexopting failed). 53 * 54 * Note: this will be removed after a transition period. Use nextDexoptCommand instead. 55 */ dexoptNextPackage()56 void dexoptNextPackage(); 57 58 /** 59 * Get the optimization parameters for the next package. 60 */ nextDexoptCommand()61 String nextDexoptCommand(); 62 } 63