diff options
author | Rodrigo Lagos <rlagos@google.com> | 2021-01-19 21:44:47 -0800 |
---|---|---|
committer | Rodrigo Lagos <rlagos@google.com> | 2021-01-20 01:27:48 -0800 |
commit | 10e64e86915f74d9a13999108eb590bcf5a69912 (patch) | |
tree | 35ef07d2ddb1aa93db043ab409618c3d4ea3784e | |
parent | fc88f6dc8cb9f31f8fb1d405fd32fb1a1a3b724c (diff) | |
download | setupwizard-10e64e86915f74d9a13999108eb590bcf5a69912.tar.gz |
Update CarWizardManagerHelper to be inline with latest Car code
Bug: 177920875
Test: local builds
Change-Id: Iac591842f8a6767a728ba645f011b9aa59f0f875
-rw-r--r-- | library/main/src/com/android/car/setupwizardlib/util/CarWizardManagerHelper.java | 21 | ||||
-rw-r--r-- | library/main/src/com/android/car/setupwizardlib/util/ResultCodes.java | 4 |
2 files changed, 25 insertions, 0 deletions
diff --git a/library/main/src/com/android/car/setupwizardlib/util/CarWizardManagerHelper.java b/library/main/src/com/android/car/setupwizardlib/util/CarWizardManagerHelper.java index 7f5cf7a..ff83b55 100644 --- a/library/main/src/com/android/car/setupwizardlib/util/CarWizardManagerHelper.java +++ b/library/main/src/com/android/car/setupwizardlib/util/CarWizardManagerHelper.java @@ -148,4 +148,25 @@ public final class CarWizardManagerHelper { return Settings.Global.getInt(context.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0) == 1; } + /** + * Checks whether an intent is running in the initial setup wizard flow. + * + * @param intent The intent to be checked, usually from {@link Activity#getIntent()}. + * @return true if the intent passed in was intended to be used with setup wizard. + */ + public static boolean isInitialSetupWizard(Intent intent) { + return intent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false); + } + + /** + * Checks whether an intent is running in the deferred setup wizard flow. + * + * @param originalIntent The original intent that was used to start the step, usually via {@link + * Activity#getIntent()}. + * @return true if the intent passed in was running in deferred setup wizard. + */ + public static boolean isDeferredSetupWizard(Intent originalIntent) { + return originalIntent != null && originalIntent.getBooleanExtra(EXTRA_IS_DEFERRED_SETUP, + false); + } } diff --git a/library/main/src/com/android/car/setupwizardlib/util/ResultCodes.java b/library/main/src/com/android/car/setupwizardlib/util/ResultCodes.java index 604e8b0..89b8d11 100644 --- a/library/main/src/com/android/car/setupwizardlib/util/ResultCodes.java +++ b/library/main/src/com/android/car/setupwizardlib/util/ResultCodes.java @@ -23,7 +23,11 @@ import static android.app.Activity.RESULT_FIRST_USER; */ public final class ResultCodes { public static final int RESULT_SKIP = RESULT_FIRST_USER; + public static final int RESULT_RETRY = RESULT_FIRST_USER + 1; public static final int RESULT_ACTIVITY_NOT_FOUND = RESULT_FIRST_USER + 2; + public static final int RESULT_LIFECYCLE_NOT_MATCHED = RESULT_FIRST_USER + 3; + public static final int RESULT_FLOW_NOT_MATCHED = RESULT_FIRST_USER + 4; + public static final int RESULT_FIRST_SETUP_USER = RESULT_FIRST_USER + 100; private ResultCodes() { |