Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c91d0170 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

[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
parent 44fddb45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+0 −8
Original line number Diff line number Diff line
@@ -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);