Merge "Remove weaver/oemlock/authsecret HIDL services"
diff --git a/battery_mitigation/battery_mitigation.rc b/battery_mitigation/battery_mitigation.rc
index c0c76fb..fcc9a4f 100644
--- a/battery_mitigation/battery_mitigation.rc
+++ b/battery_mitigation/battery_mitigation.rc
@@ -3,88 +3,88 @@
chown system system /data/vendor/mitigation
start vendor.battery_mitigation
-on property:ro.boot.bootreason=reboot,uvlo,pmic,if
+on property:ro.boot.bootreason=reboot,uvlo,pmic,if && property:sys.boot.reason=reboot,uvlo,pmic,if
setprop vendor.brownout_reason "uvlo,pmic,if"
-on property:ro.boot.bootreason=reboot,ocp,pmic,if
+on property:ro.boot.bootreason=reboot,ocp,pmic,if && property:sys.boot.reason=reboot,ocp,pmic,if
setprop vendor.brownout_reason "ocp,pmic,if"
-on property:ro.boot.bootreason=reboot,uvlo,pmic,main
+on property:ro.boot.bootreason=reboot,uvlo,pmic,main && property:sys.boot.reason=reboot,uvlo,pmic,main
setprop vendor.brownout_reason "uvlo,pmic,main"
-on property:ro.boot.bootreason=reboot,uvlo,pmic,sub
+on property:ro.boot.bootreason=reboot,uvlo,pmic,sub && property:sys.boot.reason=reboot,uvlo,pmic,sub
setprop vendor.brownout_reason "uvlo,pmic,sub"
-on property:ro.boot.bootreason=reboot,ocp,buck1m
+on property:ro.boot.bootreason=reboot,ocp,buck1m && property:sys.boot.reason=reboot,ocp,buck1m
setprop vendor.brownout_reason "ocp,buck1m"
-on property:ro.boot.bootreason=reboot,ocp,buck2m
+on property:ro.boot.bootreason=reboot,ocp,buck2m && property:sys.boot.reason=reboot,ocp,buck2m
setprop vendor.brownout_reason "ocp,buck2m"
-on property:ro.boot.bootreason=reboot,ocp,buck3m
+on property:ro.boot.bootreason=reboot,ocp,buck3m && property:sys.boot.reason=reboot,ocp,buck3m
setprop vendor.brownout_reason "ocp,buck3m"
-on property:ro.boot.bootreason=reboot,ocp,buck4m
+on property:ro.boot.bootreason=reboot,ocp,buck4m && property:sys.boot.reason=reboot,ocp,buck4m
setprop vendor.brownout_reason "ocp,buck4m"
-on property:ro.boot.bootreason=reboot,ocp,buck5m
+on property:ro.boot.bootreason=reboot,ocp,buck5m && property:sys.boot.reason=reboot,ocp,buck5m
setprop vendor.brownout_reason "ocp,buck5m"
-on property:ro.boot.bootreason=reboot,ocp,buck6m
+on property:ro.boot.bootreason=reboot,ocp,buck6m && property:sys.boot.reason=reboot,ocp,buck6m
setprop vendor.brownout_reason "ocp,buck6m"
-on property:ro.boot.bootreason=reboot,ocp,buck7m
+on property:ro.boot.bootreason=reboot,ocp,buck7m && property:sys.boot.reason=reboot,ocp,buck7m
setprop vendor.brownout_reason "ocp,buck7m"
-on property:ro.boot.bootreason=reboot,ocp,buck8m
+on property:ro.boot.bootreason=reboot,ocp,buck8m && property:sys.boot.reason=reboot,ocp,buck8m
setprop vendor.brownout_reason "ocp,buck8m"
-on property:ro.boot.bootreason=reboot,ocp,buck9m
+on property:ro.boot.bootreason=reboot,ocp,buck9m && property:sys.boot.reason=reboot,ocp,buck9m
setprop vendor.brownout_reason "ocp,buck9m"
-on property:ro.boot.bootreason=reboot,ocp,buck10m
+on property:ro.boot.bootreason=reboot,ocp,buck10m && property:sys.boot.reason=reboot,ocp,buck10m
setprop vendor.brownout_reason "ocp,buck10m"
-on property:ro.boot.bootreason=reboot,ocp,buck1s
+on property:ro.boot.bootreason=reboot,ocp,buck1s && property:sys.boot.reason=reboot,ocp,buck1s
setprop vendor.brownout_reason "ocp,buck1s"
-on property:ro.boot.bootreason=reboot,ocp,buck2s
+on property:ro.boot.bootreason=reboot,ocp,buck2s && property:sys.boot.reason=reboot,ocp,buck2s
setprop vendor.brownout_reason "ocp,buck2s"
-on property:ro.boot.bootreason=reboot,ocp,buck3s
+on property:ro.boot.bootreason=reboot,ocp,buck3s && property:sys.boot.reason=reboot,ocp,buck3s
setprop vendor.brownout_reason "ocp,buck3s"
-on property:ro.boot.bootreason=reboot,ocp,buck4s
+on property:ro.boot.bootreason=reboot,ocp,buck4s && property:sys.boot.reason=reboot,ocp,buck4s
setprop vendor.brownout_reason "ocp,buck4s"
-on property:ro.boot.bootreason=reboot,ocp,buck5s
+on property:ro.boot.bootreason=reboot,ocp,buck5s && property:sys.boot.reason=reboot,ocp,buck5s
setprop vendor.brownout_reason "ocp,buck5s"
-on property:ro.boot.bootreason=reboot,ocp,buck6s
+on property:ro.boot.bootreason=reboot,ocp,buck6s && property:sys.boot.reason=reboot,ocp,buck6s
setprop vendor.brownout_reason "ocp,buck6s"
-on property:ro.boot.bootreason=reboot,ocp,buck7s
+on property:ro.boot.bootreason=reboot,ocp,buck7s && property:sys.boot.reason=reboot,ocp,buck7s
setprop vendor.brownout_reason "ocp,buck7s"
-on property:ro.boot.bootreason=reboot,ocp,buck8s
+on property:ro.boot.bootreason=reboot,ocp,buck8s && property:sys.boot.reason=reboot,ocp,buck8s
setprop vendor.brownout_reason "ocp,buck8s"
-on property:ro.boot.bootreason=reboot,ocp,buck9s
+on property:ro.boot.bootreason=reboot,ocp,buck9s && property:sys.boot.reason=reboot,ocp,buck9s
setprop vendor.brownout_reason "ocp,buck9s"
-on property:ro.boot.bootreason=reboot,ocp,buck10s
+on property:ro.boot.bootreason=reboot,ocp,buck10s && property:sys.boot.reason=reboot,ocp,buck10s
setprop vendor.brownout_reason "ocp,buck10s"
-on property:ro.boot.bootreason=reboot,ocp,buckds
+on property:ro.boot.bootreason=reboot,ocp,buckds && property:sys.boot.reason=reboot,ocp,buckds
setprop vendor.brownout_reason "ocp,buckds"
-on property:ro.boot.bootreason=reboot,ocp,buckas
+on property:ro.boot.bootreason=reboot,ocp,buckas && property:sys.boot.reason=reboot,ocp,buckas
setprop vendor.brownout_reason "ocp,buckas"
-on property:ro.boot.bootreason=reboot,ocp,buckcs
+on property:ro.boot.bootreason=reboot,ocp,buckcs && property:sys.boot.reason=reboot,ocp,buckcs
setprop vendor.brownout_reason "ocp,buckcs"
-on property:ro.boot.bootreason=reboot,ocp,buckbs
+on property:ro.boot.bootreason=reboot,ocp,buckbs && property:sys.boot.reason=reboot,ocp,buckbs
setprop vendor.brownout_reason "ocp,buckbs"
service vendor.battery_mitigation /vendor/bin/hw/battery_mitigation
diff --git a/battery_mitigation/sepolicy/battery_mitigation.te b/battery_mitigation/sepolicy/battery_mitigation.te
index bcc2a0e..ff34c43 100644
--- a/battery_mitigation/sepolicy/battery_mitigation.te
+++ b/battery_mitigation/sepolicy/battery_mitigation.te
@@ -3,6 +3,7 @@
init_daemon_domain(battery_mitigation)
get_prop(battery_mitigation, boot_status_prop)
get_prop(battery_mitigation, vendor_brownout_reason_prop)
+get_prop(battery_mitigation, system_boot_reason_prop)
set_prop(battery_mitigation, vendor_mitigation_ready_prop)
hal_client_domain(battery_mitigation, hal_thermal);
diff --git a/battery_mitigation/sepolicy/vendor_init.te b/battery_mitigation/sepolicy/vendor_init.te
index b1bc894..275f377 100644
--- a/battery_mitigation/sepolicy/vendor_init.te
+++ b/battery_mitigation/sepolicy/vendor_init.te
@@ -1,2 +1,3 @@
# Battery Mitigation
set_prop(vendor_init, vendor_brownout_reason_prop)
+get_prop(vendor_init, system_boot_reason_prop)
diff --git a/powerstats/CpupmStateResidencyDataProvider.cpp b/powerstats/CpupmStateResidencyDataProvider.cpp
new file mode 100644
index 0000000..bb0e61f
--- /dev/null
+++ b/powerstats/CpupmStateResidencyDataProvider.cpp
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "CpupmStateResidencyDataProvider.h"
+
+#include <android-base/logging.h>
+#include <android-base/parseint.h>
+#include <android-base/strings.h>
+
+#include <string>
+#include <utility>
+
+using android::base::ParseUint;
+using android::base::Split;
+using android::base::StartsWith;
+using android::base::Trim;
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace power {
+namespace stats {
+
+CpupmStateResidencyDataProvider::CpupmStateResidencyDataProvider(
+ const std::string &path, const Config &config)
+ : mPath(std::move(path)), mConfig(std::move(config)) {}
+
+int32_t CpupmStateResidencyDataProvider::matchState(char const *line) {
+ for (int32_t i = 0; i < mConfig.states.size(); i++) {
+ if (mConfig.states[i].second == Trim(std::string(line))) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+int32_t CpupmStateResidencyDataProvider::matchEntity(char const *line) {
+ for (int32_t i = 0; i < mConfig.entities.size(); i++) {
+ if (StartsWith(Trim(std::string(line)), mConfig.entities[i].second)) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+bool CpupmStateResidencyDataProvider::parseState(
+ char const *line, uint64_t *duration, uint64_t *count) {
+ std::vector<std::string> parts = Split(line, " ");
+ if (parts.size() != 5) {
+ return false;
+ }
+ if (!ParseUint(Trim(parts[1]), count)) {
+ return false;
+ }
+ if (!ParseUint(Trim(parts[3]), duration)) {
+ return false;
+ }
+ return true;
+}
+
+bool CpupmStateResidencyDataProvider::getStateResidencies(
+ std::unordered_map<std::string, std::vector<StateResidency>> *residencies) {
+ std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(mPath.c_str(), "r"), fclose);
+ if (!fp) {
+ PLOG(ERROR) << __func__ << ":Failed to open file " << mPath;
+ return false;
+ }
+
+ for (int32_t i = 0; i < mConfig.entities.size(); i++) {
+ std::vector<StateResidency> stateResidencies(mConfig.states.size());
+ for (int32_t j = 0; j < stateResidencies.size(); j++) {
+ stateResidencies[j].id = j;
+ }
+ residencies->emplace(mConfig.entities[i].first, stateResidencies);
+ }
+
+ size_t len = 0;
+ char *line = nullptr;
+
+ int32_t temp, entityIndex, stateId = -1;
+ uint64_t duration, count;
+ auto it = residencies->end();
+
+ while (getline(&line, &len, fp.get()) != -1) {
+ temp = matchState(line);
+ // Assign new id only when a new valid state is encountered.
+ if (temp >= 0) {
+ stateId = temp;
+ }
+
+ if (stateId >= 0) {
+ entityIndex = matchEntity(line);
+ it = residencies->find(mConfig.entities[entityIndex].first);
+
+ if (it != residencies->end()) {
+ if (parseState(line, &duration, &count)) {
+ it->second[stateId].totalTimeInStateMs = duration / US_TO_MS;
+ it->second[stateId].totalStateEntryCount = count;
+ } else {
+ LOG(ERROR) << "Failed to parse duration and count from [" << std::string(line)
+ << "]";
+ return false;
+ }
+ }
+ }
+ }
+
+ free(line);
+
+ return true;
+}
+
+std::unordered_map<std::string, std::vector<State>> CpupmStateResidencyDataProvider::getInfo() {
+ std::unordered_map<std::string, std::vector<State>> info;
+ for (auto const &entity : mConfig.entities) {
+ std::vector<State> stateInfo(mConfig.states.size());
+ int32_t stateId = 0;
+ for (auto const &state : mConfig.states) {
+ stateInfo[stateId] = State{
+ .id = stateId,
+ .name = state.first
+ };
+ stateId++;
+ }
+ info.emplace(entity.first, stateInfo);
+ }
+ return info;
+}
+
+} // namespace stats
+} // namespace power
+} // namespace hardware
+} // namespace android
+} // namespace aidl
diff --git a/powerstats/OWNERS b/powerstats/OWNERS
new file mode 100644
index 0000000..e0d66d7
--- /dev/null
+++ b/powerstats/OWNERS
@@ -0,0 +1,4 @@
+darrenhsu@google.com
+joaodias@google.com
+krossmo@google.com
+vincentwang@google.com
diff --git a/powerstats/include/CpupmStateResidencyDataProvider.h b/powerstats/include/CpupmStateResidencyDataProvider.h
new file mode 100644
index 0000000..c04e11e
--- /dev/null
+++ b/powerstats/include/CpupmStateResidencyDataProvider.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <PowerStatsAidl.h>
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace power {
+namespace stats {
+
+class CpupmStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
+ public:
+ class Config {
+ public:
+ // List of power entity name pairs (name to display, name to parse)
+ std::vector<std::pair<std::string, std::string>> entities;
+
+ // List of state pairs (state to display, state to parse).
+ std::vector<std::pair<std::string, std::string>> states;
+ };
+
+ /*
+ * path - path to cpupm sysfs node.
+ */
+ CpupmStateResidencyDataProvider(const std::string &path, const Config &config);
+ ~CpupmStateResidencyDataProvider() = default;
+
+ /*
+ * See IStateResidencyDataProvider::getStateResidencies
+ */
+ bool getStateResidencies(
+ std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
+
+ /*
+ * See IStateResidencyDataProvider::getInfo
+ */
+ std::unordered_map<std::string, std::vector<State>> getInfo() override;
+
+ private:
+ int32_t matchEntity(char const *line);
+ int32_t matchState(char const *line);
+ bool parseState(char const *line, uint64_t *duration, uint64_t *count);
+
+ // A constant to represent the number of microseconds in one millisecond.
+ const uint64_t US_TO_MS = 1000;
+
+ const std::string mPath;
+ const Config mConfig;
+};
+
+} // namespace stats
+} // namespace power
+} // namespace hardware
+} // namespace android
+} // namespace aidl
diff --git a/touch/gti/Android.bp b/touch/gti/Android.bp
index b997aec..d21314a 100644
--- a/touch/gti/Android.bp
+++ b/touch/gti/Android.bp
@@ -5,6 +5,7 @@
sh_binary {
name: "dump_gti.sh",
src: "dump_gti.sh",
+ init_rc: ["init.touch.gti.rc"],
vendor: true,
sub_dir: "dump",
}
diff --git a/touch/gti/dump_gti.sh b/touch/gti/dump_gti.sh
index 573962d..a7d3a61 100644
--- a/touch/gti/dump_gti.sh
+++ b/touch/gti/dump_gti.sh
@@ -1,5 +1,12 @@
#!/vendor/bin/sh
path="/sys/devices/virtual/goog_touch_interface/gti.0"
+procfs_path="/proc/goog_touch_interface/gti.0"
+
+if [[ -d "$procfs_path" ]]; then
+heatmap_path=$procfs_path
+else
+heatmap_path=$path
+fi
echo "------ Force Touch Active ------"
echo 1 > $path/force_active
@@ -8,22 +15,22 @@
cat $path/fw_ver
echo "------ Get Mutual Sensing Data - Baseline ------"
-cat $path/ms_base
+cat $heatmap_path/ms_base
echo "------ Get Mutual Sensing Data - Delta ------"
-cat $path/ms_diff
+cat $heatmap_path/ms_diff
echo "------ Get Mutual Sensing Data - Raw ------"
-cat $path/ms_raw
+cat $heatmap_path/ms_raw
echo "------ Get Self Sensing Data - Baseline ------"
-cat $path/ss_base
+cat $heatmap_path/ss_base
echo "------ Get Self Sensing Data - Delta ------"
-cat $path/ss_diff
+cat $heatmap_path/ss_diff
echo "------ Get Self Sensing Data - Raw ------"
-cat $path/ss_raw
+cat $heatmap_path/ss_raw
echo "------ Self Test ------"
cat $path/self_test
diff --git a/touch/gti/init.touch.gti.rc b/touch/gti/init.touch.gti.rc
new file mode 100644
index 0000000..d714a97
--- /dev/null
+++ b/touch/gti/init.touch.gti.rc
@@ -0,0 +1,9 @@
+on property:vendor.device.modules.ready=1
+ chown system system /proc/goog_touch_interface
+ chown system system /proc/goog_touch_interface/gti.0
+ chown system system /proc/goog_touch_interface/gti.0/ms_base
+ chown system system /proc/goog_touch_interface/gti.0/ms_diff
+ chown system system /proc/goog_touch_interface/gti.0/ms_raw
+ chown system system /proc/goog_touch_interface/gti.0/ss_base
+ chown system system /proc/goog_touch_interface/gti.0/ss_diff
+ chown system system /proc/goog_touch_interface/gti.0/ss_raw
diff --git a/touch/gti/sepolicy/dump_gti.te b/touch/gti/sepolicy/dump_gti.te
index 7482246..060fc29 100644
--- a/touch/gti/sepolicy/dump_gti.te
+++ b/touch/gti/sepolicy/dump_gti.te
@@ -1,5 +1,7 @@
pixel_bugreport(dump_gti)
+allow dump_gti proc_touch_gti:dir r_dir_perms;
+allow dump_gti proc_touch_gti:file rw_file_perms;
allow dump_gti sysfs_touch_gti:dir r_dir_perms;
allow dump_gti sysfs_touch_gti:file rw_file_perms;
allow dump_gti vendor_toolbox_exec:file execute_no_trans;
diff --git a/touch/gti/sepolicy/file.te b/touch/gti/sepolicy/file.te
index 9776707..c3900f0 100644
--- a/touch/gti/sepolicy/file.te
+++ b/touch/gti/sepolicy/file.te
@@ -1,2 +1,3 @@
+type proc_touch_gti, proc_type, fs_type;
type sysfs_touch_gti, sysfs_type, fs_type;
diff --git a/touch/gti/sepolicy/genfs_contexts b/touch/gti/sepolicy/genfs_contexts
index a64e39b..45d3b53 100644
--- a/touch/gti/sepolicy/genfs_contexts
+++ b/touch/gti/sepolicy/genfs_contexts
@@ -1,2 +1,4 @@
# Touch
genfscon sysfs /devices/virtual/goog_touch_interface u:object_r:sysfs_touch_gti:s0
+genfscon proc /goog_touch_interface u:object_r:proc_touch_gti:s0
+
diff --git a/touch/nvt/nvt.mk b/touch/nvt/nvt.mk
new file mode 100644
index 0000000..9655a75
--- /dev/null
+++ b/touch/nvt/nvt.mk
@@ -0,0 +1 @@
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/nvt/sepolicy
diff --git a/touch/nvt/sepolicy/file.te b/touch/nvt/sepolicy/file.te
new file mode 100644
index 0000000..e310df7
--- /dev/null
+++ b/touch/nvt/sepolicy/file.te
@@ -0,0 +1 @@
+type sysfs_touch, sysfs_type, fs_type;
diff --git a/touch/nvt/sepolicy/system_server.te b/touch/nvt/sepolicy/system_server.te
new file mode 100644
index 0000000..d65d811
--- /dev/null
+++ b/touch/nvt/sepolicy/system_server.te
@@ -0,0 +1,2 @@
+allow system_server sysfs_touch:dir r_dir_perms;
+allow system_server sysfs_touch:file r_file_perms;
diff --git a/wireless_charger/compatibility_matrix.xml b/wireless_charger/compatibility_matrix.xml
new file mode 100644
index 0000000..d0adcde
--- /dev/null
+++ b/wireless_charger/compatibility_matrix.xml
@@ -0,0 +1,10 @@
+<compatibility-matrix version="1.0" type="framework" level="7">
+ <hal format="aidl" optional="true">
+ <name>vendor.google.wireless_charger</name>
+ <version>1</version>
+ <interface>
+ <name>IWirelessCharger</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</compatibility-matrix>
diff --git a/wireless_charger/sepolicy/file.te b/wireless_charger/sepolicy/file.te
new file mode 100644
index 0000000..71c118c
--- /dev/null
+++ b/wireless_charger/sepolicy/file.te
@@ -0,0 +1 @@
+type sysfs_wlc, sysfs_type, fs_type;
diff --git a/wireless_charger/sepolicy/file_contexts b/wireless_charger/sepolicy/file_contexts
new file mode 100644
index 0000000..004c7a1
--- /dev/null
+++ b/wireless_charger/sepolicy/file_contexts
@@ -0,0 +1 @@
+/vendor/bin/hw/vendor\.google\.wireless_charger-default u:object_r:hal_wireless_charger_exec:s0
diff --git a/wireless_charger/sepolicy/hal_wireless_charger.te b/wireless_charger/sepolicy/hal_wireless_charger.te
new file mode 100644
index 0000000..f4cdee5
--- /dev/null
+++ b/wireless_charger/sepolicy/hal_wireless_charger.te
@@ -0,0 +1,22 @@
+type hal_wireless_charger, domain;
+type hal_wireless_charger_exec, exec_type, vendor_file_type, file_type;
+
+init_daemon_domain(hal_wireless_charger)
+
+r_dir_file(hal_wireless_charger, sysfs_batteryinfo)
+r_dir_file(hal_wireless_charger, sysfs_wlc)
+
+allow hal_wireless_charger sysfs_batteryinfo:file rw_file_perms;
+allow hal_wireless_charger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
+allow hal_wireless_charger sysfs_wlc:file rw_file_perms;
+
+
+binder_call(hal_wireless_charger, servicemanager)
+add_service(hal_wireless_charger, hal_wireless_charger_service)
+
+userdebug_or_eng(`
+ domain_auto_trans(shell, hal_wireless_charger_exec, hal_wireless_charger)
+')
+
+binder_call(hal_wireless_charger, platform_app)
+binder_call(hal_wireless_charger, system_app)
diff --git a/wireless_charger/sepolicy/service.te b/wireless_charger/sepolicy/service.te
new file mode 100644
index 0000000..2795b0d
--- /dev/null
+++ b/wireless_charger/sepolicy/service.te
@@ -0,0 +1 @@
+type hal_wireless_charger_service, hal_service_type, protected_service, service_manager_type;
diff --git a/wireless_charger/sepolicy/service_contexts b/wireless_charger/sepolicy/service_contexts
new file mode 100644
index 0000000..5813e35
--- /dev/null
+++ b/wireless_charger/sepolicy/service_contexts
@@ -0,0 +1 @@
+vendor.google.wireless_charger.IWirelessCharger/default u:object_r:hal_wireless_charger_service:s0
diff --git a/wireless_charger/wireless_charger.mk b/wireless_charger/wireless_charger.mk
new file mode 100644
index 0000000..8ff9a7b
--- /dev/null
+++ b/wireless_charger/wireless_charger.mk
@@ -0,0 +1,6 @@
+
+PRODUCT_SOONG_NAMESPACES += vendor/google/interfaces
+PRODUCT_PACKAGES += vendor.google.wireless_charger-default
+DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/wireless_charger/compatibility_matrix.xml
+
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/wireless_charger/sepolicy