Home | History | Annotate | Download | only in vintf
      1 /*
      2  * Copyright (C) 2017 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 #ifndef ANDROID_VINTF_VINTF_OBJECT_RECOVERY_H_
     18 #define ANDROID_VINTF_VINTF_OBJECT_RECOVERY_H_
     19 
     20 #include "VintfObject.h"
     21 
     22 #include "utils/Errors.h"
     23 
     24 namespace android {
     25 namespace vintf {
     26 
     27 // Recovery version of VintfObject. It mount partitions if necessary. Partitions
     28 // are unmounted afterwards.
     29 
     30 class VintfObjectRecovery {
     31 public:
     32     /**
     33      * Check compatibility, given a set of manifests / matrices in packageInfo.
     34      * They will be checked against the manifests / matrices on the device.
     35      * Partitions (/system, /vendor) are mounted if necessary.
     36      *
     37      * @param packageInfo a list of XMLs of HalManifest /
     38      * CompatibilityMatrix objects.
     39      *
     40      * @return = 0 if success (compatible)
     41      *         > 0 if incompatible
     42      *         < 0 if any error (mount partition fails, illformed XML, etc.)
     43      */
     44     static int32_t CheckCompatibility(
     45             const std::vector<std::string> &packageInfo,
     46             std::string *error = nullptr);
     47 
     48 };
     49 
     50 } // namespace vintf
     51 } // namespace android
     52 
     53 #endif // ANDROID_VINTF_VINTF_OBJECT_RECOVERY_H_
     54