Reduce jank on DND apps page

1) Remove call to redisplay the api when registering our app listener -
this meant all preferences were always removed/readded on page load
because the app list isn't ready at that time
2) Stop rebuilding the UI for events we don't care about
3) Keep existing preferences when possible and just do the diff of prefs
that need to be added/removed

Fixes: 234298144
Test: ZenModeAddBypassingAppsPreferenceControllerTest
Test: ZenModeAllBypassingAppsPreferenceControllerTest
Test: manually view page; add & remove apps that have dnd breakthrough
Change-Id: I57b36d36135dd25d1d2fd73073cf6b7a033659a6
This commit is contained in:
Julia Reynolds
2023-02-16 15:30:24 -05:00
parent 1692714346
commit 9f7af5946e
3 changed files with 72 additions and 89 deletions

View File

@@ -138,8 +138,9 @@ public class ZenModeAddBypassingAppsPreferenceControllerTest {
Preference pref = prefCaptor.getValue();
assertThat(pref.getKey()).isEqualTo(
ZenModeAllBypassingAppsPreferenceController.getKey(
appWithChannelsNoneBypassing.info.packageName));
ZenModeAddBypassingAppsPreferenceController.getKey(
appWithChannelsNoneBypassing.info.packageName,
appWithChannelsNoneBypassing.info.uid));
}
@Test
@@ -159,6 +160,6 @@ public class ZenModeAddBypassingAppsPreferenceControllerTest {
Preference pref = prefCaptor.getValue();
assertThat(pref.getKey()).isEqualTo(
ZenModeAllBypassingAppsPreferenceController.KEY_NO_APPS);
ZenModeAddBypassingAppsPreferenceController.KEY_NO_APPS);
}
}