Skip to content
Commit f5e17699 authored by Dan Sandler's avatar Dan Sandler
Browse files

Delay pruning direct share targets.

Pruning was intended to remove targets corresponding to
now-missing packages, but in practice causes the list to
briefly disappear any time packages change:

    PACKAGE_CHANGED ->
	ResolverActivity.rebuildList() ->
	    ChooserActivity.onListRebuilt() with an empty
	    ResolverActivity.mDisplayList

In practice package changes happen all the time, so this
jank happens fairly often. (It contributed to b/67622422 as
well, since all this list rebuilding started animations that
locked out user input.)

This CL removes the old pruning process (comparing targets
against mDisplayList). Instead, we note that mDisplayList
got emptied, and lazily empty our own mServiceTargets once
we start getting responses back from all the services we
just re-queried.

The long-term fix here is to just rebuild all of this stuff.

Test: (1) share from Chrome
      (2) toggle the enable state of some random package
          to trigger PACKAGE_CHANGED, e.g.
          adb shell pm (enable|disable) com.android.egg
      (3) watch for jank
Bug: 109676071

Change-Id: Ie9d59b8f4b8cc8343beb40cbad6b8d52e5639082
parent dea740bd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment