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

Commit 03393c41 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Gerrit Code Review
Browse files

Merge "Fix the memory leak in TetherSettings"

parents 3c398ea7 0fb2f2bd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -182,6 +182,16 @@ public class TetherSettings extends SettingsPreferenceFragment
                com.android.internal.R.array.config_mobile_hotspot_provision_app);
    }

    @Override
    public void onDestroy() {
        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
        BluetoothProfile profile = mBluetoothPan.getAndSet(null);
        if (profile != null && adapter != null) {
            adapter.closeProfileProxy(BluetoothProfile.PAN, profile);
        }
        super.onDestroy();
    }

    @Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
        savedInstanceState.putInt(TETHER_CHOICE, mTetherChoice);