Tie ContextualWifiSlice to UI instead of garbage collector
- Introduce a static long in SliceFeatureProvider that updates once every "session". A session is when user is in an UI (screen rotation, going to subpage, etc does not break the continuation of session). - Use session token in ContextualWifiSlice to determine when to refresh, instead of relying on WeakHashMap from CustomSliceManager. WeakHashMap can be cleaned up at any time by gc so it doesn't match what we want on the UI. - Also as a side fix, merged CustomSliceManager into SliceFeatureProvider. Fixes: 123937830 Test: robo Change-Id: I199bceceb208b99a32f3f08e624787b5a03e73a9
This commit is contained in:
@@ -135,7 +135,6 @@ public class SettingsSliceProviderTest {
|
||||
mProvider.mSliceWeakDataCache = new HashMap<>();
|
||||
mProvider.mSliceDataCache = new HashMap<>();
|
||||
mProvider.mSlicesDatabaseAccessor = new SlicesDatabaseAccessor(mContext);
|
||||
mProvider.mCustomSliceManager = new CustomSliceManager(mContext);
|
||||
when(mProvider.getContext()).thenReturn(mContext);
|
||||
|
||||
SlicesDatabaseHelper.getInstance(mContext).setIndexedState();
|
||||
|
Reference in New Issue
Block a user