checkUsagePermission static method

Future<bool> checkUsagePermission()

Checks if Usage Stats permission has been granted. Returns true if permission is granted, false otherwise.

Implementation

static Future<bool> checkUsagePermission() async {
  try {
    final result =
        await _channel.invokeMethod<bool>('checkUsagePermission');
    return result ?? false;
  } on PlatformException catch (e) {
    throw Exception('Failed to check usage permission: ${e.message}');
  }
}