| 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; |
| Zoran Jovanovic | 9336d9e | 2020-06-09 18:51:57 +0200 | [diff] [blame] | 46 | constexpr ResourceId policy_config_signature = 0x7f020006; |
| 47 | constexpr ResourceId policy_odm = 0x7f020007; |
| 48 | constexpr ResourceId policy_oem = 0x7f020008; |
| 49 | constexpr ResourceId policy_product = 0x7f020009; |
| 50 | constexpr ResourceId policy_public = 0x7f02000a; |
| 51 | constexpr ResourceId policy_signature = 0x7f02000b; |
| 52 | constexpr ResourceId policy_system = 0x7f02000c; |
| 53 | constexpr ResourceId policy_system_vendor = 0x7f02000d; |
| 54 | constexpr ResourceId str1 = 0x7f02000e; |
| 55 | constexpr ResourceId str3 = 0x7f020010; |
| 56 | constexpr ResourceId str4 = 0x7f020011; |
| Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 57 | |
| Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame] | 58 | namespace literal { // NOLINT(runtime/indentation_namespace) |
| Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 59 | inline const std::string str1 = hexify(R::target::string::str1); |
| 60 | inline const std::string str3 = hexify(R::target::string::str3); |
| 61 | inline const std::string str4 = hexify(R::target::string::str4); |
| 62 | } |
| Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame] | 63 | } // namespace string |
| 64 | } // namespace R::target |
| Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 65 | |
| 66 | namespace R::overlay { |
| Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame] | 67 | namespace integer { // NOLINT(runtime/indentation_namespace) |
| Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 68 | constexpr ResourceId int1 = 0x7f010000; |
| 69 | } |
| Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame] | 70 | namespace string { // NOLINT(runtime/indentation_namespace) |
| Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 71 | constexpr ResourceId str1 = 0x7f020000; |
| 72 | constexpr ResourceId str3 = 0x7f020001; |
| 73 | constexpr ResourceId str4 = 0x7f020002; |
| 74 | } |
| 75 | } |
| 76 | |
| Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 77 | namespace R::overlay_shared { |
| Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame] | 78 | namespace integer { // NOLINT(runtime/indentation_namespace) |
| Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 79 | constexpr ResourceId int1 = 0x00010000; |
| 80 | } |
| Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame] | 81 | namespace string { // NOLINT(runtime/indentation_namespace) |
| Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 82 | constexpr ResourceId str1 = 0x00020000; |
| 83 | constexpr ResourceId str3 = 0x00020001; |
| 84 | constexpr ResourceId str4 = 0x00020002; |
| 85 | } |
| 86 | } |
| 87 | |
| Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 88 | namespace R::system_overlay::string { |
| 89 | constexpr ResourceId policy_public = 0x7f010000; |
| 90 | constexpr ResourceId policy_system = 0x7f010001; |
| 91 | constexpr ResourceId policy_system_vendor = 0x7f010002; |
| 92 | } |
| 93 | |
| 94 | namespace R::system_overlay_invalid::string { |
| 95 | constexpr ResourceId not_overlayable = 0x7f010000; |
| 96 | constexpr ResourceId other = 0x7f010001; |
| Winson | f56ade3 | 2019-12-04 11:32:41 -0800 | [diff] [blame] | 97 | constexpr ResourceId policy_actor = 0x7f010002; |
| Zoran Jovanovic | 9336d9e | 2020-06-09 18:51:57 +0200 | [diff] [blame] | 98 | constexpr ResourceId policy_config_signature = 0x7f010003; |
| 99 | constexpr ResourceId policy_odm = 0x7f010004; |
| 100 | constexpr ResourceId policy_oem = 0x7f010005; |
| 101 | constexpr ResourceId policy_product = 0x7f010006; |
| 102 | constexpr ResourceId policy_public = 0x7f010007; |
| 103 | constexpr ResourceId policy_signature = 0x7f010008; |
| 104 | constexpr ResourceId policy_system = 0x7f010009; |
| 105 | constexpr ResourceId policy_system_vendor = 0x7f01000a; |
| Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame] | 106 | } // namespace R::system_overlay_invalid::string |
| Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 107 | // clang-format on |
| 108 | |
| 109 | } // namespace android::idmap2 |
| 110 | |
| Mårten Kongstad | c4799eb | 2020-06-04 20:48:11 +0200 | [diff] [blame] | 111 | #endif // IDMAP2_TESTS_R_H_ |