blob: a2f6e446069b9d4440124ef8524d99e1c50ed9a7 [file] [log] [blame]
Calin Juravlec9e76792018-02-01 14:44:56 +00001/*
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
17#ifndef OTAPREOPT_PARAMETERS_H_
18#define OTAPREOPT_PARAMETERS_H_
19
20#include <string>
21#include <sys/types.h>
22
23namespace android {
24namespace installd {
25
26class OTAPreoptParameters {
27 public:
28 bool ReadArguments(int argc, const char** argv);
29
30 private:
Calin Juravle7707aea2018-02-01 14:56:14 +000031 bool ReadArgumentsV1(const char** argv);
32 bool ReadArgumentsPostV1(uint32_t version, const char** argv, bool versioned);
Calin Juravlec9e76792018-02-01 14:44:56 +000033
Calin Juravledcccd832018-02-13 18:31:32 -080034 void SetDefaultsForPostV1Arguments();
Calin Juravlec9e76792018-02-01 14:44:56 +000035 const char* apk_path;
36 uid_t uid;
37 const char* pkgName;
38 const char* instruction_set;
39 int dexopt_needed;
40 const char* oat_dir;
41 int dexopt_flags;
42 const char* compiler_filter;
43 const char* volume_uuid;
44 const char* shared_libraries;
45 const char* se_info;
46 bool downgrade;
47 int target_sdk_version;
48 const char* profile_name;
Calin Juravlecc3b8ae2018-02-01 17:03:23 +000049 const char* dex_metadata_path;
Calin Juravledcccd832018-02-13 18:31:32 -080050 const char* compilation_reason;
Calin Juravlec9e76792018-02-01 14:44:56 +000051
52 std::string target_slot;
53
54 friend class OTAPreoptService;
55 friend class OTAPreoptTest;
56};
57
58} // namespace installd
59} // namespace android
60
Calin Juravledcccd832018-02-13 18:31:32 -080061#endif // OTAPREOPT_PARAMETERS_H_