commit | 6ab9853acfbfae3e598004776c1d120805956038 | [log] [tgz] |
---|---|---|
author | johnme <[email protected]> | Wed Apr 27 18:57:10 2016 |
committer | Commit bot <[email protected]> | Wed Apr 27 18:58:29 2016 |
tree | 5a58964beb28f63856bf30ad9dfb9382d1b0fa70 | |
parent | d2fa600f6b2bb3670f565350ec3ed5c5767b4cf5 [diff] |
Make 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 Review-Url: https://codereview.chromium.org/1899753002 Cr-Commit-Position: refs/heads/master@{#390139}