diff options
| author | Faiz Authar <faizauthar@gmail.com> | 2019-05-03 17:50:33 +0700 |
|---|---|---|
| committer | Faiz Authar <faizauthar@gmail.com> | 2019-05-03 19:10:31 +0700 |
| commit | 89ffc99184f011ceb279e1e334306aee140c4fe3 (patch) | |
| tree | 7f509327af96cb255ca37ad97839cc63e6084f65 | |
| parent | de13e7e68d08f6ec2ea20ba521a0e9b13590b2fa (diff) | |
msm8996-common: remove Touch Hal service
Change-Id: Id610cff7c1217d967e084c4f5fb27485fe461411
| -rw-r--r-- | manifest.xml | 9 | ||||
| -rwxr-xr-x | msm8996.mk | 4 | ||||
| -rw-r--r-- | sepolicy/file_contexts | 1 | ||||
| -rw-r--r-- | sepolicy/hal_lineage_touch_default.te | 2 | ||||
| -rw-r--r-- | sepolicy/system_server.te | 1 | ||||
| -rw-r--r-- | touch/Android.bp | 35 | ||||
| -rw-r--r-- | touch/KeyDisabler.cpp | 64 | ||||
| -rw-r--r-- | touch/KeyDisabler.h | 48 | ||||
| -rw-r--r-- | touch/service.cpp | 63 | ||||
| -rw-r--r-- | touch/vendor.lineage.touch@1.0-service.zuk_8996.rc | 4 |
10 files changed, 1 insertions, 230 deletions
diff --git a/manifest.xml b/manifest.xml index 2c3fe1fe..dff48ffa 100644 --- a/manifest.xml +++ b/manifest.xml @@ -422,15 +422,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </interface> </hal> <hal format="hidl"> - <name>vendor.lineage.touch</name> - <transport>hwbinder</transport> - <version>1.0</version> - <interface> - <name>IKeyDisabler</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl"> <name>vendor.lineage.trust</name> <transport>hwbinder</transport> <version>1.0</version> @@ -357,10 +357,6 @@ PRODUCT_BOOT_JARS += \ PRODUCT_PACKAGES += \ textclassifier.bundle1 -# Touch HAL -PRODUCT_PACKAGES += \ - vendor.lineage.touch@1.0-service.zuk_8996 - # Trust HAL PRODUCT_PACKAGES += \ vendor.lineage.trust@1.0-service diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 429d4c4f..238b74d2 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -13,7 +13,6 @@ # HALs /(vendor|system/vendor)/bin/hw/android\.hardware\.light@2\.0-service\.zuk_8996 u:object_r:hal_light_default_exec:s0 -/(vendor|system/vendor)/bin/hw/vendor\.lineage\.touch@1\.0-service\.zuk_8996 u:object_r:hal_lineage_touch_default_exec:s0 # Misc files on /vendor /(vendor|system/vendor)/usr/idc(/.*)? u:object_r:idc_file:s0 diff --git a/sepolicy/hal_lineage_touch_default.te b/sepolicy/hal_lineage_touch_default.te deleted file mode 100644 index 3e8c270f..00000000 --- a/sepolicy/hal_lineage_touch_default.te +++ /dev/null @@ -1,2 +0,0 @@ -allow hal_lineage_touch_default sysfs_fingerprint:dir search; -allow hal_lineage_touch_default sysfs_fingerprint:file rw_file_perms; diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te index 6d95c6db..ec297431 100644 --- a/sepolicy/system_server.te +++ b/sepolicy/system_server.te @@ -1,4 +1,5 @@ allow system_server vendor_alarm_boot_prop:file r_file_perms; +allow system_server sysfs_fingerprint:file rw_file_perms; allow system_server sysfs_vibrator:file read; # /vendor/usr/keylayout diff --git a/touch/Android.bp b/touch/Android.bp deleted file mode 100644 index 0cb7c43e..00000000 --- a/touch/Android.bp +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2019 The LineageOS 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. - -cc_binary { - name: "vendor.lineage.touch@1.0-service.zuk_8996", - init_rc: ["vendor.lineage.touch@1.0-service.zuk_8996.rc"], - defaults: ["hidl_defaults"], - relative_install_path: "hw", - vendor: true, - srcs: [ - "KeyDisabler.cpp", - "service.cpp" - ], - shared_libs: [ - "libbase", - "libhidlbase", - "libhidltransport", - "libutils", - "vendor.lineage.touch@1.0", - ], - header_libs: [ - "libbinder_headers", - ], -} diff --git a/touch/KeyDisabler.cpp b/touch/KeyDisabler.cpp deleted file mode 100644 index c5acdef4..00000000 --- a/touch/KeyDisabler.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2019 The LineageOS 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 <android-base/file.h> -#include <android-base/logging.h> -#include <android-base/strings.h> - -#include "KeyDisabler.h" - -namespace vendor { -namespace lineage { -namespace touch { -namespace V1_0 { -namespace implementation { - -constexpr const char kControlPath[] = "/sys/devices/soc/soc:fpc1020/utouch_disable"; - -KeyDisabler::KeyDisabler() { - mHasKeyDisabler = !access(kControlPath, F_OK); -} - -// Methods from ::vendor::lineage::touch::V1_0::IKeyDisabler follow. -Return<bool> KeyDisabler::isEnabled() { - std::string buf; - - if (!mHasKeyDisabler) return false; - - if (!android::base::ReadFileToString(kControlPath, &buf, true)) { - LOG(ERROR) << "Failed to read " << kControlPath; - return false; - } - - return std::stoi(android::base::Trim(buf)) == 1; -} - -Return<bool> KeyDisabler::setEnabled(bool enabled) { - if (!mHasKeyDisabler) return false; - - if (!android::base::WriteStringToFile((enabled ? "1" : "0"), kControlPath, true)) { - LOG(ERROR) << "Failed to write " << kControlPath; - return false; - } - - return true; -} - -} // namespace implementation -} // namespace V1_0 -} // namespace touch -} // namespace lineage -} // namespace vendor diff --git a/touch/KeyDisabler.h b/touch/KeyDisabler.h deleted file mode 100644 index f7a18fa4..00000000 --- a/touch/KeyDisabler.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2019 The LineageOS 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. - */ - -#ifndef VENDOR_LINEAGE_TOUCH_V1_0_KEYDISABLER_H -#define VENDOR_LINEAGE_TOUCH_V1_0_KEYDISABLER_H - -#include <vendor/lineage/touch/1.0/IKeyDisabler.h> - -namespace vendor { -namespace lineage { -namespace touch { -namespace V1_0 { -namespace implementation { - -using ::android::hardware::Return; - -class KeyDisabler : public IKeyDisabler { - public: - KeyDisabler(); - - // Methods from ::vendor::lineage::touch::V1_0::IKeyDisabler follow. - Return<bool> isEnabled() override; - Return<bool> setEnabled(bool enabled) override; - - private: - bool mHasKeyDisabler; -}; - -} // namespace implementation -} // namespace V1_0 -} // namespace touch -} // namespace lineage -} // namespace vendor - -#endif // VENDOR_LINEAGE_TOUCH_V1_0_KEYDISABLER_H diff --git a/touch/service.cpp b/touch/service.cpp deleted file mode 100644 index 0fc2268e..00000000 --- a/touch/service.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2019 The LineageOS 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. - */ - -#define LOG_TAG "vendor.lineage.touch@1.0-service.zuk_8996" - -#include <android-base/logging.h> -#include <binder/ProcessState.h> -#include <hidl/HidlTransportSupport.h> - -#include "KeyDisabler.h" - -using android::OK; -using android::sp; -using android::status_t; -using android::hardware::configureRpcThreadpool; -using android::hardware::joinRpcThreadpool; - -using ::vendor::lineage::touch::V1_0::IKeyDisabler; -using ::vendor::lineage::touch::V1_0::implementation::KeyDisabler; - -int main() { - sp<KeyDisabler> keyDisabler; - status_t status; - - LOG(INFO) << "Touch HAL service is starting."; - - keyDisabler = new KeyDisabler(); - if (keyDisabler == nullptr) { - LOG(ERROR) << "Can not create an instance of Touch HAL KeyDisabler Iface, exiting."; - goto shutdown; - } - - configureRpcThreadpool(1, true /*callerWillJoin*/); - - status = keyDisabler->registerAsService(); - if (status != OK) { - LOG(ERROR) << "Could not register service for Touch HAL KeyDisabler Iface (" - << status << ")"; - goto shutdown; - } - - LOG(INFO) << "Touch HAL service is ready."; - joinRpcThreadpool(); - // Should not pass this line - -shutdown: - // In normal operation, we don't expect the thread pool to shutdown - LOG(ERROR) << "Touch HAL service is shutting down."; - return 1; -} diff --git a/touch/vendor.lineage.touch@1.0-service.zuk_8996.rc b/touch/vendor.lineage.touch@1.0-service.zuk_8996.rc deleted file mode 100644 index f3eaa8dc..00000000 --- a/touch/vendor.lineage.touch@1.0-service.zuk_8996.rc +++ /dev/null @@ -1,4 +0,0 @@ -service vendor.touch-hal-1-0-zuk_8996 /vendor/bin/hw/vendor.lineage.touch@1.0-service.zuk_8996 - class hal - user system - group system |
