diff options
author | Googler <noreply@google.com> | 2022-01-25 13:29:45 -0800 |
---|---|---|
committer | Sandy Alfaro Lopez <sandraalfaro@google.com> | 2022-01-25 14:29:07 -0800 |
commit | ebb287189068e4835f6e0d3346785c0d733ce828 (patch) | |
tree | 837e2b957b7ea9572732fa4af1d95d0cf1a0011a | |
parent | d58a24804d4f71ab88ee9ddde808e69228978b15 (diff) | |
download | setupwizard-ebb287189068e4835f6e0d3346785c0d733ce828.tar.gz |
Changes for Car Setup Wizard Support Library:
- 177228382 Setup Copybara for copying platform/frameworks/opt/car/se... by Googler <noreply@google.com>
- 180217178 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 181209675 Update copy.bara.sky and BUILD by Googler <noreply@google.com>
- 181243235 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 193276356 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 195924325 Enabled CaaS for Car Setup Wizard Lib. by Googler <noreply@google.com>
- 205731829 Automatically transform strings during copybara migration by Googler <noreply@google.com>
- 205732320 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 205756611 Automated g4 rollback of changelist 205732320. by Googler <noreply@google.com>
- 205910887 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 208710862 Update Car Setup Wizard Support Library destination mode by Googler <noreply@google.com>
- 209198132 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 209211534 Automated g4 rollback of changelist 209198132. by Googler <noreply@google.com>
- 209682214 Add blueprint to copybara exclusion list by Googler <noreply@google.com>
- 211701694 Update car support library to point to 1.0.0 alpha5. by Googler <noreply@google.com>
- 211712794 Automated g4 rollback of changelist 211701694. by Googler <noreply@google.com>
- 212035814 Update car support library to point to 1.0.0 alpha5. by Googler <noreply@google.com>
- 212346330 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 228343855 Add Rodrigo as primary owner of SUW directories by Googler <noreply@google.com>
- 228938878 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 229816099 Exclude Android.bp file from copybara processes by Googler <noreply@google.com>
- 230143749 Adding back Android.mk for now by Googler <noreply@google.com>
- 230630507 Removal of check_last_rev_state, and update of excludes t... by Googler <noreply@google.com>
- 231014033 Create car_setup_wizard_lib targets in third_party/java/a... by Googler <noreply@google.com>
- 231631131 Add service.migration to copybara config by Googler <noreply@google.com>
- 231867483 Cloned from CL 231688242 by 'g4 patch'. by Googler <noreply@google.com>
- 233287439 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 237545342 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 240391137 Remove illegal mock of Car & CarUxRestrictionsManager by Googler <noreply@google.com>
- 245992638 Update branch by Googler <noreply@google.com>
- 246063130 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 246593071 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 247482157 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 247987434 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 248222183 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 248388404 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 249131546 Use compat and design activities from suwlib by Googler <noreply@google.com>
- 249756254 Change layout_bg_color from compat to design by Googler <noreply@google.com>
- 250764060 Fix font size of flat primary toolbar button by Googler <noreply@google.com>
- 250965245 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 252075189 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 257226909 Switch the source of suwlib copybara to master by Googler <noreply@google.com>
- 268000205 Adding the base framework for summary items by Googler <noreply@google.com>
- 268348108 Adding partner receiver and support for partner summary i... by Googler <noreply@google.com>
- 277764643 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 279885434 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 282608634 Cloned from CL 282381070 by 'hg patch'. by Googler <noreply@google.com>
- 286044261 Fix copybara error by Googler <noreply@google.com>
- 286071441 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 286132608 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 286442370 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 288358976 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 289701599 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 290737110 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 292287790 Fix auth page skipping in back navigation by Googler <noreply@google.com>
- 300016651 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 300133358 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 300656416 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 302090065 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 305940109 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 307634480 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 310382429 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 311565631 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 313305744 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 313698394 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 315535915 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 315959991 Cloned from CL 315727994 by 'g4 patch'. by Googler <noreply@google.com>
- 316266894 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 330298307 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 337906805 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 338482062 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 341430274 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 343163937 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 343178332 Automated g4 rollback of changelist 343163937. by Googler <noreply@google.com>
- 343200848 Cloned from CL 343163937 by 'g4 patch'. by Googler <noreply@google.com>
- 343411630 Revert suw_color_primary to @android:color/white by Googler <noreply@google.com>
- 344855452 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 347440796 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 349308312 Migrate android.support.annotation.StringDef to androidx.... by Googler <noreply@google.com>
- 350777602 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 350859474 Strip out DrivingStateMonitor change to create RC by Googler <noreply@google.com>
- 350861544 Automated g4 rollback of changelist 350859474. by Googler <noreply@google.com>
- 351660456 Migrate StyleRes to androidx by Googler <noreply@google.com>
- 352821535 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 353043937 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 353249544 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 353267939 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 355189068 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 357969643 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 362298620 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 362391043 As jinjian as Copybara backup reviewer by Googler <noreply@google.com>
- 363048311 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 363509953 Migrate android.support.annotation.ColorInt by Googler <noreply@google.com>
- 367310733 Migrate annotation classes to androidx by Googler <noreply@google.com>
- 369554055 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 370936923 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 371325323 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 371984637 Migrate android.support.annotation.IntDef to androidx.ann... by Googler <noreply@google.com>
- 373441763 Changes for Car Setup Wizard Support Library: by Googler <noreply@google.com>
- 374241115 Update Copybara config to exclude files for gradle by Googler <noreply@google.com>
(And 32 more changes)
PiperOrigin-RevId: 424165509
Change-Id: I9b5cd03266d4d1242b476e564331a02c6df04be4
12 files changed, 131 insertions, 158 deletions
diff --git a/library/main/AndroidManifest.xml b/library/main/AndroidManifest.xml index fa2034a..e330c33 100644 --- a/library/main/AndroidManifest.xml +++ b/library/main/AndroidManifest.xml @@ -18,6 +18,6 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.car.setupwizardlib"> <uses-sdk - android:minSdkVersion="28" - android:targetSdkVersion="29" /> + android:minSdkVersion="29" + android:targetSdkVersion="31" /> </manifest> diff --git a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardBaseLayout.java b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardBaseLayout.java index 706ce19..4fd1808 100644 --- a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardBaseLayout.java +++ b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardBaseLayout.java @@ -40,15 +40,12 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; - import androidx.annotation.Nullable; import androidx.annotation.StyleRes; import androidx.annotation.VisibleForTesting; - import com.android.car.setupwizardlib.partner.PartnerConfig; import com.android.car.setupwizardlib.partner.PartnerConfigHelper; import com.android.car.setupwizardlib.util.FeatureResolver; - import java.util.Locale; import java.util.Objects; diff --git a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardCompatLayout.java b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardCompatLayout.java index e40d834..72f4f1b 100644 --- a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardCompatLayout.java +++ b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardCompatLayout.java @@ -18,7 +18,6 @@ package com.android.car.setupwizardlib; import android.content.Context; import android.util.AttributeSet; - import androidx.annotation.Nullable; /** diff --git a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardDesignLayout.java b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardDesignLayout.java index 92269f0..c0a1831 100644 --- a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardDesignLayout.java +++ b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardDesignLayout.java @@ -18,9 +18,7 @@ package com.android.car.setupwizardlib; import android.content.Context; import android.util.AttributeSet; - import androidx.annotation.Nullable; - import com.android.car.setupwizardlib.partner.PartnerConfig; import com.android.car.setupwizardlib.partner.PartnerConfigHelper; diff --git a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardLayout.java b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardLayout.java index 19a1923..67bb795 100644 --- a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardLayout.java +++ b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardLayout.java @@ -38,14 +38,11 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; - import androidx.annotation.Nullable; import androidx.annotation.StyleRes; import androidx.annotation.VisibleForTesting; - import com.android.car.setupwizardlib.partner.PartnerConfig; import com.android.car.setupwizardlib.partner.PartnerConfigHelper; - import java.util.Locale; import java.util.Objects; diff --git a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardLayoutInterface.java b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardLayoutInterface.java index 89d437f..7126560 100644 --- a/library/main/src/com/android/car/setupwizardlib/CarSetupWizardLayoutInterface.java +++ b/library/main/src/com/android/car/setupwizardlib/CarSetupWizardLayoutInterface.java @@ -17,7 +17,6 @@ package com.android.car.setupwizardlib; import android.view.View; import android.widget.Button; - import androidx.annotation.Nullable; /** diff --git a/library/main/src/com/android/car/setupwizardlib/partner/PartnerConfigHelper.java b/library/main/src/com/android/car/setupwizardlib/partner/PartnerConfigHelper.java index dfb134f..093961b 100644 --- a/library/main/src/com/android/car/setupwizardlib/partner/PartnerConfigHelper.java +++ b/library/main/src/com/android/car/setupwizardlib/partner/PartnerConfigHelper.java @@ -27,12 +27,10 @@ import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.util.TypedValue; - import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; - import java.util.EnumMap; /** The helper reads and caches the partner configurations from Car Setup Wizard. */ diff --git a/library/main/src/com/android/car/setupwizardlib/partner/ResourceEntry.java b/library/main/src/com/android/car/setupwizardlib/partner/ResourceEntry.java index 6d5d39b..456f1e6 100644 --- a/library/main/src/com/android/car/setupwizardlib/partner/ResourceEntry.java +++ b/library/main/src/com/android/car/setupwizardlib/partner/ResourceEntry.java @@ -18,7 +18,6 @@ package com.android.car.setupwizardlib.partner; import android.content.pm.PackageManager; import android.os.Bundle; - import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; diff --git a/library/main/src/com/android/car/setupwizardlib/summary/PartnerSummaryActionsCollector.java b/library/main/src/com/android/car/setupwizardlib/summary/PartnerSummaryActionsCollector.java index 9b89308..84842f3 100644 --- a/library/main/src/com/android/car/setupwizardlib/summary/PartnerSummaryActionsCollector.java +++ b/library/main/src/com/android/car/setupwizardlib/summary/PartnerSummaryActionsCollector.java @@ -27,9 +27,7 @@ import android.net.Uri; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; - import androidx.annotation.Nullable; - import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; diff --git a/library/main/src/com/android/car/setupwizardlib/util/CarDrivingStateMonitor.java b/library/main/src/com/android/car/setupwizardlib/util/CarDrivingStateMonitor.java index c58e352..9528502 100644 --- a/library/main/src/com/android/car/setupwizardlib/util/CarDrivingStateMonitor.java +++ b/library/main/src/com/android/car/setupwizardlib/util/CarDrivingStateMonitor.java @@ -33,13 +33,12 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.util.Log; - import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; /** * Monitor that listens for changes in the driving state so that it can trigger an exit of the - * setup wizard when {@link CarUxRestrictions.UX_RESTRICTIONS_NO_SETUP} + * setup wizard when {@link CarUxRestrictions#UX_RESTRICTIONS_NO_SETUP} * is active. */ public class CarDrivingStateMonitor implements diff --git a/library/main/src/com/android/car/setupwizardlib/util/CarHelperRegistry.java b/library/main/src/com/android/car/setupwizardlib/util/CarHelperRegistry.java index 01447aa..148ba32 100644 --- a/library/main/src/com/android/car/setupwizardlib/util/CarHelperRegistry.java +++ b/library/main/src/com/android/car/setupwizardlib/util/CarHelperRegistry.java @@ -17,11 +17,9 @@ package com.android.car.setupwizardlib.util; import android.content.Context; - import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; - import java.util.concurrent.ConcurrentHashMap; /** A registry of singleton-like helpers, which can be injected by the application for testing. */ 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 ff83b55..8f67220 100644 --- a/library/main/src/com/android/car/setupwizardlib/util/CarWizardManagerHelper.java +++ b/library/main/src/com/android/car/setupwizardlib/util/CarWizardManagerHelper.java @@ -20,153 +20,144 @@ import android.content.Context; import android.content.Intent; import android.provider.Settings; -/** - * <p>Derived from {@code com.android.setupwizardlib/WizardManagerHelper.java} - */ +/** Derived from {@code com.android.setupwizardlib/WizardManagerHelper.java} */ public final class CarWizardManagerHelper { - public static final String EXTRA_WIZARD_BUNDLE = "wizardBundle"; - public static final String EXTRA_IS_FIRST_RUN = "firstRun"; - public static final String EXTRA_IS_DEALER = "dealer"; - public static final String EXTRA_IS_DEFERRED_SETUP = "deferredSetup"; - private static final String ACTION_NEXT = "com.android.wizard.NEXT"; - private static final String EXTRA_RESULT_CODE = "com.android.setupwizard.ResultCode"; - - private CarWizardManagerHelper() { - } + public static final String EXTRA_WIZARD_BUNDLE = "wizardBundle"; + public static final String EXTRA_IS_FIRST_RUN = "firstRun"; + public static final String EXTRA_IS_DEALER = "dealer"; + public static final String EXTRA_IS_DEFERRED_SETUP = "deferredSetup"; + private static final String ACTION_NEXT = "com.android.wizard.NEXT"; + private static final String EXTRA_RESULT_CODE = "com.android.setupwizard.ResultCode"; - /** - * Get an intent that will invoke the next step of setup wizard. - * - * @param originalIntent The original intent that was used to start the step, usually via - * {@link android.app.Activity#getIntent()}. - * @param resultCode The result code of the step. See {@link ResultCodes}. - * @return A new intent that can be used with - * {@link android.app.Activity#startActivityForResult(Intent, int)} to start the next - * step of the setup flow. - */ - public static Intent getNextIntent(Intent originalIntent, int resultCode) { - return getNextIntent(originalIntent, resultCode, null); - } + private CarWizardManagerHelper() {} - /** - * Get an intent that will invoke the next step of setup wizard. - * - * @param originalIntent The original intent that was used to start the step, usually via - * {@link android.app.Activity#getIntent()}. - * @param resultCode The result code of the step. See {@link ResultCodes}. - * @param data An intent containing extra result data. - * @return A new intent that can be used with - * {@link android.app.Activity#startActivityForResult(Intent, int)} to start the next - * step of the setup flow. - */ - public static Intent getNextIntent(Intent originalIntent, int resultCode, Intent data) { - Intent intent = new Intent(ACTION_NEXT); - copyWizardManagerExtras(originalIntent, intent); - intent.putExtra(EXTRA_RESULT_CODE, resultCode); - if (data != null && data.getExtras() != null) { - intent.putExtras(data.getExtras()); - } + /** + * Get an intent that will invoke the next step of setup wizard. + * + * @param originalIntent The original intent that was used to start the step, usually via {@link + * android.app.Activity#getIntent()}. + * @param resultCode The result code of the step. See {@link ResultCodes}. + * @return A new intent that can be used with {@link + * android.app.Activity#startActivityForResult(Intent, int)} to start the next step of the + * setup flow. + */ + public static Intent getNextIntent(Intent originalIntent, int resultCode) { + return getNextIntent(originalIntent, resultCode, null); + } - return intent; + /** + * Get an intent that will invoke the next step of setup wizard. + * + * @param originalIntent The original intent that was used to start the step, usually via {@link + * android.app.Activity#getIntent()}. + * @param resultCode The result code of the step. See {@link ResultCodes}. + * @param data An intent containing extra result data. + * @return A new intent that can be used with {@link + * android.app.Activity#startActivityForResult(Intent, int)} to start the next step of the + * setup flow. + */ + public static Intent getNextIntent(Intent originalIntent, int resultCode, Intent data) { + Intent intent = new Intent(ACTION_NEXT); + copyWizardManagerExtras(originalIntent, intent); + intent.putExtra(EXTRA_RESULT_CODE, resultCode); + if (data != null && data.getExtras() != null) { + intent.putExtras(data.getExtras()); } - /** - * Copy the internal extras used by setup wizard from one intent to another. For low-level use - * only, such as when using {@link Intent#FLAG_ACTIVITY_FORWARD_RESULT} to relay to another - * intent. - * - * @param srcIntent Intent to get the wizard manager extras from. - * @param dstIntent Intent to copy the wizard manager extras to. - */ - public static void copyWizardManagerExtras(Intent srcIntent, Intent dstIntent) { - dstIntent.putExtra(EXTRA_WIZARD_BUNDLE, srcIntent.getBundleExtra(EXTRA_WIZARD_BUNDLE)); - dstIntent.putExtra(EXTRA_IS_FIRST_RUN, - srcIntent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false)); - dstIntent.putExtra(EXTRA_IS_DEALER, - srcIntent.getBooleanExtra(EXTRA_IS_DEALER, false)); - dstIntent.putExtra(EXTRA_IS_DEFERRED_SETUP, - srcIntent.getBooleanExtra(EXTRA_IS_DEFERRED_SETUP, false)); - } + return intent; + } - /** - * Check whether an intent is intended to be used within the setup wizard flow. - * - * @param intent The intent to be checked, usually from - * {@link android.app.Activity#getIntent()}. - * @return true if the intent passed in was intended to be used with setup wizard. - */ - public static boolean isSetupWizardIntent(Intent intent) { - return intent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false); - } + /** + * Copy the internal extras used by setup wizard from one intent to another. For low-level use + * only, such as when using {@link Intent#FLAG_ACTIVITY_FORWARD_RESULT} to relay to another + * intent. + * + * @param srcIntent Intent to get the wizard manager extras from. + * @param dstIntent Intent to copy the wizard manager extras to. + */ + public static void copyWizardManagerExtras(Intent srcIntent, Intent dstIntent) { + dstIntent.putExtra(EXTRA_WIZARD_BUNDLE, srcIntent.getBundleExtra(EXTRA_WIZARD_BUNDLE)); + dstIntent.putExtra(EXTRA_IS_FIRST_RUN, srcIntent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false)); + dstIntent.putExtra(EXTRA_IS_DEALER, srcIntent.getBooleanExtra(EXTRA_IS_DEALER, false)); + dstIntent.putExtra( + EXTRA_IS_DEFERRED_SETUP, srcIntent.getBooleanExtra(EXTRA_IS_DEFERRED_SETUP, false)); + } - /** - * Checks whether an intent is running in the deferred setup wizard flow. - * - * @param intent The intent to be checked, usually from - * {@link android.app.Activity#getIntent()}. - * @return true if the intent passed in was running in deferred setup wizard. - */ - public static boolean isDeferredIntent(Intent intent) { - return intent.getBooleanExtra(EXTRA_IS_DEFERRED_SETUP, false); - } + /** + * Check whether an intent is intended to be used within the setup wizard flow. + * + * @param intent The intent to be checked, usually from {@link android.app.Activity#getIntent()}. + * @return true if the intent passed in was intended to be used with setup wizard. + */ + public static boolean isSetupWizardIntent(Intent intent) { + return intent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false); + } - /** - * Check whether an intent is intended for the dealer. - * - * @param intent The intent to be checked, usually from - * {@link android.app.Activity#getIntent()}. - * @return true if the intent passed in was intended to be used with setup wizard. - */ - public static boolean isDealerIntent(Intent intent) { - return intent.getBooleanExtra(EXTRA_IS_DEALER, false); - } + /** + * Checks whether an intent is running in the deferred setup wizard flow. + * + * @param intent The intent to be checked, usually from {@link android.app.Activity#getIntent()}. + * @return true if the intent passed in was running in deferred setup wizard. + */ + public static boolean isDeferredIntent(Intent intent) { + return intent.getBooleanExtra(EXTRA_IS_DEFERRED_SETUP, false); + } - /** - * Checks whether the current user has completed Setup Wizard. This is true if the current user - * has gone through Setup Wizard. The current user may or may not be the device owner and the - * device owner may have already completed setup wizard. - * - * @param context The context to retrieve the settings. - * @return true if the current user has completed Setup Wizard. - * @see #isDeviceProvisioned(Context) - */ - public static boolean isUserSetupComplete(Context context) { - return Settings.Secure.getInt(context.getContentResolver(), - Settings.Secure.USER_SETUP_COMPLETE, 0) == 1; - } + /** + * Check whether an intent is intended for the dealer. + * + * @param intent The intent to be checked, usually from {@link android.app.Activity#getIntent()}. + * @return true if the intent passed in was intended to be used with setup wizard. + */ + public static boolean isDealerIntent(Intent intent) { + return intent.getBooleanExtra(EXTRA_IS_DEALER, false); + } - /** - * Checks whether the device is provisioned. This means that the device has gone through Setup - * Wizard at least once. Note that the user can still be in Setup Wizard even if this is true, - * for a secondary user profile triggered through Settings > Add account. - * - * @param context The context to retrieve the settings. - * @return true if the device is provisioned. - * @see #isUserSetupComplete(Context) - */ - public static boolean isDeviceProvisioned(Context context) { - 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 the current user has completed Setup Wizard. This is true if the current user + * has gone through Setup Wizard. The current user may or may not be the device owner and the + * device owner may have already completed setup wizard. + * + * @param context The context to retrieve the settings. + * @return true if the current user has completed Setup Wizard. + * @see #isDeviceProvisioned(Context) + */ + public static boolean isUserSetupComplete(Context context) { + return Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0) == 1; + } - /** - * 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); - } + /** + * Checks whether the device is provisioned. This means that the device has gone through Setup + * Wizard at least once. Note that the user can still be in Setup Wizard even if this is true, for + * a secondary user profile triggered through Settings > Add account. + * + * @param context The context to retrieve the settings. + * @return true if the device is provisioned. + * @see #isUserSetupComplete(Context) + */ + public static boolean isDeviceProvisioned(Context context) { + 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 android.app.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 + * android.app.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); + } } |