diff options
author | Yifan Hong | 2018-01-11 20:15:24 -0600 |
---|---|---|
committer | Yifan Hong | 2018-01-12 02:07:26 -0600 |
commit | afae198ce40f51b116c2540ca87f9157c3a56ea4 (patch) | |
tree | 4c188340b56dc2e679ad0b238d3c12f83c340ef1 /utils.h | |
parent | a32b7548a5f14d5eebf7f0ab6ad10f12a7ca4f73 (diff) | |
download | platform-system-libvintf-afae198ce40f51b116c2540ca87f9157c3a56ea4.tar.gz platform-system-libvintf-afae198ce40f51b116c2540ca87f9157c3a56ea4.tar.xz platform-system-libvintf-afae198ce40f51b116c2540ca87f9157c3a56ea4.zip |
convertFromApiLevel: move to utils.h.
Test: pass
Bug: 70628538
Change-Id: I611ab4ecab1c33496db9ed72a0d13b5c6b34cabf
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -107,6 +107,19 @@ class ObjectFactory { | |||
107 | }; | 107 | }; |
108 | extern ObjectFactory<RuntimeInfo>* gRuntimeInfoFactory; | 108 | extern ObjectFactory<RuntimeInfo>* gRuntimeInfoFactory; |
109 | 109 | ||
110 | // TODO(b/70628538): Do not infer from Shipping API level. | ||
111 | inline Level convertFromApiLevel(size_t apiLevel) { | ||
112 | if (apiLevel < 26) { | ||
113 | return Level::LEGACY; | ||
114 | } else if (apiLevel == 26) { | ||
115 | return Level::O; | ||
116 | } else if (apiLevel == 27) { | ||
117 | return Level::O_MR1; | ||
118 | } else { | ||
119 | return Level::UNSPECIFIED; | ||
120 | } | ||
121 | } | ||
122 | |||
110 | } // namespace details | 123 | } // namespace details |
111 | } // namespace vintf | 124 | } // namespace vintf |
112 | } // namespace android | 125 | } // namespace android |