forked from firka/flutter
[Android] add runtime flag to determine if HCPP is supported. (#163004)
Developers will need to _conditionally_ use HCPP (or the framework will need to handle it automatically). This requires the ability to query at runtime whether HCPP mode is enabled + supported. Add a message channel to do so, and add the usage of this to the android_engine_test. Does not yet add any automatic selection. --------- Co-authored-by: Matan Lurey <matanlurey@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:android_driver_extensions/extension.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
@@ -14,7 +16,14 @@ import '../src/allow_list_devices.dart';
|
||||
|
||||
void main() async {
|
||||
ensureAndroidDevice();
|
||||
enableFlutterDriverExtension(commands: <CommandExtension>[nativeDriverCommands]);
|
||||
enableFlutterDriverExtension(
|
||||
handler: (String? command) async {
|
||||
return json.encode(<String, Object?>{
|
||||
'supported': await HybridAndroidViewController.checkIfSupported(),
|
||||
});
|
||||
},
|
||||
commands: <CommandExtension>[nativeDriverCommands],
|
||||
);
|
||||
|
||||
// Run on full screen.
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
|
||||
|
||||
Reference in New Issue
Block a user