From 4124284bb7d09c5906451c6db0fcffea84748561 Mon Sep 17 00:00:00 2001 From: Yanting Yang Date: Fri, 25 Jun 2021 03:43:14 +0800 Subject: [PATCH] Improve the latency of first entering Apps page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: AppsPreferenceController will query the recent app usages twice on the main thread. Solution: Set flag to ensure only triggering refreshUi() once when entering the Apps page. Also correct the preference key of apps.xml since we don’t have duplicated preferences now. Fixes: 183176038 Test: robotests & visual Change-Id: Ia41ee1e4a1946b8122deca63e318d3915afcc426 --- res/xml/apps.xml | 4 ++-- .../applications/AppDashboardFragment.java | 1 + .../AppsPreferenceController.java | 24 +++++++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/res/xml/apps.xml b/res/xml/apps.xml index a7d823b918d..e6314dab28a 100644 --- a/res/xml/apps.xml +++ b/res/xml/apps.xml @@ -55,7 +55,7 @@ settings:searchable="false"/> @@ -85,7 +85,7 @@