Skip to content

Settings Download

SettingsDownloadStep gets the policy data required for the initialization of the secure store and logging.

This step executes the same logic for both the onboard and the restore scenarios.

(The iOS equivalent is SAPcpmsSettingsDownloadStep.swift.)

Input Parameters

Mandatory input parameters:

  • onboardingParameters – Provided typically by the WelcomeScreenStep.

  • okHttpClient – Provided by one of the authentication steps or by the app developer at startup.

  • context – Specifies the android context initiating the flow such as the caller Activity. This setting has to be provided on the initial FlowContext.

Output Parameters

  • clientPolicy – This step initializes the client policy on the flowContext. The client policy encapsulates the UI layer's PasscodePolicy object in addition to the logging policy.

Using SettingsDownloadStep

  1. Set the Context and the okHttpClient in the flowContext.

    1
    2
       flowContext.setContext(callerActivity);
       flowContext.setOkHttpClient(okHttpClient);
    
  2. Initiate the step:

    ```java SettingsDownloadStep settingsDownloadStep = new SettingsDownloadStep();

    ```

  3. Specify the execute method's FlowActionHandler parameter's "onFailure" and "onSuccess" behaviour:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
        flowManagerService.execute(flow, flowContext, new FlowActionHandler() {
            @Override
            public void onFailure(Throwable t) {
                //set the status, update the caller activity
            }
    
            @Override
            public void onSuccess(FlowContext result) {
                //set the status, update the caller activity
                //read the result
            }
        });
    

Behaviour of SettingsDownloadStep

This step uses the foundation layer's settings object to download the policies. After downloading the policy data, it is written to the flowContext.