Back to project page wifi-auto-forget.
The source code is released under:
GNU General Public License
If you think the Android project wifi-auto-forget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.cebesius.wifiautoforget.mvp; //from w w w . j a v a 2 s . c o m import com.cebesius.wifiautoforget.domain.AutoForgetWifi; import com.cebesius.wifiautoforget.gateway.AddWifiNotificationUsageStorage; import com.cebesius.wifiautoforget.gateway.AutoForgetWifiStorage; /** * Implementation of Add Wifi model */ public class AddWifiModel { private final AutoForgetWifiStorage autoForgetWifiStorage; private final AddWifiNotificationUsageStorage addWifiNotificationUsageStorage; public AddWifiModel(AutoForgetWifiStorage autoForgetWifiStorage, AddWifiNotificationUsageStorage addWifiNotificationUsageStorage) { this.autoForgetWifiStorage = autoForgetWifiStorage; this.addWifiNotificationUsageStorage = addWifiNotificationUsageStorage; } public void incrementAddWifiNotificationActionCount() { addWifiNotificationUsageStorage.incrementActionCount(); } public void setAddWifiNotificationTypeUsed(AutoForgetWifi.Behavior behavior) { switch (behavior) { case SINGLE: addWifiNotificationUsageStorage.setUsedSingle(); break; case PERMANENT: addWifiNotificationUsageStorage.setUsedPermanent(); break; case NEVER: addWifiNotificationUsageStorage.setUsedIgnore(); break; default: throw new IllegalArgumentException("Unrecognized AutoForgetBehavior"); } } public void addNetwork(AutoForgetWifi autoForgetWifi) { autoForgetWifiStorage.save(autoForgetWifi); } }