Alex Deymo | aea4c1c | 2015-08-19 20:24:43 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2014 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 | // |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 16 | |
Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame] | 17 | #ifndef UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_ |
| 18 | #define UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_ |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 19 | |
Miriam Polzer | 8db5249 | 2020-09-17 14:06:46 +0200 | [diff] [blame] | 20 | #include <string> |
| 21 | |
| 22 | #include <base/version.h> |
| 23 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 24 | #include "update_engine/update_manager/provider.h" |
| 25 | #include "update_engine/update_manager/variable.h" |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 26 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 27 | namespace chromeos_update_manager { |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 28 | |
| 29 | // Provider for system information, mostly constant, such as the information |
| 30 | // reported by crossystem, the kernel boot command line and the partition table. |
| 31 | class SystemProvider : public Provider { |
| 32 | public: |
Alex Deymo | 610277e | 2014-11-11 21:18:11 -0800 | [diff] [blame] | 33 | ~SystemProvider() override {} |
David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 34 | |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 35 | // Returns true if the boot mode is normal or if it's unable to |
| 36 | // determine the boot mode. Returns false if the boot mode is |
| 37 | // developer. |
David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 38 | virtual Variable<bool>* var_is_normal_boot_mode() = 0; |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 39 | |
| 40 | // Returns whether this is an official Chrome OS build. |
David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 41 | virtual Variable<bool>* var_is_official_build() = 0; |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 42 | |
Gilad Arnold | 48e1361 | 2014-05-16 10:18:05 -0700 | [diff] [blame] | 43 | // Returns a variable that tells whether OOBE was completed. |
| 44 | virtual Variable<bool>* var_is_oobe_complete() = 0; |
| 45 | |
Alex Deymo | 763e7db | 2015-08-27 21:08:08 -0700 | [diff] [blame] | 46 | // Returns a variable that tells the number of slots in the system. |
| 47 | virtual Variable<unsigned int>* var_num_slots() = 0; |
Gilad Arnold | bfc44f7 | 2014-07-09 14:41:39 -0700 | [diff] [blame] | 48 | |
Xiyuan Xia | 6e30bc5 | 2016-02-24 15:35:42 -0800 | [diff] [blame] | 49 | // Returns the required platform version of the configured auto launch |
| 50 | // with zero delay kiosk app if any. |
| 51 | virtual Variable<std::string>* var_kiosk_required_platform_version() = 0; |
| 52 | |
Miriam Polzer | 8db5249 | 2020-09-17 14:06:46 +0200 | [diff] [blame] | 53 | // Chrome OS version number as provided by |ImagePropeties|. |
| 54 | virtual Variable<base::Version>* var_chromeos_version() = 0; |
| 55 | |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 56 | protected: |
| 57 | SystemProvider() {} |
| 58 | |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 59 | private: |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 60 | DISALLOW_COPY_AND_ASSIGN(SystemProvider); |
| 61 | }; |
| 62 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 63 | } // namespace chromeos_update_manager |
Alex Deymo | bd04b14 | 2014-03-18 15:00:05 -0700 | [diff] [blame] | 64 | |
Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame] | 65 | #endif // UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_ |