DescriptionMake InstanceIDBridge fully async to fix strict mode violations
InstanceID.java's getInstance/getId/getCreationTime methods are not
documented as needing to be called from a background thread (unlike
getToken and deleteToken which are documented as "Do not call this
function on the main thread.", or deleteInstanceID which is not
documented but at least throws an IOException if you get this wrong).
However it turns out that getInstance/getId/getCreationTime can all
cause strict mode violations if called on the main thread, because
they sometimes read from SharedPreferences (and hence from disk).
This patch fixes these violations, by making InstanceIDBridge fully
asynchronous. Its InstanceIDWithSubtype is now initialized lazily on a
background thread.
Part of a series of patches:
1. https://codereview.chromium.org/1832833002 adds InstanceIDWithSubtype
2. https://codereview.chromium.org/1830983002 adds JNI bindings
3. https://codereview.chromium.org/1829023002 adds fake and test
4. this patch
5. https://codereview.chromium.org/1854093002 enables InstanceID by default
6. https://codereview.chromium.org/1923953002 adds crypto integration
7. https://codereview.chromium.org/1851423003 switches Push to InstanceIDs
BUG=589461
Committed: https://crrev.com/6ab9853acfbfae3e598004776c1d120805956038
Cr-Commit-Position: refs/heads/master@{#390139}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Rebase #Patch Set 3 : Fix DeleteID use after free #
Total comments: 2
Patch Set 4 : Rebase & tweak lifetime comments #
Total comments: 2
Patch Set 5 : Disallow synchronous delete from callbacks #
Total comments: 2
Patch Set 6 : |this| #
Dependent Patchsets: Messages
Total messages: 22 (7 generated)
|