1 /* 2 * Copyright (C) 2016 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.brillo; 18 19 import android.brillo.IUpdateEngineStatusCallback; 20 import android.brillo.ParcelableUpdateEngineStatus; 21 22 interface IUpdateEngine { SetUpdateAttemptFlags(in int flags)23 void SetUpdateAttemptFlags(in int flags); AttemptUpdate(in String app_version, in String omaha_url, in int flags)24 boolean AttemptUpdate(in String app_version, in String omaha_url, in int flags); AttemptRollback(in boolean powerwash)25 void AttemptRollback(in boolean powerwash); CanRollback()26 boolean CanRollback(); ResetStatus()27 void ResetStatus(); GetStatus()28 ParcelableUpdateEngineStatus GetStatus(); RebootIfNeeded()29 void RebootIfNeeded(); SetChannel(in String target_channel, in boolean powewash)30 void SetChannel(in String target_channel, in boolean powewash); GetChannel(in boolean get_current_channel)31 String GetChannel(in boolean get_current_channel); SetCohortHint(in String cohort_hint)32 void SetCohortHint(in String cohort_hint); GetCohortHint()33 String GetCohortHint(); SetP2PUpdatePermission(in boolean enabled)34 void SetP2PUpdatePermission(in boolean enabled); GetP2PUpdatePermission()35 boolean GetP2PUpdatePermission(); SetUpdateOverCellularPermission(in boolean enabled)36 void SetUpdateOverCellularPermission(in boolean enabled); SetUpdateOverCellularTarget(in String target_version, in long target_size)37 void SetUpdateOverCellularTarget(in String target_version, 38 in long target_size); GetUpdateOverCellularPermission()39 boolean GetUpdateOverCellularPermission(); GetDurationSinceUpdate()40 long GetDurationSinceUpdate(); GetPrevVersion()41 String GetPrevVersion(); GetRollbackPartition()42 String GetRollbackPartition(); RegisterStatusCallback(in IUpdateEngineStatusCallback callback)43 void RegisterStatusCallback(in IUpdateEngineStatusCallback callback); GetLastAttemptError()44 int GetLastAttemptError(); GetEolStatus()45 int GetEolStatus(); 46 } 47