DescriptionStore standalone web app data in WebappDataStorage as well as the homescreen intent.
Homescreen launch intents for standalone web apps on Android contain
several properties which WebappActivity requires to launch the app in
the web frame (e.g. icon, names, theme/background color). This structure
means that launching webapps from sources other than the homescreen
(e.g. a notification) won't work. The root problem is that Android does
not have an API for querying shortcuts on the home screen after they
have been added.
This CL mirrors the homescreen intent data into Android Shared
Preferences via WebappDataStorage, and refactors how homescreen launch
intents for standalone apps are created. Standalone web apps added to
homescreen before this CL will have their data copied into a
WebappDataStorage when they are next launched. A new scope field is
computed from the URL to identify the URLs over which a web app may
control. This CL enables Chrome to launch a web app to standalone
mode without the homescreen intent.
The semantics of WebappDataStorage have also changed. Now, the only
correct way to access a WebappDataStorage is via the WebappRegistry.
New methods to access storage objects have been added to the registry,
and all clients should use these.
The existing WebappDataStorage expiry mechanism is maintained in this
CL, ensuring that web apps which have not been launched recently will
have their stored data removed. Additionally, URLs, scopes, and last
access times are purged when the user clears history.
Additional and updated tests for this functionality are also added.
BUG=594872
Committed: https://crrev.com/6509a4deca126b49eb9121fefedcfc092dee0631
Cr-Commit-Position: refs/heads/master@{#385402}
Patch Set 1 #Patch Set 2 : Improve comments #
Total comments: 24
Patch Set 3 : Addressing reviewer comments #Patch Set 4 : Fix test #Patch Set 5 : Remove some thread asserts #
Total comments: 20
Patch Set 6 : Refactor. Adding scope computation. Addressing comments #Patch Set 7 : Move scope calculation to Java. Fix test #Patch Set 8 : Address strict mode violation #
Total comments: 9
Patch Set 9 : Final nit #Depends on Patchset: Dependent Patchsets: Messages
Total messages: 22 (8 generated)
|