From 07114a6d0076a63472c689215f45cf2c2bade4d5 Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Fri, 17 Mar 2023 12:37:29 +0800 Subject: [PATCH] Close the dialog activity when user click cancel or background Bug: 241346100 Test: local test Change-Id: Id9d931fc8b74ef566ffe3c6135aaf433cd9f770b --- .../settings/bluetooth/BluetoothBroadcastDialog.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/android/settings/bluetooth/BluetoothBroadcastDialog.java b/src/com/android/settings/bluetooth/BluetoothBroadcastDialog.java index b9cc29ef144..7fa63b06afc 100644 --- a/src/com/android/settings/bluetooth/BluetoothBroadcastDialog.java +++ b/src/com/android/settings/bluetooth/BluetoothBroadcastDialog.java @@ -19,6 +19,7 @@ package com.android.settings.bluetooth; import android.app.Dialog; import android.app.settings.SettingsEnums; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; @@ -27,6 +28,7 @@ import android.view.View; import android.widget.Button; import android.widget.TextView; +import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import com.android.settings.R; @@ -128,6 +130,12 @@ public class BluetoothBroadcastDialog extends InstrumentedDialogFragment { return SettingsEnums.DIALOG_LE_AUDIO_BROADCAST; } + @Override + public void onCancel(@NonNull DialogInterface dialog) { + dismiss(); + getActivity().finish(); + } + private void launchFindBroadcastsActivity() { Bundle bundle = new Bundle(); bundle.putString(KEY_DEVICE_ADDRESS, mDeviceAddress);