Include carrier services in user builds' connectivity bug reports.
In order to achieve this, we give CarrierConfigLoader an extra argument
during its dumpsys that tells it to also dump whatever services it's
currently connected to. Back in dumpstate, we give this process a
slightly larger timeout to account for the additional info.
Bug: 146521742
Test: adb shell dumpsys carrier_config --requesting-package <various>
Test: take bug report from adb on user build, see no apps dumped with
carrier_config
Change-Id: I7953f90c6a67a4e032fc176e01cc3bd6dbadce76
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index 3a79357..814a4ed 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -1672,7 +1672,7 @@
// information. This information MUST NOT identify user-installed packages (UIDs are OK, package
// names are not), and MUST NOT contain logs of user application traffic.
// TODO(b/148168577) rename this and other related fields/methods to "connectivity" instead.
-static void DumpstateTelephonyOnly() {
+static void DumpstateTelephonyOnly(const std::string& calling_package) {
DurationReporter duration_reporter("DUMPSTATE");
const CommandOptions DUMPSYS_COMPONENTS_OPTIONS = CommandOptions::WithTimeout(60).Build();
@@ -1695,11 +1695,18 @@
RunDumpsys("DUMPSYS", {"connectivity"}, CommandOptions::WithTimeout(90).Build(),
SEC_TO_MSEC(10));
- // TODO(b/146521742) build out an argument to include bound services here for user builds
- RunDumpsys("DUMPSYS", {"carrier_config"}, CommandOptions::WithTimeout(90).Build(),
- SEC_TO_MSEC(10));
- RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(),
- SEC_TO_MSEC(10));
+ if (include_sensitive_info) {
+ // Carrier apps' services will be dumped below in dumpsys activity service all-non-platform.
+ RunDumpsys("DUMPSYS", {"carrier_config"}, CommandOptions::WithTimeout(90).Build(),
+ SEC_TO_MSEC(10));
+ } else {
+ // If the caller is a carrier app and has a carrier service, dump it here since we aren't
+ // running dumpsys activity service all-non-platform below. Due to the increased output, we
+ // give a higher timeout as well.
+ RunDumpsys("DUMPSYS", {"carrier_config", "--requesting-package", calling_package},
+ CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(30));
+ }
+ RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10));
RunDumpsys("DUMPSYS", {"netpolicy"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10));
RunDumpsys("DUMPSYS", {"network_management"}, CommandOptions::WithTimeout(90).Build(),
SEC_TO_MSEC(10));
@@ -2587,7 +2594,7 @@
if (options_->telephony_only) {
MaybeCheckUserConsent(calling_uid, calling_package);
- DumpstateTelephonyOnly();
+ DumpstateTelephonyOnly(calling_package);
DumpstateBoard();
} else if (options_->wifi_only) {
MaybeCheckUserConsent(calling_uid, calling_package);