File: bluetooth_internals.mojom

package info (click to toggle)
chromium 138.0.7204.183-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,080,960 kB
  • sloc: cpp: 34,937,079; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,954; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,811; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (75 lines) | stat: -rw-r--r-- 3,269 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module mojom;

import "device/bluetooth/public/mojom/adapter.mojom";

// Handles requests from chrome://bluetooth-internals to enable or disable the
// usage of Bluetooth debug logs. The debug logs to be enabled reside in the
// kernel as well within BlueZ/NewBlue. Note that these logs are text-only and
// do not include captured packets from btmon.
interface DebugLogsChangeHandler {
  // Enables or disables debug logs, depending on the value of
  // |should_debug_logs_be_enabled|.
  ChangeDebugLogsState(bool should_debug_logs_be_enabled);
};

interface BluetoothInternalsHandler {
  // Gets an Adapter interface. Returns null if Bluetooth is not supported.
  GetAdapter() => (pending_remote<bluetooth.mojom.Adapter>? adapter);

  // Retrieves a handler for changing the state of debug logs. If debug logs are
  // not supported (e.g., the required flags are disabled or the logged-in user
  // is not eligible), null is returned. When a valid handler is returned, an
  // extra boolean is provided which represents the initial state of the toggle.
  GetDebugLogsChangeHandler()
      => (pending_remote<DebugLogsChangeHandler>? handler,
          bool initial_toggle_value);

  // On Android, checks if the Chrome needs permissions to use Bluetooth.
  // This is needed for Android as it requires some system permissions to be
  // granted for accessing Bluetooth.
  // On other platforms, false is returned for all values.
  CheckSystemPermissions() => (bool need_location_permission,
    bool need_nearby_devices_permission, bool need_location_services,
    bool can_request_permissions);

  // On Android, this prompts the user for permissions necessary to access
  // Bluetooth.
  // On all other platforms, this is a no-op.
  RequestSystemPermissions() => ();

  // On Android, this requests the user to enable the Location Services by
  // showing them the settings page so they can turn it on.
  // On all other platforms, this is a no-op.
  RequestLocationServices() => ();

  // Restarts Bluetooth system.
  // If Bluetooth system is already off turns it back on.
  // If Bluetooth is unavailable this is no-op.
  [EnableIf=is_chromeos]
  RestartSystemBluetooth() => ();

  // On ChromeOS, starts a btsnoop process that writes to daemon-store.
  // If a previous process exists, stop it and create a new process.
  // This is not the snoop process that starts for internal account, that is
  // chrome/browser/ash/bluetooth/bluetooth_log_controller.cc.
  // On other platforms, it immediately returns null.
  StartBtsnoop() => (pending_remote<BluetoothBtsnoop>? btsnoop);

  // Returns whether btsnoop feature is enabled via flags.
  // When the flag is stable we can remove this.
  IsBtsnoopFeatureEnabled() => (bool enabled);
};

// Interface to control the btsnoop process returned by
// BluetoothInternalsHandler::StartBtsnoop.
interface BluetoothBtsnoop {
  // On ChromeOS, stops the btsnoop started by StartBtsnoop().
  // On other platforms, it shouldn't be callable, but anyway it immediately
  // returns false.
  // Calling this method will also close this interface.
  Stop() => (bool success);
};