• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.android.onboarding.contracts.setupwizard
2 
3 import android.os.Bundle
4 
5 /**
6  * Marker interface to keep track of all our contract arguments that either directly or indirectly
7  * depend on [SuwArguments]
8  */
9 interface WithSuwArguments : WithOptionalSuwArguments {
10   override val suwArguments: SuwArguments
11 }
12 
13 /**
14  * Marker interface to keep track of all our contract arguments that optionally either directly or
15  * indirectly depend on [SuwArguments]
16  */
17 interface WithOptionalSuwArguments {
18   val suwArguments: SuwArguments?
19 }
20 
21 /**
22  * A set of common arguments passed around to other processes during setup.
23  *
24  * @property isSuwSuggestedActionFlow Notifying an activity that was called from suggested action
25  *   activity.
26  * @property isSetupFlow Notifying an Activity that it is inside the any setup flow
27  * @property preDeferredSetup Notifying an Activity that it is inside the "Pre-Deferred Setup" flow
28  * @property deferredSetup Notifying an Activity that it is inside the Deferred SetupWizard flow or
29  *   not
30  * @property firstRun Notifying an Activity that it is inside the first SetupWizard flow or not
31  * @property portalSetup Notifying an Activity that it is inside the "Portal Setup" flow
32  * @property wizardBundle Parcelable extra containing the internal reference for an intent
33  *   dispatched by Wizard Manager
34  * @property theme Decide which theme should be used in the onboarding flow
35  * @property hasMultipleUsers show additional info regarding the use of a device with multiple users
36  * @property isSubactivityFirstLaunched Return true if the ActivityWrapper is Created and not start
37  *   SubActivity yet
38  */
39 interface SuwArguments {
40   val isSuwSuggestedActionFlow: Boolean
41   val isSetupFlow: Boolean
42   val preDeferredSetup: Boolean
43   val deferredSetup: Boolean
44   val firstRun: Boolean
45   val portalSetup: Boolean
46   val wizardBundle: Bundle
47   val theme: String
48   val hasMultipleUsers: Boolean?
49   val isSubactivityFirstLaunched: Boolean?
50 
51   companion object {
52     @JvmStatic
53     @JvmName("of")
invokenull54     operator fun invoke(
55       isSuwSuggestedActionFlow: Boolean,
56       isSetupFlow: Boolean,
57       preDeferredSetup: Boolean,
58       deferredSetup: Boolean,
59       firstRun: Boolean,
60       portalSetup: Boolean,
61       wizardBundle: Bundle,
62       theme: String,
63       hasMultipleUsers: Boolean?,
64       isSubactivityFirstLaunched: Boolean?,
65     ): SuwArguments =
66       object : SuwArguments {
67         override val isSuwSuggestedActionFlow = isSuwSuggestedActionFlow
68         override val isSetupFlow = isSetupFlow
69         override val preDeferredSetup = preDeferredSetup
70         override val deferredSetup = deferredSetup
71         override val firstRun = firstRun
72         override val portalSetup = portalSetup
73         override val wizardBundle = wizardBundle
74         override val theme = theme
75         override val hasMultipleUsers = hasMultipleUsers
76         override val isSubactivityFirstLaunched = isSubactivityFirstLaunched
77       }
78   }
79 }
80