summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/WakeupConfigStoreData.java
diff options
context:
space:
mode:
authorEric Schwarzenbach <easchwar@google.com>2018-03-14 09:46:39 -0700
committerEric Schwarzenbach <easchwar@google.com>2018-03-29 16:24:16 -0700
commit5aad8ece7e38a80db917d49b5245f6b8c6dca273 (patch)
tree20fdf7d221c94a7612610ae2730df4567683e742 /service/java/com/android/server/wifi/WakeupConfigStoreData.java
parent4f894bd0f4b378972d10f64390ab710da54d5cc6 (diff)
downloadandroid_frameworks_opt_net_wifi-5aad8ece7e38a80db917d49b5245f6b8c6dca273.tar.gz
android_frameworks_opt_net_wifi-5aad8ece7e38a80db917d49b5245f6b8c6dca273.tar.bz2
android_frameworks_opt_net_wifi-5aad8ece7e38a80db917d49b5245f6b8c6dca273.zip
Change onboarding flow.
This CL incorporates a few changes to the Wifi Wake onboarding flow. Wifi Wake now operates as normal even if the user has not interacted with the onboarding notification. The onboarding notification will be shown when WiFi is disabled if the user is not onboarded (3 times max, at most once every 24 hours). The user is considered onboarded if they have interacted with the notification, seen 3 notifications, or manually changed enabled/disabled the feature from Wifi Settings page. Bug: 72399908 Test: runtest, manual Change-Id: I5fd02510b39ae89223ad28352f2045af33c13a5e
Diffstat (limited to 'service/java/com/android/server/wifi/WakeupConfigStoreData.java')
-rw-r--r--service/java/com/android/server/wifi/WakeupConfigStoreData.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WakeupConfigStoreData.java b/service/java/com/android/server/wifi/WakeupConfigStoreData.java
index b936a4c6c..d98567766 100644
--- a/service/java/com/android/server/wifi/WakeupConfigStoreData.java
+++ b/service/java/com/android/server/wifi/WakeupConfigStoreData.java
@@ -39,12 +39,14 @@ public class WakeupConfigStoreData implements StoreData {
private static final String XML_TAG_FEATURE_STATE_SECTION = "FeatureState";
private static final String XML_TAG_IS_ACTIVE = "IsActive";
private static final String XML_TAG_IS_ONBOARDED = "IsOnboarded";
+ private static final String XML_TAG_NOTIFICATIONS_SHOWN = "NotificationsShown";
private static final String XML_TAG_NETWORK_SECTION = "Network";
private static final String XML_TAG_SSID = "SSID";
private static final String XML_TAG_SECURITY = "Security";
private final DataSource<Boolean> mIsActiveDataSource;
private final DataSource<Boolean> mIsOnboardedDataSource;
+ private final DataSource<Integer> mNotificationsDataSource;
private final DataSource<Set<ScanResultMatchInfo>> mNetworkDataSource;
private boolean mHasBeenRead = false;
@@ -76,9 +78,11 @@ public class WakeupConfigStoreData implements StoreData {
public WakeupConfigStoreData(
DataSource<Boolean> isActiveDataSource,
DataSource<Boolean> isOnboardedDataSource,
+ DataSource<Integer> notificationsDataSource,
DataSource<Set<ScanResultMatchInfo>> networkDataSource) {
mIsActiveDataSource = isActiveDataSource;
mIsOnboardedDataSource = isOnboardedDataSource;
+ mNotificationsDataSource = notificationsDataSource;
mNetworkDataSource = networkDataSource;
}
@@ -116,6 +120,8 @@ public class WakeupConfigStoreData implements StoreData {
XmlUtil.writeNextValue(out, XML_TAG_IS_ACTIVE, mIsActiveDataSource.getData());
XmlUtil.writeNextValue(out, XML_TAG_IS_ONBOARDED, mIsOnboardedDataSource.getData());
+ XmlUtil.writeNextValue(out, XML_TAG_NOTIFICATIONS_SHOWN,
+ mNotificationsDataSource.getData());
XmlUtil.writeNextSectionEnd(out, XML_TAG_FEATURE_STATE_SECTION);
}
@@ -185,6 +191,7 @@ public class WakeupConfigStoreData implements StoreData {
throws IOException, XmlPullParserException {
boolean isActive = false;
boolean isOnboarded = false;
+ int notificationsShown = 0;
while (!XmlUtil.isNextSectionEnd(in, outerTagDepth)) {
String[] valueName = new String[1];
@@ -199,6 +206,9 @@ public class WakeupConfigStoreData implements StoreData {
case XML_TAG_IS_ONBOARDED:
isOnboarded = (Boolean) value;
break;
+ case XML_TAG_NOTIFICATIONS_SHOWN:
+ notificationsShown = (Integer) value;
+ break;
default:
throw new XmlPullParserException("Unknown value found: " + valueName[0]);
}
@@ -206,6 +216,7 @@ public class WakeupConfigStoreData implements StoreData {
mIsActiveDataSource.setData(isActive);
mIsOnboardedDataSource.setData(isOnboarded);
+ mNotificationsDataSource.setData(notificationsShown);
}
/**
@@ -248,6 +259,7 @@ public class WakeupConfigStoreData implements StoreData {
mNetworkDataSource.setData(Collections.emptySet());
mIsActiveDataSource.setData(false);
mIsOnboardedDataSource.setData(false);
+ mNotificationsDataSource.setData(0);
}
}