Alex Deymo | 40d86b2 | 2015-09-03 22:27:10 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2015 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 | #include "update_engine/hardware_android.h" |
| 18 | |
| 19 | #include <chromeos/make_unique_ptr.h> |
| 20 | |
| 21 | #include "update_engine/hardware.h" |
| 22 | |
| 23 | using std::string; |
| 24 | |
| 25 | namespace chromeos_update_engine { |
| 26 | |
| 27 | namespace hardware { |
| 28 | |
| 29 | // Factory defined in hardware.h. |
| 30 | std::unique_ptr<HardwareInterface> CreateHardware() { |
| 31 | return chromeos::make_unique_ptr(new HardwareAndroid()); |
| 32 | } |
| 33 | |
| 34 | } // namespace hardware |
| 35 | |
| 36 | bool HardwareAndroid::IsOfficialBuild() const { |
| 37 | // TODO(deymo): Read the kind of build we are running from the metadata |
| 38 | // partition. |
| 39 | LOG(WARNING) << "STUB: Assuming we are not an official build."; |
| 40 | return false; |
| 41 | } |
| 42 | |
| 43 | bool HardwareAndroid::IsNormalBootMode() const { |
| 44 | // TODO(deymo): Read the kind of build we are running from the metadata |
| 45 | // partition. |
| 46 | LOG(WARNING) << "STUB: Assuming we are in dev-mode."; |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | bool HardwareAndroid::IsOOBEComplete(base::Time* out_time_of_oobe) const { |
| 51 | LOG(WARNING) << "STUB: Assuming OOBE is complete."; |
Alex Deymo | 4d2990d | 2015-09-15 12:11:26 -0700 | [diff] [blame^] | 52 | if (out_time_of_oobe) |
| 53 | *out_time_of_oobe = base::Time(); |
Alex Deymo | 40d86b2 | 2015-09-03 22:27:10 -0700 | [diff] [blame] | 54 | return true; |
| 55 | } |
| 56 | |
| 57 | string HardwareAndroid::GetHardwareClass() const { |
| 58 | LOG(WARNING) << "STUB: GetHardwareClass()."; |
| 59 | return "ANDROID"; |
| 60 | } |
| 61 | |
| 62 | string HardwareAndroid::GetFirmwareVersion() const { |
| 63 | LOG(WARNING) << "STUB: GetFirmwareVersion()."; |
| 64 | return "0"; |
| 65 | } |
| 66 | |
| 67 | string HardwareAndroid::GetECVersion() const { |
| 68 | LOG(WARNING) << "STUB: GetECVersion()."; |
| 69 | return "0"; |
| 70 | } |
| 71 | |
| 72 | int HardwareAndroid::GetPowerwashCount() const { |
| 73 | LOG(WARNING) << "STUB: Assuming no factory reset was performed."; |
| 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | } // namespace chromeos_update_engine |