[LE Broadcast] Fix crash when scan QR code

Crash happens when rotated screen.

QrCodeScanModeFragment should only have default constructor.

Remove unused params to fix.

To start this page,
adb shell am start \
    -a android.settings.BLUETOOTH_LE_AUDIO_QR_CODE_SCANNER

Fix: 287363885
Test: Manually
Change-Id: I3c4bcfdb8ae6ddf750e16d8e7565cb9d45d11788
This commit is contained in:
Chaohui Wang
2023-06-17 00:07:16 +08:00
parent 44fddb456e
commit c91d017080
2 changed files with 1 additions and 9 deletions

View File

@@ -98,7 +98,7 @@ public class QrCodeScanModeActivity extends QrCodeScanModeBaseActivity {
BluetoothBroadcastUtils.TAG_FRAGMENT_QR_CODE_SCANNER);
if (fragment == null) {
fragment = new QrCodeScanModeFragment(mIsGroupOp, mSink);
fragment = new QrCodeScanModeFragment();
} else {
if (fragment.isVisible()) {
return;

View File

@@ -18,7 +18,6 @@ package com.android.settings.bluetooth;
import android.app.Activity;
import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.Intent;
import android.graphics.Matrix;
@@ -71,9 +70,7 @@ public class QrCodeScanModeFragment extends InstrumentedFragment implements
public static final String KEY_BROADCAST_METADATA = "key_broadcast_metadata";
private boolean mIsGroupOp;
private int mCornerRadius;
private BluetoothDevice mSink;
private String mBroadcastMetadata;
private Context mContext;
private QrCamera mCamera;
@@ -81,11 +78,6 @@ public class QrCodeScanModeFragment extends InstrumentedFragment implements
private TextView mSummary;
private TextView mErrorMessage;
public QrCodeScanModeFragment(boolean isGroupOp, BluetoothDevice sink) {
mIsGroupOp = isGroupOp;
mSink = sink;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);