summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/setupwizard/setup
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2015-03-03 12:31:16 -0800
committercretin45 <cretin45@gmail.com>2015-03-03 12:31:16 -0800
commitc9c13f20c9a86ad23381bef95a100189e0d08bca (patch)
tree34bea64517a160f258e069c0cbee99fddee2285a /src/com/cyanogenmod/setupwizard/setup
parent4e192fd22b90a76f8e2b71d23733e8c2b2dae18f (diff)
downloadpackages_apps_SetupWizard-c9c13f20c9a86ad23381bef95a100189e0d08bca.zip
packages_apps_SetupWizard-c9c13f20c9a86ad23381bef95a100189e0d08bca.tar.gz
packages_apps_SetupWizard-c9c13f20c9a86ad23381bef95a100189e0d08bca.tar.bz2
SetupWizard: Add callback for actions to run post finish
Change-Id: Ifa62c94f61afbe33a97a66dc0acb72e303023579
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup')
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/AbstractSetupData.java7
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java11
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/SetupDataCallbacks.java1
3 files changed, 16 insertions, 3 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/AbstractSetupData.java b/src/com/cyanogenmod/setupwizard/setup/AbstractSetupData.java
index d78da8e..c15900f 100644
--- a/src/com/cyanogenmod/setupwizard/setup/AbstractSetupData.java
+++ b/src/com/cyanogenmod/setupwizard/setup/AbstractSetupData.java
@@ -191,6 +191,13 @@ public abstract class AbstractSetupData extends BroadcastReceiver implements Set
}
}
+ @Override
+ public void addFinishRunnable(Runnable runnable) {
+ for (int i = 0; i < mListeners.size(); i++) {
+ mListeners.get(i).addFinishRunnable(runnable);
+ }
+ }
+
public Bundle save() {
Bundle bundle = new Bundle();
for (Page page : mPageList.values()) {
diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
index 2ff4afa..49b04ee 100644
--- a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
@@ -123,9 +123,14 @@ public class CyanogenSettingsPage extends SetupPage {
@Override
public void onFinishSetup() {
- if (getData().containsKey(KEY_ENABLE_NAV_KEYS)) {
- writeDisableNavkeysOption(mContext, getData().getBoolean(KEY_ENABLE_NAV_KEYS));
- }
+ getCallbacks().addFinishRunnable(new Runnable() {
+ @Override
+ public void run() {
+ if (getData().containsKey(KEY_ENABLE_NAV_KEYS)) {
+ writeDisableNavkeysOption(mContext, getData().getBoolean(KEY_ENABLE_NAV_KEYS));
+ }
+ }
+ });
handleWhisperPushRegistration();
handleEnableMetrics();
handleDefaultThemeSetup();
diff --git a/src/com/cyanogenmod/setupwizard/setup/SetupDataCallbacks.java b/src/com/cyanogenmod/setupwizard/setup/SetupDataCallbacks.java
index b4127a6..6b4982b 100644
--- a/src/com/cyanogenmod/setupwizard/setup/SetupDataCallbacks.java
+++ b/src/com/cyanogenmod/setupwizard/setup/SetupDataCallbacks.java
@@ -26,4 +26,5 @@ public interface SetupDataCallbacks {
boolean isCurrentPage(Page page);
Page getPage(String key);
Page getPage(int key);
+ void addFinishRunnable(Runnable runnable);
}