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

Commit 32b6c7a7 authored by Pavel Grafov's avatar Pavel Grafov Committed by Android (Google) Code Review
Browse files

Merge "Security logging for Bluetooth connection events" into tm-qpr-dev

parents f80a0d37 938e1a11
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@
    <uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS"/>
    <uses-permission android:name="android.permission.QUERY_AUDIO_STATE"/>
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.WRITE_SECURITY_LOG"/>

    <uses-sdk android:minSdkVersion="14"/>

+7 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.bluetooth.btservice;
import static android.Manifest.permission.BLUETOOTH_CONNECT;
import static android.Manifest.permission.BLUETOOTH_SCAN;

import android.app.admin.SecurityLog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothAssignedNumbers;
import android.bluetooth.BluetoothClass;
@@ -850,6 +851,8 @@ final class RemoteDevices {
            if (batteryService != null) {
                batteryService.connect(device);
            }
            SecurityLog.writeEvent(SecurityLog.TAG_BLUETOOTH_CONNECTION,
                    Utils.getLoggableAddress(device), /* success */ 1, /* reason */ "");
            debugLog(
                    "aclStateChangeCallback: Adapter State: " + BluetoothAdapter.nameForState(state)
                            + " Connected: " + device);
@@ -883,6 +886,10 @@ final class RemoteDevices {
                    deviceProp.setBondingInitiatedLocally(false);
                }
            }
            SecurityLog.writeEvent(SecurityLog.TAG_BLUETOOTH_DISCONNECTION,
                    Utils.getLoggableAddress(device),
                    BluetoothAdapter.BluetoothConnectionCallback.disconnectReasonToString(
                            AdapterService.hciToAndroidDisconnectReason(hciReason)));
            debugLog(
                    "aclStateChangeCallback: Adapter State: " + BluetoothAdapter.nameForState(state)
                            + " Disconnected: " + device
+1 −0
Original line number Diff line number Diff line
@@ -37,5 +37,6 @@
        <permission name="android.permission.UPDATE_DEVICE_STATS" />
        <permission name="android.permission.PACKAGE_USAGE_STATS" />
        <permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND" />
        <permission name="android.permission.WRITE_SECURITY_LOG" />
    </privapp-permissions>
</permissions>
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ package {
filegroup {
    name: "BluetoothCommonSources",
    srcs: [
        "audit_log.cc",
        "init_flags.cc",
        "metric_id_manager.cc",
        "strings.cc",
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

source_set("BluetoothCommonSources") {
  sources = [
    "audit_log.cc",
    "init_flags.cc",
    "metric_id_manager.cc",
    "stop_watch.cc",
Loading