diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 7689b11..a08d028 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3036,7 +3036,14 @@
         </provider>
 
         <activity
-            android:name=".wifi.dpp.WifiDppConfiguratorActivity"/>
+            android:name=".wifi.dpp.WifiDppConfiguratorActivity">
+            <intent-filter>
+                <action android:name="android.settings.WIFI_DPP_CONFIGURATOR_QR_CODE_SCANNER"/>
+                <action android:name="android.settings.WIFI_DPP_CONFIGURATOR_QR_CODE_GENERATOR"/>
+                <action android:name="android.settings.WIFI_DPP_CONFIGURATOR_CHOOSE_SAVED_WIFI_NETWORK"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+        </activity>
 
         <activity android:name=".homepage.contextualcards.ContextualCardFeedbackDialog"
                   android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert" />
diff --git a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
index 72fa7fe..d81c19b 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
@@ -18,6 +18,7 @@
 
 import android.app.ActionBar;
 import android.app.Activity;
+import android.content.Intent;
 import android.os.Bundle;
 import android.util.Log;
 
@@ -30,32 +31,22 @@
 import com.android.settings.core.InstrumentedActivity;
 import com.android.settings.R;
 
-public class WifiDppConfiguratorActivity extends InstrumentedActivity {
+public class WifiDppConfiguratorActivity extends InstrumentedActivity implements
+        WifiNetworkConfig.Retriever {
     private static final String TAG = "WifiDppConfiguratorActivity";
 
+    public static final String ACTION_CONFIGURATOR_QR_CODE_SCANNER =
+            "android.settings.WIFI_DPP_CONFIGURATOR_QR_CODE_SCANNER";
+    public static final String ACTION_CONFIGURATOR_QR_CODE_GENERATOR =
+            "android.settings.WIFI_DPP_CONFIGURATOR_QR_CODE_GENERATOR";
+    public static final String ACTION_CONFIGURATOR_CHOOSE_SAVED_WIFI_NETWORK =
+            "android.settings.WIFI_DPP_CONFIGURATOR_CHOOSE_SAVED_WIFI_NETWORK";
+
     private FragmentManager mFragmentManager;
     private FragmentTransaction mFragmentTransaction;
 
-    public static final String EXTRA_LAUNCH_MODE =
-            "com.android.settings.wifi.dpp.EXTRA_LAUNCH_MODE";
-    public static final String EXTRA_SSID = "com.android.settings.wifi.dpp.EXTRA_SSID";
-
-    public enum LaunchMode {
-        LAUNCH_MODE_QR_CODE_SCANNER(1),
-        LAUNCH_MODE_QR_CODE_GENERATOR(2),
-        LAUNCH_MODE_CHOOSE_SAVED_WIFI_NETWORK(3),
-        LAUNCH_MODE_NOT_DEFINED(-1);
-
-        private int mMode;
-
-        LaunchMode(int mode) {
-            this.mMode = mode;
-        }
-
-        public int getMode() {
-            return mMode;
-        }
-    }
+    /** The Wi-Fi network which will be configured */
+    private WifiNetworkConfig mWifiNetworkConfig;
 
     @Override
     public int getMetricsCategory() {
@@ -71,37 +62,59 @@
         mFragmentManager = getSupportFragmentManager();
         mFragmentTransaction = getSupportFragmentManager().beginTransaction();
 
-        final int launchMode = getIntent().getIntExtra(EXTRA_LAUNCH_MODE,
-            LaunchMode.LAUNCH_MODE_NOT_DEFINED.getMode());
-        if (launchMode == LaunchMode.LAUNCH_MODE_QR_CODE_SCANNER.getMode()) {
-            addQrCodeScannerFragment();
-        } else if (launchMode == LaunchMode.LAUNCH_MODE_QR_CODE_GENERATOR.getMode()) {
-            addQrCodeGeneratorFragment();
-        } else if (launchMode == LaunchMode.LAUNCH_MODE_CHOOSE_SAVED_WIFI_NETWORK.getMode()) {
-            addChooseSavedWifiNetworkFragment();
-        } else {
-            Log.e(TAG, "Launch with an invalid mode extra");
+        Intent intent = getIntent();
+        boolean cancelActivity = false;
+        WifiNetworkConfig config;
+        switch (intent.getAction()) {
+            case ACTION_CONFIGURATOR_QR_CODE_SCANNER:
+                config = WifiNetworkConfig.getValidConfigOrNull(intent);
+                if (config == null) {
+                    cancelActivity = true;
+                } else {
+                    mWifiNetworkConfig = config;
+                    addQrCodeScannerFragment(/* addToBackStack= */ false);
+                }
+                break;
+            case ACTION_CONFIGURATOR_QR_CODE_GENERATOR:
+                config = WifiNetworkConfig.getValidConfigOrNull(intent);
+                if (config == null) {
+                    cancelActivity = true;
+                } else {
+                    mWifiNetworkConfig = config;
+                    addQrCodeGeneratorFragment();
+                }
+                break;
+            case ACTION_CONFIGURATOR_CHOOSE_SAVED_WIFI_NETWORK:
+                addChooseSavedWifiNetworkFragment(/* addToBackStack */ false);
+                break;
+            default:
+                cancelActivity = true;
+                Log.e(TAG, "Launch with an invalid action");
+        }
+
+        if (cancelActivity) {
             setResult(Activity.RESULT_CANCELED);
             finish();
         }
     }
 
-    private void addQrCodeScannerFragment() {
-        final WifiDppQrCodeScannerFragment fragment = new WifiDppQrCodeScannerFragment();
+    private void addQrCodeScannerFragment(boolean addToBackStack) {
+        WifiDppQrCodeScannerFragment fragment = new WifiDppQrCodeScannerFragment();
         mFragmentTransaction.add(R.id.fragment_container, fragment);
-        mFragmentTransaction.addToBackStack(/* name */ null);
+        if (addToBackStack) {
+            mFragmentTransaction.addToBackStack(/* name */ null);
+        }
         mFragmentTransaction.commit();
     }
 
     private void addQrCodeGeneratorFragment() {
-        final WifiDppQrCodeGeneratorFragment fragment = new WifiDppQrCodeGeneratorFragment();
+        WifiDppQrCodeGeneratorFragment fragment = new WifiDppQrCodeGeneratorFragment();
         mFragmentTransaction.add(R.id.fragment_container, fragment);
-        mFragmentTransaction.addToBackStack(/* name */ null);
         mFragmentTransaction.commit();
     }
 
-    private void addChooseSavedWifiNetworkFragment() {
-        final ActionBar action = getActionBar();
+    private void addChooseSavedWifiNetworkFragment(boolean addToBackStack) {
+        ActionBar action = getActionBar();
         if (action != null) {
             action.hide();
         }
@@ -109,13 +122,15 @@
         WifiDppChooseSavedWifiNetworkFragment fragment =
                 new WifiDppChooseSavedWifiNetworkFragment();
         mFragmentTransaction.add(R.id.fragment_container, fragment);
-        mFragmentTransaction.addToBackStack(/* name */ null);
+        if (addToBackStack) {
+            mFragmentTransaction.addToBackStack(/* name */ null);
+        }
         mFragmentTransaction.commit();
     }
 
     @Override
     protected void onStop() {
-        final Fragment fragment = mFragmentManager.findFragmentById(R.id.fragment_container);
+        Fragment fragment = mFragmentManager.findFragmentById(R.id.fragment_container);
         if (fragment != null) {
             // Remove it to prevent stacking multiple fragments after screen rotated.
             mFragmentManager.beginTransaction().remove(fragment).commit();
@@ -123,4 +138,19 @@
 
         super.onStop();
     }
+
+    @Override
+    public WifiNetworkConfig getWifiNetworkConfig() {
+        return mWifiNetworkConfig;
+    }
+
+    @Override
+    public boolean setWifiNetworkConfig(WifiNetworkConfig config) {
+        if(!WifiNetworkConfig.isValidConfig(config)) {
+            return false;
+        } else {
+            mWifiNetworkConfig = new WifiNetworkConfig(config);
+            return true;
+        }
+    }
 }
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeBaseFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeBaseFragment.java
index 0d30a79..c86fc98 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeBaseFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeBaseFragment.java
@@ -30,6 +30,7 @@
 import com.android.internal.logging.nano.MetricsProto;
 
 import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.wifi.qrcode.QrDecorateView;
 import com.android.settings.R;
 
 /**
@@ -46,7 +47,7 @@
     private TextView mDescription;
 
     private SurfaceView mPreviewView;       //optional, for WifiDppQrCodeScannerFragment
-    private ImageView mDecorateViiew;       //optional, for WifiDppQrCodeScannerFragment
+    private QrDecorateView mDecorateViiew;  //optional, for WifiDppQrCodeScannerFragment
     private TextView mErrorMessage;         //optional, for WifiDppQrCodeScannerFragment
 
     private ImageView mBarcodeView;         //optional, for WifiDppQrCodeGeneratorFragment
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
index 3e4ac61..70dade5 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
@@ -49,15 +49,12 @@
 
         setTitle(getString(R.string.wifi_dpp_add_device_to_network));
 
-        String ssid = null;
-        final Intent intent = getActivity().getIntent();
-        if (intent != null) {
-            ssid = intent.getStringExtra(WifiDppConfiguratorActivity.EXTRA_SSID);
+        WifiNetworkConfig wifiNetworkConfig = ((WifiNetworkConfig.Retriever) getActivity())
+                .getWifiNetworkConfig();
+        if (!WifiNetworkConfig.isValidConfig(wifiNetworkConfig)) {
+            throw new IllegalArgumentException("Invalid Wi-Fi network for configuring");
         }
-        if (TextUtils.isEmpty(ssid)) {
-            throw new IllegalArgumentException("Invalid SSID");
-        }
-        setDescription(getString(R.string.wifi_dpp_center_qr_code, ssid));
+        setDescription(getString(R.string.wifi_dpp_center_qr_code, wifiNetworkConfig.getSsid()));
 
         hideRightButton();
 
diff --git a/src/com/android/settings/wifi/dpp/WifiDppUtils.java b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
new file mode 100644
index 0000000..70ef3a8
--- /dev/null
+++ b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.wifi.dpp;
+
+import android.content.Intent;
+
+/**
+ * Here are the items shared by both WifiDppConfiguratorActivity & WifiDppEnrolleeActivity
+ */
+public class WifiDppUtils {
+    /** The data is from {@code com.android.settingslib.wifi.AccessPoint.securityToString} */
+    public static final String EXTRA_WIFI_SECURITY = "security";
+
+    /** The data corresponding to {@code WifiConfiguration} SSID */
+    public static final String EXTRA_WIFI_SSID = "ssid";
+
+    /** The data corresponding to {@code WifiConfiguration} preSharedKey */
+    public static final String EXTRA_WIFI_PRE_SHARED_KEY = "preSharedKey";
+
+    /** The data corresponding to {@code WifiConfiguration} hiddenSSID */
+    public static final String EXTRA_WIFI_HIDDEN_SSID = "hiddenSsid";
+
+    /**
+     * Acceptable QR code string may be a standard W-Fi DPP bootstrapping information or the Wi-Fi
+     * Network config format described in
+     * https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11
+     *
+     * Wi-Fi Network config format example:
+     *
+     *     WIFI:T:WPA;S:mynetwork;P:mypass;;
+     *
+     * parameter Example    Description
+     * T         WPA        Authentication type; can be WEP or WPA, or 'nopass' for no password. Or,
+     *                      omit for no password.
+     * S         mynetwork  Network SSID. Required. Enclose in double quotes if it is an ASCII name,
+     *                      but could be interpreted as hex (i.e. "ABCD")
+     * P         mypass     Password, ignored if T is "nopass" (in which case it may be omitted).
+     *                      Enclose in double quotes if it is an ASCII name, but could be interpreted as
+     *                      hex (i.e. "ABCD")
+     * H         true       Optional. True if the network SSID is hidden.
+     */
+    public static final String EXTRA_QR_CODE = "qrCode";
+}
diff --git a/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java b/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java
new file mode 100644
index 0000000..439de98
--- /dev/null
+++ b/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.wifi.dpp;
+
+import android.content.Intent;
+import android.text.TextUtils;
+
+/**
+ * Contains the Wi-Fi Network config parameters described in
+ * https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11
+ *
+ * Checks below members of {@code WifiDppUtils} for more information.
+ * EXTRA_WIFI_SECURITY / EXTRA_WIFI_SSID / EXTRA_WIFI_PRE_SHARED_KEY / EXTRA_WIFI_HIDDEN_SSID /
+ * EXTRA_QR_CODE
+ */
+public class WifiNetworkConfig {
+    private String mSecurity;
+    private String mSsid;
+    private String mPreSharedKey;
+    private boolean mHiddenSsid;
+
+    private WifiNetworkConfig(String security, String ssid, String preSharedKey,
+            boolean hiddenSsid) {
+        mSecurity = security;
+        mSsid = ssid;
+        mPreSharedKey = preSharedKey;
+        mHiddenSsid = hiddenSsid;
+    }
+
+    public WifiNetworkConfig(WifiNetworkConfig config) {
+        mSecurity = new String(config.mSecurity);
+        mSsid = new String(config.mSsid);
+        mPreSharedKey = new String(config.mPreSharedKey);
+        mHiddenSsid = config.mHiddenSsid;
+    }
+
+    /**
+     * Wi-Fi DPP activities should implement this interface for fragments to retrieve the
+     * WifiNetworkConfig for configuration
+     */
+    public interface Retriever {
+        public WifiNetworkConfig getWifiNetworkConfig();
+        public boolean setWifiNetworkConfig(WifiNetworkConfig config);
+    }
+
+    /**
+     * Retrieve WifiNetworkConfig from below 2 intents
+     *
+     * android.settings.WIFI_DPP_CONFIGURATOR_QR_CODE_GENERATOR
+     * android.settings.WIFI_DPP_CONFIGURATOR_QR_CODE_SCANNER
+     */
+    public static WifiNetworkConfig getValidConfigOrNull(Intent intent) {
+        String security = intent.getStringExtra(WifiDppUtils.EXTRA_WIFI_SECURITY);
+        String ssid = intent.getStringExtra(WifiDppUtils.EXTRA_WIFI_SSID);
+        String preSharedKey = intent.getStringExtra(WifiDppUtils.EXTRA_WIFI_PRE_SHARED_KEY);
+        boolean hiddenSsid = intent.getBooleanExtra(WifiDppUtils.EXTRA_WIFI_HIDDEN_SSID, false);
+
+        if (!isValidConfig(security, ssid, hiddenSsid)) {
+            return null;
+        }
+
+        if (ssid == null) {
+            ssid = "";
+        }
+
+        return new WifiNetworkConfig(security, ssid, preSharedKey, hiddenSsid);
+    }
+
+    public static boolean isValidConfig(WifiNetworkConfig config) {
+        if (config == null) {
+            return false;
+        } else {
+            return isValidConfig(config.mSecurity, config.mSsid, config.mHiddenSsid);
+        }
+    }
+
+    public static boolean isValidConfig(String security, String ssid, boolean hiddenSsid) {
+        if (TextUtils.isEmpty(security)) {
+            return false;
+        }
+
+        if (!hiddenSsid && TextUtils.isEmpty(ssid)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    public String getSecurity() {
+        return new String(mSecurity);
+    }
+
+    public String getSsid() {
+        return new String(mSsid);
+    }
+
+    public String getPreSharedKey() {
+        return new String(mPreSharedKey);
+    }
+
+    public boolean getHiddenSsid() {
+        return mHiddenSsid;
+    }
+}
diff --git a/tests/unit/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivityTest.java b/tests/unit/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivityTest.java
index 208c344..70e9587 100644
--- a/tests/unit/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivityTest.java
+++ b/tests/unit/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivityTest.java
@@ -35,43 +35,42 @@
             new ActivityTestRule<>(WifiDppConfiguratorActivity.class);
 
     @Test
-    public void launchActivity_modeQrCodeScanner_shouldNotAutoFinish() {
-        Intent intent = new Intent();
-        intent.putExtra(WifiDppConfiguratorActivity.EXTRA_LAUNCH_MODE,
-                WifiDppConfiguratorActivity.LaunchMode.LAUNCH_MODE_QR_CODE_SCANNER.getMode());
+    public void launchActivity_qrCodeScanner_shouldNotAutoFinish() {
+        Intent intent = new Intent(WifiDppConfiguratorActivity.ACTION_CONFIGURATOR_QR_CODE_SCANNER);
+        intent.putExtra(WifiDppUtils.EXTRA_WIFI_SECURITY, "WEP");
+        intent.putExtra(WifiDppUtils.EXTRA_WIFI_SSID, "GoogleGuest");
+
         mActivityRule.launchActivity(intent);
 
         assertThat(mActivityRule.getActivity().isFinishing()).isEqualTo(false);
     }
 
     @Test
-    public void launchActivity_modeQrCodeGenerator_shouldNotAutoFinish() {
-        Intent intent = new Intent();
-        intent.putExtra(WifiDppConfiguratorActivity.EXTRA_LAUNCH_MODE,
-                WifiDppConfiguratorActivity.LaunchMode.LAUNCH_MODE_QR_CODE_GENERATOR.getMode());
+    public void launchActivity_qrCodeGenerator_shouldNotAutoFinish() {
+        Intent intent = new Intent(
+                WifiDppConfiguratorActivity.ACTION_CONFIGURATOR_QR_CODE_GENERATOR);
+        intent.putExtra(WifiDppUtils.EXTRA_WIFI_SECURITY, "WEP");
+        intent.putExtra(WifiDppUtils.EXTRA_WIFI_SSID, "GoogleGuest");
+
         mActivityRule.launchActivity(intent);
 
         assertThat(mActivityRule.getActivity().isFinishing()).isEqualTo(false);
     }
 
     @Test
-    public void launchActivity_modeChooseSavedWifiNetwork_shouldNotAutoFinish() {
-        Intent intent = new Intent();
-        intent.putExtra(WifiDppConfiguratorActivity.EXTRA_LAUNCH_MODE,
-                WifiDppConfiguratorActivity.LaunchMode
-                .LAUNCH_MODE_CHOOSE_SAVED_WIFI_NETWORK.getMode());
+    public void launchActivity_chooseSavedWifiNetwork_shouldNotAutoFinish() {
+        Intent intent = new Intent(
+                WifiDppConfiguratorActivity.ACTION_CONFIGURATOR_CHOOSE_SAVED_WIFI_NETWORK);
+
         mActivityRule.launchActivity(intent);
 
         assertThat(mActivityRule.getActivity().isFinishing()).isEqualTo(false);
     }
 
     @Test
-    public void launchActivity_noLaunchMode_shouldFinishActivityWithResultCodeCanceled() {
-        // If we do not specify launch mode, the activity will finish itself right away
-        Intent intent = new Intent();
-        mActivityRule.launchActivity(intent);
+    public void testActivity_shouldImplementsWifiNetworkConfigRetriever() {
+        WifiDppConfiguratorActivity activity = mActivityRule.getActivity();
 
-        assertThat(mActivityRule.getActivityResult().getResultCode()).
-                isEqualTo(Activity.RESULT_CANCELED);
+        assertThat(activity instanceof WifiNetworkConfig.Retriever).isEqualTo(true);
     }
 }
diff --git a/tests/unit/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java b/tests/unit/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
index c46db2c..98742ed 100644
--- a/tests/unit/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
+++ b/tests/unit/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
@@ -28,6 +28,8 @@
 import android.support.test.rule.ActivityTestRule;
 import android.support.test.runner.AndroidJUnit4;
 
+import com.android.settings.R;
+
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -41,21 +43,13 @@
 
     @Before
     public void setUp() {
-        Intent intent = new Intent();
-        intent.putExtra(WifiDppConfiguratorActivity.EXTRA_LAUNCH_MODE,
-                WifiDppConfiguratorActivity.LaunchMode.LAUNCH_MODE_QR_CODE_SCANNER.getMode());
+        Intent intent = new Intent(WifiDppConfiguratorActivity.ACTION_CONFIGURATOR_QR_CODE_SCANNER);
+        intent.putExtra(WifiDppUtils.EXTRA_WIFI_SECURITY, "WEP");
+        intent.putExtra(WifiDppUtils.EXTRA_WIFI_SSID, "GoogleGuest");
         mActivityRule.launchActivity(intent);
     }
 
     @Test
-    public void leftButton_shouldFinishActivityWithResultCodeCanceled() {
-        onView(withText("Cancel")).perform(click());
-
-        assertThat(mActivityRule.getActivityResult().getResultCode()).
-                isEqualTo(Activity.RESULT_CANCELED);
-    }
-
-    @Test
     public void rotateScreen_shouldNotCrash() {
         mActivityRule.getActivity().setRequestedOrientation(
                 ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
