Support AccessibilityService.takeScreenshot with Java 8 library desugaring.
// limitations under the License.
package com.google.devtools.build.android.desugar.runtime;
+import android.accessibilityservice.AccessibilityService;
import android.app.DirectAction;
+import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.service.voice.VoiceInteractionSession;
@@ -93,4 +95,13 @@ public final class ConsumerWrapper<T> implements Consumer<T> {
resultExecutor,
callback != null ? new ConsumerWrapper<List<DirectAction>>(callback) : null);
}
+
+ public static boolean takeScreenshot(
+ AccessibilityService receiver,
+ int displayId,
+ Executor resultExecutor,
+ j$.util.function.Consumer<Bitmap> callback) {
+ return receiver.takeScreenshot(
+ displayId, resultExecutor, callback != null ? new ConsumerWrapper<Bitmap>(callback) : null);
+ }
}
