diff --git a/Android.mk b/Android.mk
index c99e30c58eb..e385b340514 100644
--- a/Android.mk
+++ b/Android.mk
@@ -23,6 +23,7 @@ LOCAL_USE_AAPT2 := true
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_ANDROID_LIBRARIES := \
+ androidx-constraintlayout_constraintlayout \
androidx.slice_slice-builders \
androidx.slice_slice-core \
androidx.slice_slice-view \
@@ -40,6 +41,7 @@ LOCAL_JAVA_LIBRARIES := \
ims-common
LOCAL_STATIC_JAVA_LIBRARIES := \
+ androidx-constraintlayout_constraintlayout-solver \
androidx.lifecycle_lifecycle-runtime \
androidx.lifecycle_lifecycle-extensions \
guava \
diff --git a/res/layout-land/wifi_dpp_qrcode_scanner_fragment.xml b/res/layout-land/wifi_dpp_qrcode_scanner_fragment.xml
index 21df686b678..4eed0f64eba 100644
--- a/res/layout-land/wifi_dpp_qrcode_scanner_fragment.xml
+++ b/res/layout-land/wifi_dpp_qrcode_scanner_fragment.xml
@@ -19,29 +19,40 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="match_parent">
-
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/wifi_dpp_activity.xml b/res/layout/wifi_dpp_activity.xml
index 48f2b65ea6c..cb82f661c13 100644
--- a/res/layout/wifi_dpp_activity.xml
+++ b/res/layout/wifi_dpp_activity.xml
@@ -15,7 +15,7 @@
limitations under the License.
-->
-
-
+
diff --git a/res/layout/wifi_dpp_add_device_fragment.xml b/res/layout/wifi_dpp_add_device_fragment.xml
index 5e70396ae40..2d1ce5b6dcd 100644
--- a/res/layout/wifi_dpp_add_device_fragment.xml
+++ b/res/layout/wifi_dpp_add_device_fragment.xml
@@ -15,31 +15,49 @@
limitations under the License.
-->
-
+ android:layout_height="match_parent">
-
-
-
+ android:layout_height="match_parent">
-
+
+
+
+
+
+
+
+
+
+
+
+
+ app:layout_constraintBottom_toBottomOf="parent"/>
-
-
-
+
diff --git a/res/layout/wifi_dpp_choose_saved_wifi_network_fragment.xml b/res/layout/wifi_dpp_choose_saved_wifi_network_fragment.xml
index a65cf3e99f6..c3fccd0c5f1 100644
--- a/res/layout/wifi_dpp_choose_saved_wifi_network_fragment.xml
+++ b/res/layout/wifi_dpp_choose_saved_wifi_network_fragment.xml
@@ -15,21 +15,39 @@
limitations under the License.
-->
-
+ android:layout_height="match_parent">
-
-
-
+ android:layout_height="match_parent">
-
+
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/wifi_dpp_fragment_footer.xml b/res/layout/wifi_dpp_fragment_footer.xml
index 98c6485236b..36ec1d71f7e 100644
--- a/res/layout/wifi_dpp_fragment_footer.xml
+++ b/res/layout/wifi_dpp_fragment_footer.xml
@@ -18,16 +18,15 @@
+ android:layout_height="wrap_content"
+ style="@style/SuwGlifButtonBar">
+ android:layout_gravity="start"/>
+ android:layout_gravity="end"/>
diff --git a/res/layout/wifi_dpp_qrcode_generator_fragment.xml b/res/layout/wifi_dpp_qrcode_generator_fragment.xml
index c7c258b089d..2617aea3fca 100644
--- a/res/layout/wifi_dpp_qrcode_generator_fragment.xml
+++ b/res/layout/wifi_dpp_qrcode_generator_fragment.xml
@@ -22,14 +22,27 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
+
-
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/wifi_dpp_qrcode_scanner_fragment.xml b/res/layout/wifi_dpp_qrcode_scanner_fragment.xml
index f09fc69ff75..c5e416b258e 100644
--- a/res/layout/wifi_dpp_qrcode_scanner_fragment.xml
+++ b/res/layout/wifi_dpp_qrcode_scanner_fragment.xml
@@ -19,35 +19,45 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="match_parent">
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java b/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
index 8fa58f3ca47..9264ad91d1a 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
@@ -28,7 +28,6 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
-import android.widget.TextView;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
@@ -41,7 +40,7 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
private static final String TAG = "WifiDppAddDeviceFragment";
private ImageView mWifiApPictureView;
- private TextView mChooseDifferentNetwork;
+ private Button mChooseDifferentNetwork;
private Button mButtonLeft;
private Button mButtonRight;
@@ -109,10 +108,16 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
wifiNetworkConfig.getSsid()));
mWifiApPictureView = view.findViewById(R.id.wifi_ap_picture_view);
+
mChooseDifferentNetwork = view.findViewById(R.id.choose_different_network);
+ mChooseDifferentNetwork.setOnClickListener(v -> getFragmentManager().popBackStack());
+
mButtonLeft = view.findViewById(R.id.button_left);
mButtonLeft.setText(R.string.cancel);
- mButtonLeft.setOnClickListener(v -> getFragmentManager().popBackStack());
+ mButtonLeft.setOnClickListener(v -> {
+ getActivity().setResult(Activity.RESULT_CANCELED);
+ getActivity().finish();
+ });
mButtonRight = view.findViewById(R.id.button_right);
mButtonRight.setText(R.string.wifi_dpp_share_wifi);
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
index 2f59e188ade..45d753cdf15 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
@@ -64,6 +64,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
// Key for Bundle usage
private static final String KEY_PUBLIC_URI = "key_public_uri";
+ private static final String KEY_IS_CONFIGURATOR_MODE = "key_is_configurator_mode";
private QrCamera mCamera;
private TextureView mTextureView;
@@ -71,7 +72,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
private TextView mErrorMessage;
/** true if the fragment working for configurator, false enrollee*/
- private final boolean mIsConfiguratorMode;
+ private boolean mIsConfiguratorMode;
/** The SSID of the Wi-Fi network which the user specify to enroll */
private String mSsid;
@@ -79,6 +80,15 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
/** QR code data scanned by camera */
private WifiQrCode mWifiQrCode;
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ if (savedInstanceState != null) {
+ mIsConfiguratorMode = savedInstanceState.getBoolean(KEY_IS_CONFIGURATOR_MODE);
+ }
+ }
+
@Override
public int getMetricsCategory() {
if (mIsConfiguratorMode) {
@@ -368,4 +378,11 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
}
}
};
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ outState.putBoolean(KEY_IS_CONFIGURATOR_MODE, mIsConfiguratorMode);
+
+ super.onSaveInstanceState(outState);
+ }
}
diff --git a/tests/robotests/Android.mk b/tests/robotests/Android.mk
index 01218cbb3c2..50133d9347c 100644
--- a/tests/robotests/Android.mk
+++ b/tests/robotests/Android.mk
@@ -25,6 +25,7 @@ LOCAL_RESOURCE_DIR += \
$(SETTINGS_AOSP_PATH)/res
LOCAL_STATIC_ANDROID_LIBRARIES := \
+ androidx-constraintlayout_constraintlayout \
androidx.slice_slice-builders \
androidx.slice_slice-core \
androidx.slice_slice-view \
@@ -42,6 +43,7 @@ LOCAL_JAVA_LIBRARIES := \
ims-common
LOCAL_STATIC_JAVA_LIBRARIES := \
+ androidx-constraintlayout_constraintlayout-solver \
androidx.lifecycle_lifecycle-runtime \
androidx.lifecycle_lifecycle-extensions \
guava \