diff options
author | Roshan Pius <rpius@google.com> | 2018-01-05 13:28:55 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2018-01-18 11:24:00 -0800 |
commit | f442f2fcab4c59429926cdf79e2499f4977faf4b (patch) | |
tree | 695ba35550cb2ad9f66cb6d62bdb79b190b0fa3a /service/java/com/android/server/wifi/WakeupConfigStoreData.java | |
parent | 27ac89b2976f210663d977a3d5d259f87f27f359 (diff) | |
download | android_frameworks_opt_net_wifi-f442f2fcab4c59429926cdf79e2499f4977faf4b.tar.gz android_frameworks_opt_net_wifi-f442f2fcab4c59429926cdf79e2499f4977faf4b.tar.bz2 android_frameworks_opt_net_wifi-f442f2fcab4c59429926cdf79e2499f4977faf4b.zip |
WifiConfigStore: Inform the clients when store has no data for them
Some modules like ONA, WakeupController are dependent on
store read completion to kick off operations. So, ensure
that the config store informs all the clients when the
shared/user store is read even if there is nothing in the file (fresh
install).
Changes in the CL:
a) Only invoke deserializeData & resetData for user store if it has
become visible (after user unlock).
b) When the store contents are empty, inform the clients that there is
no data to read by passing in a null parser handle.
With these changes, the clients can effectively wait for the
deserializeData() of their store data module being invoked to
kick off operations.
Bug: 71644289
Test: Unit tests
Test: Manual tests (Added logs in all the clients DataSource to ensure
they all received a call to deserializeData() twice on bootup (one for
shared & one for user).
|in| being null when they have no data & |in| being non-null when they have data)
Test: Sent for regression tests: b/71712638
Change-Id: If250252baf147bb16990dfa693417ead312b9911
Diffstat (limited to 'service/java/com/android/server/wifi/WakeupConfigStoreData.java')
-rw-r--r-- | service/java/com/android/server/wifi/WakeupConfigStoreData.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WakeupConfigStoreData.java b/service/java/com/android/server/wifi/WakeupConfigStoreData.java index 577511773..a2134b9f0 100644 --- a/service/java/com/android/server/wifi/WakeupConfigStoreData.java +++ b/service/java/com/android/server/wifi/WakeupConfigStoreData.java @@ -110,6 +110,10 @@ public class WakeupConfigStoreData implements StoreData { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, boolean shared) throws XmlPullParserException, IOException { + // Ignore empty reads. + if (in == null) { + return; + } if (shared) { throw new XmlPullParserException("Shared data not supported"); } |