From a5d59ee4fe6acf3cdc914dd89000d0cd2e9f2164 Mon Sep 17 00:00:00 2001 From: David Sehr Date: Tue, 20 Oct 2020 18:58:16 +0200 Subject: [PATCH] universal7885: Use dex2oat64 Enable dex2oat64 use Additionally, cleanup Bug: 153380900 Test: boot and install an application Change-Id: I3e7a6e6e9385ff6564d1a2e6dda004ebb061f095 (cherry picked from commit 126f03be80f57a8a0411842011152d9381589b78) Merged-In: I3e7a6e6e9385ff6564d1a2e6dda004ebb061f095 Signed-off-by: orgesified Signed-off-by: roynatech2544 Signed-off-by: Kevios12 --- .../configs/props/vendor.prop | 2 + universal7885-common/inputmonitor/Android.bp | 13 -- .../inputmonitor/inputmonitor.cpp | 132 ------------------ .../inputmonitor/inputmonitor.rc | 5 - .../sepolicy/vendor/property.te | 1 - universal7885-common/vendor_name | 1 + 6 files changed, 3 insertions(+), 151 deletions(-) delete mode 100644 universal7885-common/inputmonitor/Android.bp delete mode 100755 universal7885-common/inputmonitor/inputmonitor.cpp delete mode 100644 universal7885-common/inputmonitor/inputmonitor.rc create mode 100644 universal7885-common/vendor_name diff --git a/universal7885-common/configs/props/vendor.prop b/universal7885-common/configs/props/vendor.prop index 5bb9a2a..0d50fdb 100644 --- a/universal7885-common/configs/props/vendor.prop +++ b/universal7885-common/configs/props/vendor.prop @@ -1,3 +1,5 @@ +# Use 64-bit dex2oat for better dexopt time. +dalvik.vm.dex2oat64.enabled=true ## FRP # Disable invocation of oem_lock ro.frp.pst=/dev/block/persistent diff --git a/universal7885-common/inputmonitor/Android.bp b/universal7885-common/inputmonitor/Android.bp deleted file mode 100644 index b455ea9..0000000 --- a/universal7885-common/inputmonitor/Android.bp +++ /dev/null @@ -1,13 +0,0 @@ -cc_binary { - name: "inputmonitor", - srcs: ["inputmonitor.cpp"], - shared_libs: [ - "libutils", - "liblog", - ], - cflags: [ - "-Wall", - "-Werror", - ], - init_rc: ["inputmonitor.rc"], -} diff --git a/universal7885-common/inputmonitor/inputmonitor.cpp b/universal7885-common/inputmonitor/inputmonitor.cpp deleted file mode 100755 index 160925d..0000000 --- a/universal7885-common/inputmonitor/inputmonitor.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2021 Soo-Hean Na "Royna" - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define LOG_TAG "InputMonitor" -#include -#include - -static const char *const evval[3] = { - "RELEASED", - "PRESSED ", - "REPEATED" -}; - -using std::vector; -using std::string; -using namespace std::this_thread; // sleep_for, sleep_until -using namespace std::chrono; // nanoseconds, system_clock, seconds - -vector globVector(const string& pattern){ - glob_t glob_result; - glob(pattern.c_str(), GLOB_TILDE, NULL, &glob_result); - vector files; - for(unsigned int i = 0;i < glob_result.gl_pathc; ++i){ - files.push_back(string(glob_result.gl_pathv[i])); - } - globfree(&glob_result); - return files; -} -int detect_totalevents(){ - vector inputs = globVector("/sys/devices/virtual/input/"); - int count = 0; - for (int i = 0; i < inputs.size(); i++){ - if (inputs[i].rfind("input", 0) == 0) { - count++; - } - } - return count; -} - -char get_eventname(const char& sysfs_input){ - int fd; - char name; - ssize_t n; - fd = open(&sysfs_input, O_RDONLY); - if (fd == -1) { - ALOGE("Cannot open %c: errno %s.", sysfs_input, strerror(errno)); - return EXIT_FAILURE; - } - n = read(fd, &name, sizeof name); - if (n == (ssize_t) -1) { - ALOGE("Cannot read from %c.", sysfs_input); - } - return name; -} - -void monitor_input(const char& dev_node, const char& sysfs_input) -{ - struct input_event ev; - ssize_t n; - int fd; - bool fail; - fd = open(&dev_node, O_RDONLY); - if (fd == -1) { - ALOGE("Cannot open %c: errno %s.", dev_node, strerror(errno)); - } - fail = false; - while (fd != -1) { - n = read(fd, &ev, sizeof ev); - if (n == (ssize_t)-1) { - if (errno == EINTR) - continue; - else - fail = true; - break; - } else if (n != sizeof ev) { - errno = EIO; - break; - } - if (ev.type == EV_KEY && ev.value >= 0 && ev.value <= 2){ - ALOGI("%c (dev: %c) got keyevent %s (Keycode %d)", get_eventname(sysfs_input), dev_node, evval[ev.value], (int) ev.code); - } - sleep_until(system_clock::now() + milliseconds(100)); - - } - if (fail){ - ALOGE("Monitoring %c failed, errno = %s", dev_node, strerror(errno)); - } -} -int main(){ - int totalevents = detect_totalevents(); - vector eventlist = globVector("/sys/devices/virtual/input/"); - std::vector::iterator position = std::find(eventlist.begin(), eventlist.end(), "mice"); - if (position != eventlist.end()) // == eventlist.end() means the element was not found - eventlist.erase(position); - vector threads; - for (int k = 0; k < totalevents; k++){ - string number = eventlist[k].substr(5, 6); - auto dev_node = "/dev/input/event" + number; - auto sysfs_node = "/sys/devices/virtual/input/input" + number + "/name"; - threads.push_back(std::thread(monitor_input, *dev_node.c_str(), *sysfs_node.c_str())); - } - for (int k = 0; k < totalevents; k++){ - threads[k].join(); - } -} - - diff --git a/universal7885-common/inputmonitor/inputmonitor.rc b/universal7885-common/inputmonitor/inputmonitor.rc deleted file mode 100644 index 3a97483..0000000 --- a/universal7885-common/inputmonitor/inputmonitor.rc +++ /dev/null @@ -1,5 +0,0 @@ -service inputmonitor /system/bin/inputmonitor - class main - user root - group system - diff --git a/universal7885-common/sepolicy/vendor/property.te b/universal7885-common/sepolicy/vendor/property.te index d00755c..a8e2bca 100644 --- a/universal7885-common/sepolicy/vendor/property.te +++ b/universal7885-common/sepolicy/vendor/property.te @@ -1,6 +1,5 @@ vendor_internal_prop(modemloader_prop) vendor_internal_prop(camera_prop) -vendor_internal_prop(modemloader_prop) vendor_internal_prop(persist_rmnet_prop) vendor_internal_prop(persist_data_df_prop) vendor_internal_prop(persist_data_wda_prop) diff --git a/universal7885-common/vendor_name b/universal7885-common/vendor_name new file mode 100644 index 0000000..a1709ea --- /dev/null +++ b/universal7885-common/vendor_name @@ -0,0 +1 @@ +aosp \ No newline at end of file