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:
@@ -331,7 +331,7 @@ public class CustomSliceRegistry {
|
||||
|
||||
/**
|
||||
* Returns {@code true} if {@param uri} is a valid Slice Uri handled by
|
||||
* {@link CustomSliceManager}.
|
||||
* {@link CustomSliceRegistry}.
|
||||
*/
|
||||
public static boolean isValidUri(Uri uri) {
|
||||
return sUriToSlice.containsKey(removeParameterFromUri(uri));
|
||||
@@ -339,7 +339,7 @@ public class CustomSliceRegistry {
|
||||
|
||||
/**
|
||||
* Returns {@code true} if {@param action} is a valid intent action handled by
|
||||
* {@link CustomSliceManager}.
|
||||
* {@link CustomSliceRegistry}.
|
||||
*/
|
||||
public static boolean isValidAction(String action) {
|
||||
return isValidUri(Uri.parse(action));
|
||||
|
Reference in New Issue
Block a user