Remove unnecessary code for new BugreportManager
BUG: 154298410
Test: Build pass
Change-Id: I88c1080fa714a84f708fc73cc5a59f44a7610859
Merged-In: I88c1080fa714a84f708fc73cc5a59f44a7610859
(cherry picked from commit eb4b464c58be39fc90f62b823ace017e88867feb)
diff --git a/cmds/dumpstate/binder/android/os/IDumpstateListener.aidl b/cmds/dumpstate/binder/android/os/IDumpstateListener.aidl
index a5e6c68..85e6969 100644
--- a/cmds/dumpstate/binder/android/os/IDumpstateListener.aidl
+++ b/cmds/dumpstate/binder/android/os/IDumpstateListener.aidl
@@ -72,5 +72,5 @@
/**
* Called when ui intensive bugreport dumps are finished.
*/
- oneway void onUiIntensiveBugreportDumpsFinished(String callingPackage);
+ oneway void onUiIntensiveBugreportDumpsFinished();
}
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index 616304c..82e3699 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -2893,17 +2893,17 @@
// TODO(b/158737089) reduce code repetition in if branches
if (options_->telephony_only) {
MaybeTakeEarlyScreenshot();
- onUiIntensiveBugreportDumpsFinished(calling_uid, calling_package);
+ onUiIntensiveBugreportDumpsFinished(calling_uid);
MaybeCheckUserConsent(calling_uid, calling_package);
DumpstateTelephonyOnly(calling_package);
} else if (options_->wifi_only) {
MaybeTakeEarlyScreenshot();
- onUiIntensiveBugreportDumpsFinished(calling_uid, calling_package);
+ onUiIntensiveBugreportDumpsFinished(calling_uid);
MaybeCheckUserConsent(calling_uid, calling_package);
DumpstateWifiOnly();
} else if (options_->limited_only) {
MaybeTakeEarlyScreenshot();
- onUiIntensiveBugreportDumpsFinished(calling_uid, calling_package);
+ onUiIntensiveBugreportDumpsFinished(calling_uid);
MaybeCheckUserConsent(calling_uid, calling_package);
DumpstateLimitedOnly();
} else {
@@ -2912,7 +2912,7 @@
// Take screenshot and get consent only after critical dumpsys has finished.
MaybeTakeEarlyScreenshot();
- onUiIntensiveBugreportDumpsFinished(calling_uid, calling_package);
+ onUiIntensiveBugreportDumpsFinished(calling_uid);
MaybeCheckUserConsent(calling_uid, calling_package);
// Dump state for the default case. This also drops root.
@@ -3002,16 +3002,14 @@
TakeScreenshot();
}
-void Dumpstate::onUiIntensiveBugreportDumpsFinished(int32_t calling_uid,
- const std::string& calling_package) {
+void Dumpstate::onUiIntensiveBugreportDumpsFinished(int32_t calling_uid) {
if (calling_uid == AID_SHELL || !CalledByApi()) {
return;
}
if (listener_ != nullptr) {
// Let listener know ui intensive bugreport dumps are finished, then it can do event
// handling if required.
- android::String16 package(calling_package.c_str());
- listener_->onUiIntensiveBugreportDumpsFinished(package);
+ listener_->onUiIntensiveBugreportDumpsFinished();
}
}
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index 9582c9d..3b9b1b7 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -549,8 +549,7 @@
void MaybeTakeEarlyScreenshot();
- void onUiIntensiveBugreportDumpsFinished(int32_t calling_uid,
- const std::string& calling_package);
+ void onUiIntensiveBugreportDumpsFinished(int32_t calling_uid);
void MaybeCheckUserConsent(int32_t calling_uid, const std::string& calling_package);
diff --git a/cmds/dumpstate/tests/dumpstate_smoke_test.cpp b/cmds/dumpstate/tests/dumpstate_smoke_test.cpp
index 1c6583e..70bdbcc 100644
--- a/cmds/dumpstate/tests/dumpstate_smoke_test.cpp
+++ b/cmds/dumpstate/tests/dumpstate_smoke_test.cpp
@@ -173,12 +173,9 @@
return binder::Status::ok();
}
- binder::Status onUiIntensiveBugreportDumpsFinished(const android::String16& callingpackage)
- override {
+ binder::Status onUiIntensiveBugreportDumpsFinished() override {
std::lock_guard <std::mutex> lock(lock_);
- std::string callingpackageUtf8 = std::string(String8(callingpackage).string());
- dprintf(out_fd_, "\rCalling package of ui intensive bugreport dumps finished: %s",
- callingpackageUtf8.c_str());
+ dprintf(out_fd_, "\rUi intensive bugreport dumps finished");
return binder::Status::ok();
}
diff --git a/cmds/dumpstate/tests/dumpstate_test.cpp b/cmds/dumpstate/tests/dumpstate_test.cpp
index 6b93692..fdeea24 100644
--- a/cmds/dumpstate/tests/dumpstate_test.cpp
+++ b/cmds/dumpstate/tests/dumpstate_test.cpp
@@ -68,8 +68,7 @@
MOCK_METHOD1(onError, binder::Status(int32_t error_code));
MOCK_METHOD0(onFinished, binder::Status());
MOCK_METHOD1(onScreenshotTaken, binder::Status(bool success));
- MOCK_METHOD1(onUiIntensiveBugreportDumpsFinished,
- binder::Status(const android::String16& callingpackage));
+ MOCK_METHOD0(onUiIntensiveBugreportDumpsFinished, binder::Status());
protected:
MOCK_METHOD0(onAsBinder, IBinder*());