blob: d89bf9c33f620837ff87d2ca5057f71433bb6f9f [file] [log] [blame]
// 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);
// 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. For 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);
// Requests the permissions necessary to access Bluetooth.
// On Android, this prompts the user for permissions.
// On all other platforms, this is a no-op.
RequestSystemPermissions() => ();
// Requests enabling Location Services.
// On Android, the user is shown the Location Services 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_ash]
RestartSystemBluetooth() => ();
};