diff options
| author | 2023-07-21 13:19:05 -0400 | |
|---|---|---|
| committer | 2023-07-24 19:44:12 +0000 | |
| commit | 9ae521e0cea057f4aa23f44644be06efd3c9f8d8 (patch) | |
| tree | 49eaec9f20c096d47e3f261c9651b6d7e6354269 | |
| parent | 1f89e284a4a6e0d835bfa2263331cae5f0471dbc (diff) | |
Demote 2 Dumpables from CRITICAL for being slow
* NetworkController
* WMShell
Test: adb bugreport -> ABT
Bug: 292221335
Merged-In: I89aeecb85c3c77f68da28758025ccf336269ca69
Change-Id: I89aeecb85c3c77f68da28758025ccf336269ca69
4 files changed, 22 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/CoreStartable.java b/packages/SystemUI/src/com/android/systemui/CoreStartable.java index becf5b39e9df..c07a4d26f476 100644 --- a/packages/SystemUI/src/com/android/systemui/CoreStartable.java +++ b/packages/SystemUI/src/com/android/systemui/CoreStartable.java @@ -53,6 +53,11 @@ public interface CoreStartable extends Dumpable { default void dump(@NonNull PrintWriter pw, @NonNull String[] args) { } + /** Called to determine if the dumpable should be registered as critical or normal priority */ + default boolean isDumpCritical() { + return true; + } + /** Called immediately after the system broadcasts * {@link android.content.Intent#ACTION_LOCKED_BOOT_COMPLETED} or during SysUI startup if the * property {@code sys.boot_completed} is already set to 1. The latter typically occurs when diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java index 453d1d117d0d..e8458e72fd9e 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java @@ -254,11 +254,16 @@ public class SystemUIApplication extends Application implements } for (i = 0; i < mServices.length; i++) { + CoreStartable service = mServices[i]; if (mBootCompleteCache.isBootComplete()) { - notifyBootCompleted(mServices[i]); + notifyBootCompleted(service); } - dumpManager.registerDumpable(mServices[i].getClass().getName(), mServices[i]); + if (service.isDumpCritical()) { + dumpManager.registerCriticalDumpable(service.getClass().getName(), service); + } else { + dumpManager.registerNormalDumpable(service.getClass().getName(), service); + } } mSysUIComponent.getInitController().executePostInitTasks(); log.traceEnd(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java index 9aa28c31cfd8..157d2c44703e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java @@ -83,8 +83,6 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceP import com.android.systemui.telephony.TelephonyListenerManager; import com.android.systemui.util.CarrierConfigTracker; -import kotlin.Unit; - import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -99,6 +97,8 @@ import java.util.stream.Collectors; import javax.inject.Inject; +import kotlin.Unit; + /** Platform implementation of the network controller. **/ @SysUISingleton public class NetworkControllerImpl extends BroadcastReceiver @@ -465,7 +465,7 @@ public class NetworkControllerImpl extends BroadcastReceiver mDemoModeController.addCallback(this); - mDumpManager.registerDumpable(TAG, this); + mDumpManager.registerNormalDumpable(TAG, this); } private final Runnable mClearForceValidated = () -> { diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java index 943e906a1ebc..6fafcd51bd50 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java @@ -352,6 +352,13 @@ public final class WMShell implements } @Override + public boolean isDumpCritical() { + // Dump can't be critical because the shell has to dump on the main thread for + // synchronization reasons, which isn't reliably fast. + return false; + } + + @Override public void dump(PrintWriter pw, String[] args) { // Handle commands if provided if (mShell.handleCommand(args, pw)) { |