otapreopt_parameters.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. ** Copyright 2018, 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. #ifndef OTAPREOPT_PARAMETERS_H_
  17. #define OTAPREOPT_PARAMETERS_H_
  18. #include <string>
  19. #include <sys/types.h>
  20. namespace android {
  21. namespace installd {
  22. class OTAPreoptParameters {
  23. public:
  24. bool ReadArguments(int argc, const char** argv);
  25. private:
  26. bool ReadArgumentsV1(const char** argv);
  27. bool ReadArgumentsPostV1(uint32_t version, const char** argv, bool versioned);
  28. void SetDefaultsForPostV1Arguments();
  29. const char* apk_path;
  30. uid_t uid;
  31. const char* pkgName;
  32. const char* instruction_set;
  33. int dexopt_needed;
  34. const char* oat_dir;
  35. int dexopt_flags;
  36. const char* compiler_filter;
  37. const char* volume_uuid;
  38. const char* shared_libraries;
  39. const char* se_info;
  40. bool downgrade;
  41. int target_sdk_version;
  42. const char* profile_name;
  43. const char* dex_metadata_path;
  44. const char* compilation_reason;
  45. std::string target_slot;
  46. friend class OTAPreoptService;
  47. friend class OTAPreoptTest;
  48. };
  49. } // namespace installd
  50. } // namespace android
  51. #endif // OTAPREOPT_PARAMETERS_H_