@@ -157,7 +157,7 @@ public void toggleShowNotImportant() {
157157 public void sendWithScreenshot () {
158158 try {
159159 JSONObject combinedJson = new JSONObject ();
160- combinedJson .put ("screenshot" , screenshot );
160+ // combinedJson.put("screenshot", screenshot);
161161 combinedJson .putOpt ("views" , jsonObject );
162162 Intent announcementIntent = new Intent (SocketService .BROADCAST_MESSAGE , null , this , SocketService .class );
163163 SocketService .data = compress (combinedJson .toString ());
@@ -186,28 +186,29 @@ public void startCapture() {
186186 List <AccessibilityWindowInfo > windows = getWindows ();
187187
188188 TreeDebug .logNodeTrees (windows , _this );
189- takeScreenshot (Display .DEFAULT_DISPLAY ,
190- getApplicationContext ().getMainExecutor (), new TakeScreenshotCallback () {
191- @ RequiresApi (api = Build .VERSION_CODES .R )
192- @ Override
193- public void onSuccess (@ NonNull ScreenshotResult screenshotResult ) {
194-
195- Log .i ("ScreenShotResult" ,"onSuccess" );
196- Bitmap bitmap = Bitmap .wrapHardwareBuffer (screenshotResult .getHardwareBuffer (),screenshotResult .getColorSpace ());
197- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
198- bitmap .compress (Bitmap .CompressFormat .PNG , 50 , byteArrayOutputStream );
199- byte [] byteArray = byteArrayOutputStream .toByteArray ();
200- String encoded = Base64 .encodeToString (byteArray , Base64 .NO_WRAP );
201- screenshot = encoded ;
202- sendWithScreenshot ();
203- }
204-
205- @ Override
206- public void onFailure (int i ) {
207- Log .i ("ScreenShotResult" ,"onFailure code is " + i );
208- sendWithoutScreenshot ();
209- }
210- });
189+ sendWithScreenshot ();
190+ // takeScreenshot(Display.DEFAULT_DISPLAY,
191+ // getApplicationContext().getMainExecutor(), new TakeScreenshotCallback() {
192+ // @RequiresApi(api = Build.VERSION_CODES.R)
193+ // @Override
194+ // public void onSuccess(@NonNull ScreenshotResult screenshotResult) {
195+ //
196+ // Log.i("ScreenShotResult","onSuccess");
197+ // Bitmap bitmap = Bitmap.wrapHardwareBuffer(screenshotResult.getHardwareBuffer(),screenshotResult.getColorSpace());
198+ // ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
199+ // bitmap.compress(Bitmap.CompressFormat.PNG, 50, byteArrayOutputStream);
200+ // byte[] byteArray = byteArrayOutputStream.toByteArray();
201+ // String encoded = Base64.encodeToString(byteArray, Base64.NO_WRAP);
202+ // screenshot = encoded;
203+ // sendWithScreenshot();
204+ // }
205+ //
206+ // @Override
207+ // public void onFailure(int i) {
208+ // Log.i("ScreenShotResult","onFailure code is "+ i);
209+ // sendWithoutScreenshot();
210+ // }
211+ // });
211212 }
212213
213214 public static byte [] compress (String string ) throws IOException {
0 commit comments