library/src/main/java/com/okta/oidc/OktaAuthenticationActivity.java
/**
     * Create browser intent intent.
     *
     * @param packageName the package name
     * @param session     the session
     * @return the intent
     */
Create browser intent intent.
@param packageName the package name
@param session     the session
@return the intent
Create browser intent intent . @param packageName the package name @param session the session @return the intent
@VisibleForTesting
    protected Intent createBrowserIntent(String packageName, CustomTabsSession session) {
        CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder(session);
        if (mCustomTabOptions != null) {
            if (mCustomTabOptions.getCustomTabColor() != 0) {
                intentBuilder.setToolbarColor(mCustomTabOptions.getCustomTabColor());
            }
            if (mCustomTabOptions.getStartExitResId() != 0 &&
                    mCustomTabOptions.getStartEnterResId() != 0) {
                intentBuilder.setStartAnimations(this,
                        mCustomTabOptions.getStartEnterResId(),
                        mCustomTabOptions.getStartExitResId());
                overridePendingTransition(mCustomTabOptions.getStartEnterResId(),
                        mCustomTabOptions.getStartExitResId());
            }
            if (mCustomTabOptions.getEndEnterResId() != 0 &&
                    mCustomTabOptions.getEndExitResId() != 0) {
                intentBuilder.setExitAnimations(this, mCustomTabOptions.getEndEnterResId(),
                        mCustomTabOptions.getEndExitResId());
            }
        }
        CustomTabsIntent tabsIntent = intentBuilder.build();
        tabsIntent.intent.setPackage(packageName);
        tabsIntent.intent.setData(mAuthUri);
        Bundle headers = new Bundle();
        headers.putString(X_OKTA_USER_AGENT, USER_AGENT_HEADER);
        tabsIntent.intent.putExtra(Browser.EXTRA_HEADERS, headers);
        return tabsIntent.intent;
    }
@ VisibleForTesting protected Intent createBrowserIntent ( String packageName , CustomTabsSession session ) { CustomTabsIntent . Builder intentBuilder = new CustomTabsIntent . Builder ( session ) ; if ( mCustomTabOptions != null ) { if ( mCustomTabOptions . getCustomTabColor ( ) != 0 ) { intentBuilder . setToolbarColor ( mCustomTabOptions . getCustomTabColor ( ) ) ; } if ( mCustomTabOptions . getStartExitResId ( ) != 0 && mCustomTabOptions . getStartEnterResId ( ) != 0 ) { intentBuilder . setStartAnimations ( this , mCustomTabOptions . getStartEnterResId ( ) , mCustomTabOptions . getStartExitResId ( ) ) ; overridePendingTransition ( mCustomTabOptions . getStartEnterResId ( ) , mCustomTabOptions . getStartExitResId ( ) ) ; } if ( mCustomTabOptions . getEndEnterResId ( ) != 0 && mCustomTabOptions . getEndExitResId ( ) != 0 ) { intentBuilder . setExitAnimations ( this , mCustomTabOptions . getEndEnterResId ( ) , mCustomTabOptions . getEndExitResId ( ) ) ; } } CustomTabsIntent tabsIntent = intentBuilder . build ( ) ; tabsIntent . intent . setPackage ( packageName ) ; tabsIntent . intent . setData ( mAuthUri ) ; Bundle headers = new Bundle ( ) ; headers . putString ( X_OKTA_USER_AGENT , USER_AGENT_HEADER ) ; tabsIntent . intent . putExtra ( Browser . EXTRA_HEADERS , headers ) ; return tabsIntent . intent ; }
Create browser intent intent.
Create browser intent intent .