Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 | |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 17 | #ifndef IDMAP2_TESTS_R_H_ |
| 18 | #define IDMAP2_TESTS_R_H_ |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 19 | |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 20 | #include <string> |
| 21 | |
| 22 | #include "idmap2/ResourceUtils.h" |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 23 | |
| 24 | namespace android::idmap2 { |
| 25 | |
| 26 | static std::string hexify(ResourceId id) { |
| 27 | std::stringstream stream; |
| 28 | stream << std::hex << static_cast<uint32_t>(id); |
| 29 | return stream.str(); |
| 30 | } |
| 31 | |
| 32 | // clang-format off |
| 33 | namespace R::target { |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 34 | namespace integer { // NOLINT(runtime/indentation_namespace) |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 35 | constexpr ResourceId int1 = 0x7f010000; |
| 36 | |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 37 | namespace literal { // NOLINT(runtime/indentation_namespace) |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 38 | inline const std::string int1 = hexify(R::target::integer::int1); |
| 39 | } |
| 40 | } |
| 41 | |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 42 | namespace string { // NOLINT(runtime/indentation_namespace) |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 43 | constexpr ResourceId not_overlayable = 0x7f020003; |
| 44 | constexpr ResourceId other = 0x7f020004; |
Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 45 | constexpr ResourceId policy_actor = 0x7f020005; |
| 46 | constexpr ResourceId policy_odm = 0x7f020006; |
| 47 | constexpr ResourceId policy_oem = 0x7f020007; |
| 48 | constexpr ResourceId policy_product = 0x7f020008; |
| 49 | constexpr ResourceId policy_public = 0x7f020009; |
| 50 | constexpr ResourceId policy_signature = 0x7f02000a; |
| 51 | constexpr ResourceId policy_system = 0x7f02000b; |
| 52 | constexpr ResourceId policy_system_vendor = 0x7f02000c; |
| 53 | constexpr ResourceId str1 = 0x7f02000d; |
| 54 | constexpr ResourceId str3 = 0x7f02000f; |
| 55 | constexpr ResourceId str4 = 0x7f020010; |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 56 | |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 57 | namespace literal { // NOLINT(runtime/indentation_namespace) |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 58 | inline const std::string str1 = hexify(R::target::string::str1); |
| 59 | inline const std::string str3 = hexify(R::target::string::str3); |
| 60 | inline const std::string str4 = hexify(R::target::string::str4); |
| 61 | } |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 62 | } // namespace string |
| 63 | } // namespace R::target |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 64 | |
| 65 | namespace R::overlay { |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 66 | namespace integer { // NOLINT(runtime/indentation_namespace) |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 67 | constexpr ResourceId int1 = 0x7f010000; |
| 68 | } |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 69 | namespace string { // NOLINT(runtime/indentation_namespace) |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 70 | constexpr ResourceId str1 = 0x7f020000; |
| 71 | constexpr ResourceId str3 = 0x7f020001; |
| 72 | constexpr ResourceId str4 = 0x7f020002; |
| 73 | } |
| 74 | } |
| 75 | |
Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 76 | namespace R::overlay_shared { |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 77 | namespace integer { // NOLINT(runtime/indentation_namespace) |
Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 78 | constexpr ResourceId int1 = 0x00010000; |
| 79 | } |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 80 | namespace string { // NOLINT(runtime/indentation_namespace) |
Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 81 | constexpr ResourceId str1 = 0x00020000; |
| 82 | constexpr ResourceId str3 = 0x00020001; |
| 83 | constexpr ResourceId str4 = 0x00020002; |
| 84 | } |
| 85 | } |
| 86 | |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 87 | namespace R::system_overlay::string { |
| 88 | constexpr ResourceId policy_public = 0x7f010000; |
| 89 | constexpr ResourceId policy_system = 0x7f010001; |
| 90 | constexpr ResourceId policy_system_vendor = 0x7f010002; |
| 91 | } |
| 92 | |
| 93 | namespace R::system_overlay_invalid::string { |
| 94 | constexpr ResourceId not_overlayable = 0x7f010000; |
| 95 | constexpr ResourceId other = 0x7f010001; |
Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 96 | constexpr ResourceId policy_actor = 0x7f010002; |
| 97 | constexpr ResourceId policy_odm = 0x7f010003; |
| 98 | constexpr ResourceId policy_oem = 0x7f010004; |
| 99 | constexpr ResourceId policy_product = 0x7f010005; |
| 100 | constexpr ResourceId policy_public = 0x7f010006; |
| 101 | constexpr ResourceId policy_signature = 0x7f010007; |
| 102 | constexpr ResourceId policy_system = 0x7f010008; |
| 103 | constexpr ResourceId policy_system_vendor = 0x7f010009; |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 104 | } // namespace R::system_overlay_invalid::string |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 105 | // clang-format on |
| 106 | |
| 107 | } // namespace android::idmap2 |
| 108 | |
Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame^] | 109 | #endif // IDMAP2_TESTS_R_H_ |