Files
Michael W 0c7380c71c Dialer: Fix crash when missing BLUETOOTH_CONNECT permission
* getAlias() needs BLUETOOTH_CONNECT
* we are missing checks if we have that permission resulting in the
  InCallScreen crashing with the phone call still going on - no
  possibility to hang up

Change-Id: Ib9c7988c32bab95060b5f4a35bf9a3498610c3f8
2024-01-30 19:23:36 +01:00

18 lines
455 B
Java

/*
* SPDX-FileCopyrightText: The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package com.android.incallui.util;
import android.bluetooth.BluetoothDevice;
public class BluetoothUtil {
public static String getAliasName(BluetoothDevice bluetoothDevice) {
try {
return bluetoothDevice == null ? "" : bluetoothDevice.getAlias();
} catch (SecurityException ignored) {
return "";
}
}
}