Merge "gps: collect chip information" into udc-d1-dev am: 5add75f9c2

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs-common/+/23823746

Change-Id: I50fa5fa4110c8c0d2d27e4b692a7dc588f1bf393
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-07-03 07:10:04 +00:00 committed by Automerger Merge Worker
commit e400e5c160

View file

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <unistd.h>
#include <dump/pixel_dump.h> #include <dump/pixel_dump.h>
#include <android-base/properties.h> #include <android-base/properties.h>
#include <android-base/file.h> #include <android-base/file.h>
@ -24,6 +25,7 @@
#define GPS_MCU_LOG_PREFIX "esw-" #define GPS_MCU_LOG_PREFIX "esw-"
#define GPS_MALLOC_LOG_DIRECTORY "/data/vendor/gps" #define GPS_MALLOC_LOG_DIRECTORY "/data/vendor/gps"
#define GPS_MALLOC_LOG_PREFIX "malloc_" #define GPS_MALLOC_LOG_PREFIX "malloc_"
#define GPS_VENDOR_CHIP_INFO "/data/vendor/gps/chip.info"
int main() { int main() {
if(!::android::base::GetBoolProperty("vendor.gps.aol.enabled", false)) { if(!::android::base::GetBoolProperty("vendor.gps.aol.enabled", false)) {
@ -41,6 +43,9 @@ int main() {
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 3, GPS_MCU_LOG_PREFIX); dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 3, GPS_MCU_LOG_PREFIX);
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum, GPS_LOG_PREFIX); dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum, GPS_LOG_PREFIX);
dumpLogs(GPS_MALLOC_LOG_DIRECTORY, outputDir.c_str(), 1, GPS_MALLOC_LOG_PREFIX); dumpLogs(GPS_MALLOC_LOG_DIRECTORY, outputDir.c_str(), 1, GPS_MALLOC_LOG_PREFIX);
if (access(GPS_VENDOR_CHIP_INFO, F_OK) == 0) {
copyFile(GPS_VENDOR_CHIP_INFO, concatenatePath(outputDir.c_str(), "chip.info").c_str());
}
return 0; return 0;
} }