From 4313df1cc55d3c0eac4200f8256287d370d7d93b Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Mon, 31 Oct 2022 10:50:44 +0800 Subject: [PATCH 1/2] move gps init.rc settings to gs-common Bug: 254758553 Test: boot and open google map getting my location Change-Id: I0147860500f85d13e33dc8064c408171e4bc009d --- conf/init.gs201.rc | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/conf/init.gs201.rc b/conf/init.gs201.rc index b95aeae6..6f4dc269 100644 --- a/conf/init.gs201.rc +++ b/conf/init.gs201.rc @@ -593,38 +593,6 @@ service abox /vendor/bin/main_abox 17c50000.abox group audioserver seclabel u:r:abox:s0 -# GPS -service lhd /vendor/bin/hw/lhd /vendor/etc/gnss/lhd.conf - class main - user gps - group system inet net_raw sdcard_rw - ioprio be 0 - -service gpsd /vendor/bin/hw/gpsd -c /vendor/etc/gnss/gps.xml - class main - user gps - group system gps radio inet wakelock sdcard_rw net_raw - ioprio be 0 - -service scd /vendor/bin/hw/scd /vendor/etc/gnss/scd.conf - class main - user gps - group system inet net_raw wakelock - ioprio be 0 - -service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-brcm - class hal - user gps - group system gps radio - ioprio be 0 - priority -1 - -# disable gps service if no gps h/w -on property:vendor.ril.cbd.svc=0 - stop gpsd - stop lhd - stop scd - # on userdebug and eng builds, enable kgdb on the serial console on property:ro.debuggable=1 write /sys/module/kgdboc/parameters/kgdboc ttyFIQ1 From d59bc448e2a712cbc0688d519b31c2ee387d7b22 Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Wed, 2 Nov 2022 13:00:36 +0800 Subject: [PATCH 2/2] align user experience on Android bug tool Bug: 255250616 Test: adb shell dumpsys android.hardware.dumpstate.IDumpstateDevice/default wlan Change-Id: Ibefd8f9fff91cf6ece1f09dd6b207b6f9c97df4d --- dumpstate/Dumpstate.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index adf51b47..af913fd0 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -246,6 +246,7 @@ Dumpstate::Dumpstate() // if the specified section is not supported. void Dumpstate::dumpTextSection(int fd, const std::string §ionName) { bool dumpAll = (sectionName == kAllSections); + std::string dumpFiles; for (const auto §ion : mTextSections) { if (dumpAll || sectionName == section.first) { @@ -259,22 +260,29 @@ void Dumpstate::dumpTextSection(int fd, const std::string §ionName) { } } - // Execute all programs under vendor/bin/dump/ + // Execute all or designated programs under vendor/bin/dump/ std::unique_ptr dir(opendir("/vendor/bin/dump"), closedir); if (!dir) { - ALOGE("Fail To Open Dir vendor/bin/dump/"); - } else { - dirent *entry; - while ((entry = readdir(dir.get())) != nullptr) { + ALOGE("Fail To Open Dir vendor/bin/dump/"); + ::android::base::WriteStringToFd("Fail To Open Dir vendor/bin/dump/\n", fd); + return; + } + dirent *entry; + while ((entry = readdir(dir.get())) != nullptr) { // Skip '.', '..' if (entry->d_name[0] == '.') { - continue; + continue; } std::string bin(entry->d_name); - auto startTime = startSection(fd, "/vendor/bin/dump/"+bin); - RunCommandToFd(fd, "/vendor/bin/dump/"+bin, {"/vendor/bin/dump/"+bin}); - endSection(fd, "/vendor/bin/dump/"+bin, startTime); - } + dumpFiles = dumpFiles + " " + bin; + if (dumpAll || sectionName == bin) { + auto startTime = startSection(fd, bin); + RunCommandToFd(fd, "/vendor/bin/dump/"+bin, {"/vendor/bin/dump/"+bin}); + endSection(fd, bin, startTime); + if (!dumpAll) { + return; + } + } } if (dumpAll) { @@ -287,6 +295,7 @@ void Dumpstate::dumpTextSection(int fd, const std::string §ionName) { for (const auto §ion : mTextSections) { ::android::base::WriteStringToFd(" " + section.first, fd); } + ::android::base::WriteStringToFd(dumpFiles, fd); ::android::base::WriteStringToFd("\nNote: sections with attachments (e.g. modem) are" "not avalable from the command line.\n", fd); }