Loading AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -3048,7 +3048,7 @@ <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.PROCESS_WIFI_DPP_QR_CODE"/> <action android:name="android.settings.PROCESS_WIFI_EASY_CONNECT_QR_CODE"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> Loading src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java +2 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,8 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment { mChooseDifferentNetwork = view.findViewById(R.id.choose_different_network); mChooseDifferentNetwork.setOnClickListener(v -> mClickChooseDifferentNetworkListener.onClickChooseDifferentNetwork()); mClickChooseDifferentNetworkListener.onClickChooseDifferentNetwork() ); mButtonLeft = view.findViewById(R.id.button_left); mButtonLeft.setText(R.string.cancel); Loading src/com/android/settings/wifi/dpp/WifiDppChooseSavedWifiNetworkFragment.java +4 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ public class WifiDppChooseSavedWifiNetworkFragment extends WifiDppQrCodeBaseFrag * WifiDppChooseSavedWifiNetworkFragment. */ final FragmentManager fragmentManager = getChildFragmentManager(); final WifiNetworkListFragment fragment = new WifiNetworkListFragment(); final Bundle args = getArguments(); if (args != null) { fragment.setArguments(args); } final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.wifi_network_list_container, fragment, TAG_FRAGMENT_WIFI_NETWORK_LIST); Loading src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java +39 −17 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.app.Activity; import android.app.settings.SettingsEnums; import android.content.Intent; import android.os.Bundle; import android.provider.Settings; import android.util.Log; import androidx.annotation.VisibleForTesting; Loading @@ -45,7 +46,7 @@ import com.android.settings.core.InstrumentedActivity; * {@code WifiDppUtils.EXTRA_WIFI_PRE_SHARED_KEY} * {@code WifiDppUtils.EXTRA_WIFI_HIDDEN_SSID} * * For intent action {@code ACTION_PROCESS_WIFI_DPP_QR_CODE}, specify Wi-Fi (DPP) * For intent action {@link Settings#ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE}, specify Wi-Fi (DPP) * QR code in {@code WifiDppUtils.EXTRA_QR_CODE} */ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements Loading @@ -62,8 +63,6 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements "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_PROCESS_WIFI_DPP_QR_CODE = "android.settings.PROCESS_WIFI_DPP_QR_CODE"; // Key for Bundle usage private static final String KEY_QR_CODE = "key_qr_code"; Loading @@ -78,8 +77,10 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements /** The Wi-Fi network which will be configured */ private WifiNetworkConfig mWifiNetworkConfig; /** The Wi-Fi DPP QR code from intent ACTION_PROCESS_WIFI_DPP_QR_CODE */ /** The Wi-Fi DPP QR code from intent ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE */ private WifiQrCode mWifiDppQrCode; /** Secret extra that allows fake networks to show in UI for testing purposes */ private boolean mIsTest; @Override public int getMetricsCategory() { Loading Loading @@ -139,8 +140,9 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements showQrCodeGeneratorFragment(); } break; case ACTION_PROCESS_WIFI_DPP_QR_CODE: String qrCode = intent.getStringExtra(WifiDppUtils.EXTRA_QR_CODE); case Settings.ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE: String qrCode = intent.getStringExtra(Settings.EXTRA_QR_CODE); mIsTest = intent.getBooleanExtra(WifiDppUtils.EXTRA_TEST, false); mWifiDppQrCode = getValidWifiDppQrCodeOrNull(qrCode); final boolean isDppSupported = WifiDppUtils.isWifiDppEnabled(this); if (!isDppSupported) { Loading @@ -164,12 +166,17 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements } private void showQrCodeScannerFragment(boolean addToBackStack) { WifiDppQrCodeScannerFragment fragment = (WifiDppQrCodeScannerFragment) mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER); // Avoid to replace the same fragment during configuration change if (mFragmentManager.findFragmentByTag(WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER) != null) { if (fragment != null && fragment.isVisible()) { return; } final WifiDppQrCodeScannerFragment fragment = new WifiDppQrCodeScannerFragment(); if (fragment == null) { fragment = new WifiDppQrCodeScannerFragment(); } final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, fragment, Loading @@ -181,13 +188,15 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements } private void showQrCodeGeneratorFragment() { WifiDppQrCodeGeneratorFragment fragment = (WifiDppQrCodeGeneratorFragment) mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_QR_CODE_GENERATOR); // Avoid to replace the same fragment during configuration change if (mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_QR_CODE_GENERATOR) != null) { if (fragment != null && fragment.isVisible()) { return; } final WifiDppQrCodeGeneratorFragment fragment = new WifiDppQrCodeGeneratorFragment(); fragment = new WifiDppQrCodeGeneratorFragment(); final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, fragment, Loading @@ -196,14 +205,22 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements } private void showChooseSavedWifiNetworkFragment(boolean addToBackStack) { WifiDppChooseSavedWifiNetworkFragment fragment = (WifiDppChooseSavedWifiNetworkFragment) mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_CHOOSE_SAVED_WIFI_NETWORK); // Avoid to replace the same fragment during configuration change if (mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_CHOOSE_SAVED_WIFI_NETWORK) != null) { if (fragment != null && fragment.isVisible()) { return; } final WifiDppChooseSavedWifiNetworkFragment fragment = new WifiDppChooseSavedWifiNetworkFragment(); if (fragment == null) { fragment = new WifiDppChooseSavedWifiNetworkFragment(); if (mIsTest) { Bundle bundle = new Bundle(); bundle.putBoolean(WifiDppUtils.EXTRA_TEST, true); fragment.setArguments(bundle); } } final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, fragment, Loading @@ -215,14 +232,19 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements } private void showAddDeviceFragment(boolean addToBackStack) { WifiDppAddDeviceFragment fragment = (WifiDppAddDeviceFragment) mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_ADD_DEVICE); // Avoid to replace the same fragment during configuration change if (mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_ADD_DEVICE) != null) { return; } final WifiDppAddDeviceFragment fragment = new WifiDppAddDeviceFragment(); if (fragment == null) { fragment = new WifiDppAddDeviceFragment(); } final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, fragment, Loading src/com/android/settings/wifi/dpp/WifiDppUtils.java +5 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ import java.util.List; /** * Here are the items shared by both WifiDppConfiguratorActivity & WifiDppEnrolleeActivity * * @see WifiQrCode */ public class WifiDppUtils { /** Loading Loading @@ -67,8 +69,9 @@ public class WifiDppUtils { /** The data corresponding to {@code WifiConfiguration} networkId */ public static final String EXTRA_WIFI_NETWORK_ID = "networkId"; /** @see WifiQrCode */ public static final String EXTRA_QR_CODE = "qrCode"; /** Used by {@link android.provider.Settings#ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE} to * indicate test mode UI should be shown. Test UI does not make API calls. Value is a boolean.*/ public static final String EXTRA_TEST = "test"; /** * Returns whether the user can share the network represented by this preference with QR code. Loading Loading
AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -3048,7 +3048,7 @@ <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.PROCESS_WIFI_DPP_QR_CODE"/> <action android:name="android.settings.PROCESS_WIFI_EASY_CONNECT_QR_CODE"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> Loading
src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java +2 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,8 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment { mChooseDifferentNetwork = view.findViewById(R.id.choose_different_network); mChooseDifferentNetwork.setOnClickListener(v -> mClickChooseDifferentNetworkListener.onClickChooseDifferentNetwork()); mClickChooseDifferentNetworkListener.onClickChooseDifferentNetwork() ); mButtonLeft = view.findViewById(R.id.button_left); mButtonLeft.setText(R.string.cancel); Loading
src/com/android/settings/wifi/dpp/WifiDppChooseSavedWifiNetworkFragment.java +4 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ public class WifiDppChooseSavedWifiNetworkFragment extends WifiDppQrCodeBaseFrag * WifiDppChooseSavedWifiNetworkFragment. */ final FragmentManager fragmentManager = getChildFragmentManager(); final WifiNetworkListFragment fragment = new WifiNetworkListFragment(); final Bundle args = getArguments(); if (args != null) { fragment.setArguments(args); } final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.wifi_network_list_container, fragment, TAG_FRAGMENT_WIFI_NETWORK_LIST); Loading
src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java +39 −17 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.app.Activity; import android.app.settings.SettingsEnums; import android.content.Intent; import android.os.Bundle; import android.provider.Settings; import android.util.Log; import androidx.annotation.VisibleForTesting; Loading @@ -45,7 +46,7 @@ import com.android.settings.core.InstrumentedActivity; * {@code WifiDppUtils.EXTRA_WIFI_PRE_SHARED_KEY} * {@code WifiDppUtils.EXTRA_WIFI_HIDDEN_SSID} * * For intent action {@code ACTION_PROCESS_WIFI_DPP_QR_CODE}, specify Wi-Fi (DPP) * For intent action {@link Settings#ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE}, specify Wi-Fi (DPP) * QR code in {@code WifiDppUtils.EXTRA_QR_CODE} */ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements Loading @@ -62,8 +63,6 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements "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_PROCESS_WIFI_DPP_QR_CODE = "android.settings.PROCESS_WIFI_DPP_QR_CODE"; // Key for Bundle usage private static final String KEY_QR_CODE = "key_qr_code"; Loading @@ -78,8 +77,10 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements /** The Wi-Fi network which will be configured */ private WifiNetworkConfig mWifiNetworkConfig; /** The Wi-Fi DPP QR code from intent ACTION_PROCESS_WIFI_DPP_QR_CODE */ /** The Wi-Fi DPP QR code from intent ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE */ private WifiQrCode mWifiDppQrCode; /** Secret extra that allows fake networks to show in UI for testing purposes */ private boolean mIsTest; @Override public int getMetricsCategory() { Loading Loading @@ -139,8 +140,9 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements showQrCodeGeneratorFragment(); } break; case ACTION_PROCESS_WIFI_DPP_QR_CODE: String qrCode = intent.getStringExtra(WifiDppUtils.EXTRA_QR_CODE); case Settings.ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE: String qrCode = intent.getStringExtra(Settings.EXTRA_QR_CODE); mIsTest = intent.getBooleanExtra(WifiDppUtils.EXTRA_TEST, false); mWifiDppQrCode = getValidWifiDppQrCodeOrNull(qrCode); final boolean isDppSupported = WifiDppUtils.isWifiDppEnabled(this); if (!isDppSupported) { Loading @@ -164,12 +166,17 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements } private void showQrCodeScannerFragment(boolean addToBackStack) { WifiDppQrCodeScannerFragment fragment = (WifiDppQrCodeScannerFragment) mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER); // Avoid to replace the same fragment during configuration change if (mFragmentManager.findFragmentByTag(WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER) != null) { if (fragment != null && fragment.isVisible()) { return; } final WifiDppQrCodeScannerFragment fragment = new WifiDppQrCodeScannerFragment(); if (fragment == null) { fragment = new WifiDppQrCodeScannerFragment(); } final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, fragment, Loading @@ -181,13 +188,15 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements } private void showQrCodeGeneratorFragment() { WifiDppQrCodeGeneratorFragment fragment = (WifiDppQrCodeGeneratorFragment) mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_QR_CODE_GENERATOR); // Avoid to replace the same fragment during configuration change if (mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_QR_CODE_GENERATOR) != null) { if (fragment != null && fragment.isVisible()) { return; } final WifiDppQrCodeGeneratorFragment fragment = new WifiDppQrCodeGeneratorFragment(); fragment = new WifiDppQrCodeGeneratorFragment(); final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, fragment, Loading @@ -196,14 +205,22 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements } private void showChooseSavedWifiNetworkFragment(boolean addToBackStack) { WifiDppChooseSavedWifiNetworkFragment fragment = (WifiDppChooseSavedWifiNetworkFragment) mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_CHOOSE_SAVED_WIFI_NETWORK); // Avoid to replace the same fragment during configuration change if (mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_CHOOSE_SAVED_WIFI_NETWORK) != null) { if (fragment != null && fragment.isVisible()) { return; } final WifiDppChooseSavedWifiNetworkFragment fragment = new WifiDppChooseSavedWifiNetworkFragment(); if (fragment == null) { fragment = new WifiDppChooseSavedWifiNetworkFragment(); if (mIsTest) { Bundle bundle = new Bundle(); bundle.putBoolean(WifiDppUtils.EXTRA_TEST, true); fragment.setArguments(bundle); } } final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, fragment, Loading @@ -215,14 +232,19 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements } private void showAddDeviceFragment(boolean addToBackStack) { WifiDppAddDeviceFragment fragment = (WifiDppAddDeviceFragment) mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_ADD_DEVICE); // Avoid to replace the same fragment during configuration change if (mFragmentManager.findFragmentByTag( WifiDppUtils.TAG_FRAGMENT_ADD_DEVICE) != null) { return; } final WifiDppAddDeviceFragment fragment = new WifiDppAddDeviceFragment(); if (fragment == null) { fragment = new WifiDppAddDeviceFragment(); } final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, fragment, Loading
src/com/android/settings/wifi/dpp/WifiDppUtils.java +5 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ import java.util.List; /** * Here are the items shared by both WifiDppConfiguratorActivity & WifiDppEnrolleeActivity * * @see WifiQrCode */ public class WifiDppUtils { /** Loading Loading @@ -67,8 +69,9 @@ public class WifiDppUtils { /** The data corresponding to {@code WifiConfiguration} networkId */ public static final String EXTRA_WIFI_NETWORK_ID = "networkId"; /** @see WifiQrCode */ public static final String EXTRA_QR_CODE = "qrCode"; /** Used by {@link android.provider.Settings#ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE} to * indicate test mode UI should be shown. Test UI does not make API calls. Value is a boolean.*/ public static final String EXTRA_TEST = "test"; /** * Returns whether the user can share the network represented by this preference with QR code. Loading