blob: 8eb14e3bd93602054a5fd1d99c51640a6b6db245 [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
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 Deymobd04b142014-03-18 15:00:05 -070016
Gilad Arnold48415f12014-06-27 07:10:58 -070017#ifndef UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_
18#define UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_
Alex Deymobd04b142014-03-18 15:00:05 -070019
Miriam Polzer8db52492020-09-17 14:06:46 +020020#include <string>
21
22#include <base/version.h>
23
Alex Deymo63784a52014-05-28 10:46:14 -070024#include "update_engine/update_manager/provider.h"
25#include "update_engine/update_manager/variable.h"
Alex Deymobd04b142014-03-18 15:00:05 -070026
Alex Deymo63784a52014-05-28 10:46:14 -070027namespace chromeos_update_manager {
Alex Deymobd04b142014-03-18 15:00:05 -070028
29// Provider for system information, mostly constant, such as the information
30// reported by crossystem, the kernel boot command line and the partition table.
31class SystemProvider : public Provider {
32 public:
Alex Deymo610277e2014-11-11 21:18:11 -080033 ~SystemProvider() override {}
David Zeuthen21716e22014-04-23 15:42:05 -070034
Alex Deymobd04b142014-03-18 15:00:05 -070035 // 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 Zeuthen21716e22014-04-23 15:42:05 -070038 virtual Variable<bool>* var_is_normal_boot_mode() = 0;
Alex Deymobd04b142014-03-18 15:00:05 -070039
40 // Returns whether this is an official Chrome OS build.
David Zeuthen21716e22014-04-23 15:42:05 -070041 virtual Variable<bool>* var_is_official_build() = 0;
Alex Deymobd04b142014-03-18 15:00:05 -070042
Gilad Arnold48e13612014-05-16 10:18:05 -070043 // Returns a variable that tells whether OOBE was completed.
44 virtual Variable<bool>* var_is_oobe_complete() = 0;
45
Alex Deymo763e7db2015-08-27 21:08:08 -070046 // Returns a variable that tells the number of slots in the system.
47 virtual Variable<unsigned int>* var_num_slots() = 0;
Gilad Arnoldbfc44f72014-07-09 14:41:39 -070048
Xiyuan Xia6e30bc52016-02-24 15:35:42 -080049 // 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 Polzer8db52492020-09-17 14:06:46 +020053 // Chrome OS version number as provided by |ImagePropeties|.
54 virtual Variable<base::Version>* var_chromeos_version() = 0;
55
Alex Deymobd04b142014-03-18 15:00:05 -070056 protected:
57 SystemProvider() {}
58
Alex Deymobd04b142014-03-18 15:00:05 -070059 private:
Alex Deymobd04b142014-03-18 15:00:05 -070060 DISALLOW_COPY_AND_ASSIGN(SystemProvider);
61};
62
Alex Deymo63784a52014-05-28 10:46:14 -070063} // namespace chromeos_update_manager
Alex Deymobd04b142014-03-18 15:00:05 -070064
Gilad Arnold48415f12014-06-27 07:10:58 -070065#endif // UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_