From 24f573d029ded0ccbaf9de0907b6ff0f461857ae Mon Sep 17 00:00:00 2001 From: Roy Chou Date: Mon, 25 Sep 2023 08:37:09 +0000 Subject: fix(systemui): fix perfetto_ft_systemui-missed_app_frames-mean increased The perfetto_ft_systemui-missed_app_frames-mean value increased after ag/24677444. Try debugging the issue then we find the major cause is the PhoneStatusBarViewController calls the PhoneStatusBarView#updateResources when onConfigChanged triggered. Besides, PhoneStatusBarView already has the method onConfigurationChanged to detect the configuration change then call updateResources. Therefore, as the quick workaround, in PhoneStatusBarViewController we remove the onConfigChanged method, and leave PhoneStatusBarView detecting onConfigurationChanged itself. Test on abtd and the perfetto_ft_systemui-missed_app_frames-mean seems to decrease to the previous good build value. Bug: 300629388 Test: abtd to check the perfetto_ft_systemui-missed_app_frames-mean Change-Id: Ib568165d73cc9b3fb8178b5b5854d09c4225adeb Merged-In: Ib568165d73cc9b3fb8178b5b5854d09c4225adeb --- .../src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java | 3 +++ .../android/systemui/statusbar/phone/PhoneStatusBarViewController.kt | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 1966033363d4..abae0b80190f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -112,6 +112,9 @@ public class PhoneStatusBarView extends FrameLayout { mDisplayCutout = null; } + // Per b/300629388, we let the PhoneStatusBarView detect onConfigurationChanged to + // updateResources, instead of letting the PhoneStatusBarViewController detect onConfigChanged + // then notify PhoneStatusBarView. @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt index 85a75ea3c913..d67a1fa25c68 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.phone import android.app.StatusBarManager.WINDOW_STATE_SHOWING import android.app.StatusBarManager.WINDOW_STATUS_BAR -import android.content.res.Configuration import android.graphics.Point import android.util.Log import android.view.MotionEvent @@ -68,10 +67,6 @@ class PhoneStatusBarViewController private constructor( private lateinit var statusContainer: View private val configurationListener = object : ConfigurationController.ConfigurationListener { - override fun onConfigChanged(newConfig: Configuration?) { - mView.updateResources() - } - override fun onDensityOrFontScaleChanged() { mView.onDensityOrFontScaleChanged() } -- cgit v1.2.3-59-g8ed1b