Add Exynos bootctrl hal
authordeadman96385 <seanhoyt963@gmail.com>
Tue, 24 Mar 2020 03:06:34 +0000 (22:06 -0500)
committerdeadman96385 <seanhoyt963@gmail.com>
Tue, 24 Mar 2020 03:07:24 +0000 (22:07 -0500)
https://review.lineageos.org/c/LineageOS/android_hardware_samsung/+/271378

Android.bp [new file with mode: 0644]
bootctrl/Android.bp [new file with mode: 0644]
bootctrl/BootControl.cpp [new file with mode: 0644]
bootctrl/BootControl.h [new file with mode: 0644]
bootctrl/bctl_metadata.h [new file with mode: 0644]
device.mk
recovery/root/sbin/android.hidl.base@1.0.so [deleted file]
recovery/root/vendor/lib64/hw/android.hardware.boot@1.0-impl.so [deleted file]
recovery/root/vendor/lib64/hw/bootctrl.exynos9610.so [deleted file]
recovery/root/vendor/manifest.xml [deleted file]

diff --git a/Android.bp b/Android.bp
new file mode 100644 (file)
index 0000000..3b7eec2
--- /dev/null
@@ -0,0 +1,6 @@
+soong_namespace {\r
+}\r
+\r
+subdirs = [\r
+    "bootctrl",\r
+]
\ No newline at end of file
diff --git a/bootctrl/Android.bp b/bootctrl/Android.bp
new file mode 100644 (file)
index 0000000..05df943
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright (C) 2020 The LineageOS Project\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+//      http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+\r
+cc_library_shared {\r
+    name: "android.hardware.boot@1.0-impl.exynos",\r
+    defaults: ["hidl_defaults"],\r
+    relative_install_path: "hw",\r
+    vendor: true,\r
+    recovery_available: true,\r
+    srcs: ["BootControl.cpp"],\r
+\r
+    shared_libs: [\r
+        "liblog",\r
+        "libhidlbase",\r
+        "libhidltransport",\r
+        "libhardware",\r
+        "libutils",\r
+        "android.hardware.boot@1.0",\r
+    ],\r
+\r
+}\r
diff --git a/bootctrl/BootControl.cpp b/bootctrl/BootControl.cpp
new file mode 100644 (file)
index 0000000..2f2b8c6
--- /dev/null
@@ -0,0 +1,247 @@
+/*\r
+ * Copyright (C) 2020 The LineageOS Project\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "BootControl.h"\r
+\r
+#include <fstream>\r
+\r
+namespace android {\r
+namespace hardware {\r
+namespace boot {\r
+namespace V1_0 {\r
+namespace implementation {\r
+\r
+bool BootControl::readMetadata(bctl_metadata_t& data) {\r
+    std::fstream in(mBlkDevice, std::ios::binary | std::ios::in);\r
+\r
+    if (in.fail()) {\r
+        return false;\r
+    }\r
+\r
+    in.seekg(BCTL_METADATA_OFFSET);\r
+\r
+    if (in.fail()) {\r
+        return false;\r
+    }\r
+\r
+    in.read(reinterpret_cast<char*>(&data), sizeof(bctl_metadata_t));\r
+\r
+    if (!validateMetadata(data))\r
+        return -1;\r
+\r
+    return !in.eof() && !in.fail();\r
+}\r
+\r
+bool BootControl::writeMetadata(bctl_metadata_t& data) {\r
+    if (!validateMetadata(data))\r
+        return -1;\r
+\r
+    // We use std::ios::in | std::ios::out even though we only write so that\r
+    // we don't truncate or append to the file, but rather overwrite the file\r
+    // in the exact place that we want to write the struct to.\r
+    std::fstream out(mBlkDevice, std::ios::binary | std::ios::in | std::ios::out);\r
+\r
+    if (out.fail()) {\r
+        return false;\r
+    }\r
+\r
+    out.seekp(BCTL_METADATA_OFFSET);\r
+\r
+    if (out.fail()) {\r
+        return false;\r
+    }\r
+\r
+    out.write(reinterpret_cast<const char*>(&data), sizeof(bctl_metadata_t));\r
+\r
+    return !out.eof() && !out.fail();\r
+}\r
+\r
+bool BootControl::validateMetadata(bctl_metadata_t& data) {\r
+    if (data.slot_info[0].magic != BCTL_METADATA_MAGIC || data.slot_info[1].magic != BCTL_METADATA_MAGIC) {\r
+        return false;\r
+    }\r
+    \r
+    return true;\r
+}\r
+\r
+void BootControl::resetMetadata(bctl_metadata_t& data) {\r
+    // reset to defaults\r
+    data.slot_info[0].magic = BCTL_METADATA_MAGIC;\r
+    data.slot_info[0].bootable = 1;\r
+    data.slot_info[0].is_active = 1;\r
+    data.slot_info[0].boot_successful = 0;\r
+    data.slot_info[0].tries_remaining = 7;\r
+\r
+    data.slot_info[1].magic = BCTL_METADATA_MAGIC;\r
+    data.slot_info[1].bootable = 1;\r
+    data.slot_info[1].is_active = 0;\r
+    data.slot_info[1].boot_successful = 0;\r
+    data.slot_info[1].tries_remaining = 7;\r
+}\r
+\r
+// Methods from ::android::hardware::boot::V1_0::IBootControl follow.\r
+Return<uint32_t> BootControl::getNumberSlots() {\r
+    return 2;\r
+}\r
+\r
+Return<uint32_t> BootControl::getCurrentSlot() {\r
+    bctl_metadata_t data;\r
+\r
+    if (readMetadata(data)) {\r
+        // This is a clever hack because if slot b is active,\r
+        // is_active will be 0 and if slot a is active, is_active\r
+        // will be 1. In other words, the "not" value of slot A's\r
+        // is_active var lines up to the current active slot index.\r
+        return !data.slot_info[0].is_active;\r
+    }\r
+\r
+    return 0;\r
+}\r
+\r
+Return<void> BootControl::markBootSuccessful(markBootSuccessful_cb _hidl_cb) {\r
+    bctl_metadata_t data;\r
+    bool success = false;\r
+    int active_slot;\r
+\r
+    if (readMetadata(data)) {\r
+        active_slot = !data.slot_info[0].is_active;\r
+        \r
+        data.slot_info[active_slot].boot_successful = 0;\r
+        data.slot_info[active_slot].tries_remaining = 0;\r
+\r
+        if (success)\r
+            if (writeMetadata(data)) {\r
+                _hidl_cb(CommandResult{true, ""});\r
+            } else {\r
+                _hidl_cb(CommandResult{false, "Failed to write metadata"});\r
+            }\r
+        else {\r
+            _hidl_cb(CommandResult{false, "No active slot"});\r
+        }\r
+    } else {\r
+        _hidl_cb(CommandResult{false, "Failed to read metadata"});\r
+    }\r
+\r
+    return Void();\r
+}\r
+\r
+Return<void> BootControl::setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) {\r
+    bctl_metadata_t data;\r
+    int slot2 = (slot == 0) ? 1 : 0;\r
+\r
+    if (slot < 2) {\r
+        if (readMetadata(data)) {\r
+            data.slot_info[slot].bootable = 1;\r
+            data.slot_info[slot].is_active = 1;\r
+            data.slot_info[slot].boot_successful = 0;\r
+            data.slot_info[slot].tries_remaining = 7;\r
+            \r
+            data.slot_info[slot2].bootable = 1;\r
+            data.slot_info[slot2].is_active = 0;\r
+            data.slot_info[slot2].boot_successful = 0;\r
+            data.slot_info[slot2].tries_remaining = 7;\r
+\r
+            if (writeMetadata(data)) {\r
+                _hidl_cb(CommandResult{true, ""});\r
+            } else {\r
+                _hidl_cb(CommandResult{false, "Failed to write metadata"});\r
+            }\r
+        } else {\r
+            _hidl_cb(CommandResult{false, "Failed to read metadata"});\r
+        }\r
+    } else {\r
+        _hidl_cb(CommandResult{false, "Invalid slot"});\r
+    }\r
+\r
+    return Void();\r
+}\r
+\r
+Return<void> BootControl::setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) {\r
+    bctl_metadata_t data;\r
+\r
+    if (slot < 2) {\r
+        if (readMetadata(data)) {\r
+            data.slot_info[slot].bootable = 0;\r
+\r
+            if (writeMetadata(data)) {\r
+                _hidl_cb(CommandResult{true, ""});\r
+            } else {\r
+                _hidl_cb(CommandResult{false, "Failed to write metadata"});\r
+            }\r
+        } else {\r
+            _hidl_cb(CommandResult{false, "Failed to read metadata"});\r
+        }\r
+    } else {\r
+        _hidl_cb(CommandResult{false, "Invalid slot"});\r
+    }\r
+\r
+    return Void();\r
+}\r
+\r
+Return<BoolResult> BootControl::isSlotBootable(uint32_t slot) {\r
+    bctl_metadata_t data;\r
+    BoolResult ret = BoolResult::FALSE;\r
+\r
+    if (slot < 2) {\r
+        if (readMetadata(data)) {\r
+            ret = static_cast<BoolResult>(data.slot_info[slot].bootable);\r
+        } else {\r
+            ret = BoolResult::FALSE;\r
+        }\r
+    } else {\r
+        ret = BoolResult::INVALID_SLOT;\r
+    }\r
+\r
+    return ret;\r
+}\r
+\r
+Return<BoolResult> BootControl::isSlotMarkedSuccessful(uint32_t slot) {\r
+    bctl_metadata_t data;\r
+    BoolResult ret = BoolResult::FALSE;\r
+\r
+    if (slot < 2) {\r
+        if (readMetadata(data)) {\r
+            ret = static_cast<BoolResult>(data.slot_info[slot].boot_successful);\r
+        } else {\r
+            ret = BoolResult::FALSE;\r
+        }\r
+    } else {\r
+        ret = BoolResult::INVALID_SLOT;\r
+    }\r
+\r
+    return ret;\r
+}\r
+\r
+Return<void> BootControl::getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) {\r
+    if (slot < 2) {\r
+        if (slot == 0) {\r
+            _hidl_cb(SLOT_SUFFIX_A);\r
+        } else {\r
+            _hidl_cb(SLOT_SUFFIX_B);\r
+        }\r
+    } else {\r
+        // default to slot A\r
+        _hidl_cb(SLOT_SUFFIX_A);\r
+    }\r
+\r
+    return Void();\r
+}\r
+\r
+}  // namespace implementation\r
+}  // namespace V1_0\r
+}  // namespace boot\r
+}  // namespace hardware\r
+}  // namespace android\r
diff --git a/bootctrl/BootControl.h b/bootctrl/BootControl.h
new file mode 100644 (file)
index 0000000..f5fd06a
--- /dev/null
@@ -0,0 +1,62 @@
+/*\r
+ * Copyright (C) 2020 The LineageOS Project\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#ifndef ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H\r
+#define ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H\r
+\r
+#include <android/hardware/boot/1.0/IBootControl.h>\r
+\r
+#include "bctl_metadata.h"\r
+\r
+namespace android {\r
+namespace hardware {\r
+namespace boot {\r
+namespace V1_0 {\r
+namespace implementation {\r
+\r
+using ::android::hardware::boot::V1_0::BoolResult;\r
+using ::android::hardware::boot::V1_0::CommandResult;\r
+using ::android::hardware::Return;\r
+using ::android::hardware::Void;\r
+\r
+class BootControl : public IBootControl {\r
+  public:\r
+    // Methods from ::android::hardware::boot::V1_0::IBootControl follow.\r
+    Return<uint32_t> getNumberSlots() override;\r
+    Return<uint32_t> getCurrentSlot() override;\r
+    Return<void> markBootSuccessful(markBootSuccessful_cb _hidl_cb) override;\r
+    Return<void> setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) override;\r
+    Return<void> setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) override;\r
+    Return<BoolResult> isSlotBootable(uint32_t slot) override;\r
+    Return<BoolResult> isSlotMarkedSuccessful(uint32_t slot) override;\r
+    Return<void> getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) override;\r
+\r
+  private:\r
+    std::string mBlkDevice = BCTL_METADATA_PARTITION;\r
+\r
+    bool readMetadata(bctl_metadata_t& data);\r
+    bool writeMetadata(bctl_metadata_t& data);\r
+    bool validateMetadata(bctl_metadata_t& data);\r
+    void resetMetadata(bctl_metadata_t& data);\r
+};\r
+\r
+}  // namespace implementation\r
+}  // namespace V1_0\r
+}  // namespace boot\r
+}  // namespace hardware\r
+}  // namespace android\r
+\r
+#endif  // ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H\r
diff --git a/bootctrl/bctl_metadata.h b/bootctrl/bctl_metadata.h
new file mode 100644 (file)
index 0000000..8145edc
--- /dev/null
@@ -0,0 +1,43 @@
+/*\r
+ * Copyright (C) 2020 The LineageOS Project\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#ifndef SAMSUNG_BCTL_METADATA_H\r
+#define SAMSUNG_BCTL_METADATA_H\r
+\r
+#include <iostream>\r
+\r
+#define BCTL_METADATA_PARTITION "/dev/block/bootdevice/by-name/slotinfo"\r
+#define BCTL_METADATA_OFFSET 0x800\r
+#define BCTL_METADATA_MAGIC 0x43425845\r
+\r
+#define SLOT_SUFFIX_A "_a"\r
+#define SLOT_SUFFIX_B "_b"\r
+\r
+// Our internal data structures\r
+struct slot_metadata_t {\r
+    uint32_t magic;\r
+    uint8_t bootable;\r
+    uint8_t is_active;\r
+    uint8_t boot_successful;\r
+    uint8_t tries_remaining;\r
+    uint8_t reserved[8];\r
+};\r
+\r
+struct bctl_metadata_t {\r
+    slot_metadata_t slot_info[2];\r
+};\r
+\r
+#endif  // SAMSUNG_BCTL_METADATA_H\r
index b2aa6a16770a12590697e88f0049421258a48f2d..00329d6d3fae189fdd98c65e3ef37b80203f6ff8 100644 (file)
--- a/device.mk
+++ b/device.mk
@@ -31,7 +31,7 @@ PRODUCT_STATIC_BOOT_CONTROL_HAL := \
 
 # Boot control HAL
 PRODUCT_PACKAGES += \
-    android.hardware.boot@1.0-impl \
+    android.hardware.boot@1.0-impl.exynos \
     android.hardware.boot@1.0-service \
 
 
diff --git a/recovery/root/sbin/android.hidl.base@1.0.so b/recovery/root/sbin/android.hidl.base@1.0.so
deleted file mode 100644 (file)
index d7a4c3c..0000000
Binary files a/recovery/root/sbin/android.hidl.base@1.0.so and /dev/null differ
diff --git a/recovery/root/vendor/lib64/hw/android.hardware.boot@1.0-impl.so b/recovery/root/vendor/lib64/hw/android.hardware.boot@1.0-impl.so
deleted file mode 100644 (file)
index 2d9df27..0000000
Binary files a/recovery/root/vendor/lib64/hw/android.hardware.boot@1.0-impl.so and /dev/null differ
diff --git a/recovery/root/vendor/lib64/hw/bootctrl.exynos9610.so b/recovery/root/vendor/lib64/hw/bootctrl.exynos9610.so
deleted file mode 100644 (file)
index 0bb6d1c..0000000
Binary files a/recovery/root/vendor/lib64/hw/bootctrl.exynos9610.so and /dev/null differ
diff --git a/recovery/root/vendor/manifest.xml b/recovery/root/vendor/manifest.xml
deleted file mode 100644 (file)
index 9257a38..0000000
+++ /dev/null
@@ -1,379 +0,0 @@
-<manifest version="1.0" type="device" target-level="3">
-    <hal format="hidl">
-       <name>android.hardware.boot</name>
-       <transport>hwbinder</transport>
-       <impl level="generic"></impl>
-       <version>1.0</version>
-       <interface>
-            <name>IBootControl</name>
-            <instance>default</instance>
-       </interface>
-    </hal>
-    <hal format="hidl">
-      <name>vendor.samsung_slsi.hardware.ofi</name>
-      <transport>hwbinder</transport>
-      <version>1.0</version>
-      <interface>
-          <name>IOfiService</name>
-          <instance>default</instance>
-      </interface>
-    </hal>
-    <hal format="hidl">
-          <name>android.hardware.vibrator</name>
-          <transport>hwbinder</transport>
-          <version>1.0</version>
-          <interface>
-                  <name>IVibrator</name>
-                  <instance>default</instance>
-          </interface>
-    </hal>
-    <hal format="hidl">
-       <name>android.hardware.wifi.supplicant</name>
-           <transport>hwbinder</transport>
-               <version>1.1</version>
-               <interface>
-                   <name>ISupplicant</name>
-                   <instance>default</instance>
-               </interface>
-    </hal>
-    <hal format="hidl">
-        <name>vendor.samsung_slsi.hardware.wifi.supplicant</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>ISupplicantVendor</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-       <name>android.hardware.wifi</name>
-       <transport>hwbinder</transport>
-       <impl level="generic"></impl>
-       <version>1.2</version>
-       <interface>
-            <name>IWifi</name>
-            <instance>default</instance>
-       </interface>
-    </hal>
-    <hal format="hidl">
-       <name>android.hardware.wifi.hostapd</name>
-       <transport>hwbinder</transport>
-       <impl level="generic"></impl>
-       <version>1.0</version>
-       <interface>
-            <name>IHostapd</name>
-            <instance>default</instance>
-       </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.audio</name>
-        <transport>hwbinder</transport>
-        <version>4.0</version>
-        <interface>
-            <name>IDevicesFactory</name>
-            <instance>default</instance>
-        </interface>
-   </hal>
-   <hal format="hidl">
-        <name>android.hardware.audio.effect</name>
-        <transport>hwbinder</transport>
-        <version>4.0</version>
-        <interface>
-            <name>IEffectsFactory</name>
-            <instance>default</instance>
-        </interface>
-   </hal>
-   <hal format="hidl">
-        <name>android.hardware.soundtrigger</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>ISoundTriggerHw</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.media.omx</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IOmx</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IOmxStore</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-       <hal format="hidl">
-               <name>android.hardware.graphics.allocator</name>
-               <transport>hwbinder</transport>
-               <version>2.0</version>
-               <interface>
-                       <name>IAllocator</name>
-                       <instance>default</instance>
-               </interface>
-       </hal>
-       <hal format="hidl">
-               <name>android.hardware.graphics.mapper</name>
-               <transport arch="32+64">passthrough</transport>
-               <version>2.0</version>
-               <interface>
-                       <name>IMapper</name>
-                       <instance>default</instance>
-               </interface>
-       </hal>
-       <hal format="hidl">
-               <name>android.hardware.graphics.composer</name>
-               <transport>hwbinder</transport>
-               <version>2.2</version>
-               <interface>
-                       <name>IComposer</name>
-                       <instance>default</instance>
-               </interface>
-       </hal>
-   <hal format="hidl">
-        <name>android.hardware.gatekeeper</name>
-        <transport>hwbinder</transport>
-        <impl level="generic"></impl>
-        <version>1.0</version>
-        <interface>
-            <name>IGatekeeper</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.camera.provider</name>
-        <transport>hwbinder</transport>
-        <impl level="generic"></impl>
-        <version>2.4</version>
-        <interface>
-            <name>ICameraProvider</name>
-            <instance>legacy/0</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>vendor.samsung_slsi.hardware.ExynosHWCServiceTW</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IExynosHWCServiceTW</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.neuralnetworks</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IDevice</name>
-            <instance>armnn</instance>
-        </interface>
-        <fqname>@1.1::IDevice/armnn</fqname>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.memtrack</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IMemtrack</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>vendor.samsung.hardware.gnss</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>ISlsiGnss</name>
-            <instance>default</instance>
-        </interface>
-        <fqname>@1.0::ISlsiGnss/default</fqname>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.gnss</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IGnss</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.keymaster</name>
-        <transport>hwbinder</transport>
-        <impl level="generic"></impl>
-        <version>3.0</version>
-        <interface>
-            <name>IKeymasterDevice</name>
-            <instance>default</instance>
-        </interface>
-     </hal>
-       <hal format="hidl">
-               <name>android.hardware.renderscript</name>
-               <transport arch="32+64">passthrough</transport>
-               <version>1.0</version>
-               <interface>
-                       <name>IDevice</name>
-                       <instance>default</instance>
-               </interface>
-       </hal>
-    <hal format="hidl">
-        <name>android.hardware.drm</name>
-        <transport>hwbinder</transport>
-        <impl level="generic"></impl>
-        <version>1.0</version>
-        <interface>
-            <name>ICryptoFactory</name>
-            <instance>default</instance>
-       </interface>
-        <interface>
-            <name>IDrmFactory</name>
-            <instance>default</instance>
-       </interface>
-       <fqname>@1.1::ICryptoFactory/clearkey</fqname>
-       <fqname>@1.1::IDrmFactory/clearkey</fqname>
-       <fqname>@1.1::ICryptoFactory/widevine</fqname>
-       <fqname>@1.1::IDrmFactory/widevine</fqname>
-     </hal>
-    <hal format="hidl">
-        <name>android.hardware.configstore</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>ISurfaceFlingerConfigs</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>vendor.samsung_slsi.hardware.configstore</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IExynosHWCConfigs</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.bluetooth</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IBluetoothHci</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.power</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IPower</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.thermal</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IThermal</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.usb</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IUsb</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.nfc</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>INfc</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>vendor.sec.hardware.nfc</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>ISecNfc</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.sensors</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>ISensors</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <sepolicy>
-        <version>26.0</version>
-    </sepolicy>
-    <hal format="hidl">
-        <name>android.hardware.radio</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IRadio</name>
-            <instance>slot1</instance>
-            <instance>slot2</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.light</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>ILight</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.health</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>IHealth</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>vendor.trustonic.tee.tui</name>
-       <transport>hwbinder</transport>
-       <version>1.0</version>
-       <interface>
-           <name>ITui</name>
-           <instance>default</instance>
-       </interface>
-    </hal>
-    <hal format="hidl">
-          <name>android.hardware.cas</name>
-          <transport>hwbinder</transport>
-          <version>1.0</version>
-          <interface>
-              <name>IMediaCasService</name>
-              <instance>default</instance>
-          </interface>
-    </hal>
-    <hal format="hidl">
-       <name>vendor.dolby.hardware.dms</name>
-       <transport>hwbinder</transport>
-          <version>1.0</version>
-            <interface>
-                <name>IDms</name>
-                <instance>default</instance>
-            </interface>
-    </hal>
-    <!-- Moto Dolby End -->
-</manifest>
\ No newline at end of file