• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 //
16 
17 #ifndef UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_
18 #define UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_
19 
20 #include <string>
21 
22 #include <base/version.h>
23 
24 #include "update_engine/update_manager/provider.h"
25 #include "update_engine/update_manager/variable.h"
26 
27 namespace chromeos_update_manager {
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:
~SystemProvider()33   ~SystemProvider() override {}
34 
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.
38   virtual Variable<bool>* var_is_normal_boot_mode() = 0;
39 
40   // Returns whether this is an official Chrome OS build.
41   virtual Variable<bool>* var_is_official_build() = 0;
42 
43   // Returns a variable that tells whether OOBE was completed.
44   virtual Variable<bool>* var_is_oobe_complete() = 0;
45 
46   // Returns a variable that tells the number of slots in the system.
47   virtual Variable<unsigned int>* var_num_slots() = 0;
48 
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 
53   // Chrome OS version number as provided by |ImagePropeties|.
54   virtual Variable<base::Version>* var_chromeos_version() = 0;
55 
56  protected:
SystemProvider()57   SystemProvider() {}
58 
59  private:
60   DISALLOW_COPY_AND_ASSIGN(SystemProvider);
61 };
62 
63 }  // namespace chromeos_update_manager
64 
65 #endif  // UPDATE_ENGINE_UPDATE_MANAGER_SYSTEM_PROVIDER_H_
66