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

Commit 233e1707 authored by Michael W's avatar Michael W
Browse files

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
parent f2d84fdc
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4,12 +4,14 @@
 */
package com.android.incallui.util;

import android.annotation.SuppressLint;
import android.bluetooth.BluetoothDevice;

public class BluetoothUtil {
    @SuppressLint("MissingPermission")
    public static String getAliasName(BluetoothDevice bluetoothDevice) {
        try {
            return bluetoothDevice == null ? "" : bluetoothDevice.getAlias();
        } catch (SecurityException ignored) {
            return "";
        }
    }
}