Andreas Gampe | a890875 | 2015-11-10 08:58:14 -0800 | [diff] [blame] | 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 | */ |
| 32 | void prepare(); |
| 33 | |
| 34 | /** |
| 35 | * Clean up all internal state. |
| 36 | */ |
| 37 | void cleanup(); |
| 38 | |
| 39 | /** |
| 40 | * Check whether all updates have been performed. |
| 41 | */ |
| 42 | boolean isDone(); |
| 43 | |
| 44 | /** |
Andreas Gampe | bf06232 | 2016-06-10 15:21:39 -0700 | [diff] [blame] | 45 | * Return the progress (0..1) made in this session. When {@link #isDone() isDone} returns |
| 46 | * true, the progress value will be 1. |
| 47 | */ |
| 48 | float getProgress(); |
| 49 | |
| 50 | /** |
Andreas Gampe | a890875 | 2015-11-10 08:58:14 -0800 | [diff] [blame] | 51 | * Optimize the next package. Note: this command is synchronous, that is, only returns after |
| 52 | * the package has been dexopted (or dexopting failed). |
Andreas Gampe | cc241a5 | 2016-06-23 20:27:12 -0700 | [diff] [blame] | 53 | * |
| 54 | * Note: this will be removed after a transition period. Use nextDexoptCommand instead. |
Andreas Gampe | a890875 | 2015-11-10 08:58:14 -0800 | [diff] [blame] | 55 | */ |
| 56 | void dexoptNextPackage(); |
Andreas Gampe | cc241a5 | 2016-06-23 20:27:12 -0700 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * Get the optimization parameters for the next package. |
| 60 | */ |
| 61 | String nextDexoptCommand(); |
Andreas Gampe | a890875 | 2015-11-10 08:58:14 -0800 | [diff] [blame] | 62 | } |