Prefer Shield capture provider over Android N

This commit is contained in:
Cameron Gutman 2016-06-20 20:43:59 -07:00
parent 2dcf5486da
commit 87a62666ac

View File

@ -8,14 +8,17 @@ import com.limelight.binding.input.evdev.EvdevListener;
public class InputCaptureManager { public class InputCaptureManager {
public static InputCaptureProvider getInputCaptureProvider(Activity activity, EvdevListener rootListener) { public static InputCaptureProvider getInputCaptureProvider(Activity activity, EvdevListener rootListener) {
if (AndroidCaptureProvider.isCaptureProviderSupported()) { // Shield capture is preferred because it can capture when the cursor is over
LimeLog.info("Using Android N+ native mouse capture"); // the system UI. Android N native capture can only capture over views owned
return new AndroidCaptureProvider(activity); // by the application.
} if (ShieldCaptureProvider.isCaptureProviderSupported()) {
else if (ShieldCaptureProvider.isCaptureProviderSupported()) {
LimeLog.info("Using NVIDIA mouse capture extension"); LimeLog.info("Using NVIDIA mouse capture extension");
return new ShieldCaptureProvider(activity); return new ShieldCaptureProvider(activity);
} }
else if (AndroidCaptureProvider.isCaptureProviderSupported()) {
LimeLog.info("Using Android N+ native mouse capture");
return new AndroidCaptureProvider(activity);
}
else if (EvdevCaptureProvider.isCaptureProviderSupported()) { else if (EvdevCaptureProvider.isCaptureProviderSupported()) {
LimeLog.info("Using Evdev mouse capture"); LimeLog.info("Using Evdev mouse capture");
return new EvdevCaptureProvider(activity, rootListener); return new EvdevCaptureProvider(activity, rootListener);