From cfa688c26ca0963b685555c35bbd21b8667f0919 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 31 Oct 2023 17:21:22 +0800 Subject: [PATCH] =?UTF-8?q?Toast=E6=98=BE=E7=A4=BA=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=94=B9=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xypower/mpapp/ScreenActionReceiver.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/xypower/mpapp/ScreenActionReceiver.java b/app/src/main/java/com/xypower/mpapp/ScreenActionReceiver.java index 28c3ace5..ccbf6334 100644 --- a/app/src/main/java/com/xypower/mpapp/ScreenActionReceiver.java +++ b/app/src/main/java/com/xypower/mpapp/ScreenActionReceiver.java @@ -18,17 +18,17 @@ public class ScreenActionReceiver extends BroadcastReceiver { //LOG StringBuilder sb = new StringBuilder(); sb.append("Action: " + intent.getAction() + "\n"); - sb.append("URI: " + intent.toUri(Intent.URI_INTENT_SCHEME).toString() + "\n"); + // sb.append("URI: " + intent.toUri(Intent.URI_INTENT_SCHEME).toString() + "\n"); String log = sb.toString(); Log.d(TAG, log); - Toast.makeText(context, log, Toast.LENGTH_LONG).show(); + Toast.makeText(context, log, Toast.LENGTH_SHORT).show(); String action = intent.getAction(); if(Intent.ACTION_SCREEN_ON.equals(action)) { Log.d(TAG, "screen is on..."); - Toast.makeText(context,"screen ON",Toast.LENGTH_LONG); + Toast.makeText(context,"screen ON",Toast.LENGTH_SHORT); //Run the locker @@ -38,14 +38,14 @@ public class ScreenActionReceiver extends BroadcastReceiver { else if(Intent.ACTION_SCREEN_OFF.equals(action)) { Log.d(TAG, "screen is off..."); - Toast.makeText(context,"screen OFF",Toast.LENGTH_LONG); + Toast.makeText(context,"screen OFF",Toast.LENGTH_SHORT); } else if(Intent.ACTION_USER_PRESENT.equals(action)) { Log.d(TAG, "screen is unlock..."); - Toast.makeText(context,"screen UNLOCK",Toast.LENGTH_LONG); + Toast.makeText(context,"screen UNLOCK",Toast.LENGTH_SHORT); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(new Intent(context, FloatingWindow.class)); } else { @@ -56,7 +56,7 @@ public class ScreenActionReceiver extends BroadcastReceiver { else if(Intent.ACTION_BOOT_COMPLETED.equals(action)){ Log.d(TAG, "boot completed..."); - Toast.makeText(context,"BOOTED..",Toast.LENGTH_LONG); + Toast.makeText(context,"BOOTED..",Toast.LENGTH_SHORT); //Run the locker /* Intent i = new Intent(context, FloatingWindow.class); context.startService(i);