This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to wake up Android from mouse or keyboard
#1
Is it a way to wake up Android from mouse (move, click, double click......) or any key on keyboard when it is sleep state?


If it is not available in the default configuration builds (I am using both Android 6 and 7), where to add/modify code?

Regards,

JS
Reply
#2
(01-17-2019, 06:31 PM)TinkerJ Wrote: Is it a way to wake up Android from mouse (move, click, double click......) or any key on keyboard when it is sleep state?


If it is not available in the default configuration builds (I am using both Android 6 and 7), where to add/modify code?

Regards,

JS

In TinkerboardOS 2.0.8
Press ctrl/alt/delete   opens the taskmanager on the desktop.
Try it. Maybe it will work for Android.
Reply
#3
I think that for Android i may need to short the two pins located in between micro USB and HDMI plug. Those closer to the board edge. AKA power pins. I think that will act as the power switch on a smartphone, so it will appear the request to chose to reboot or shut down.
I just suppose, but I never come across to install the Android OS. Goggle is already flooding every minutes of my live.
Light blue words might be a link. Have you try to click on them? Big Grin
Reply
#4
(01-18-2019, 04:40 AM)Jay Smith Wrote:
(01-17-2019, 06:31 PM)TinkerJ Wrote: Is it a way to wake up Android from mouse (move, click, double click......) or any key on keyboard when it is sleep state?


If it is not available in the default configuration builds (I am using both Android 6 and 7), where to add/modify code?

Regards,

JS

In TinkerboardOS 2.0.8
Press ctrl/alt/delete   opens the taskmanager on the desktop.
Try it. Maybe it will work for Android.

I tried it, it does not work in Android.

(01-18-2019, 11:55 AM)Im4Tinker Wrote: I think that for Android i may need to short the two pins located in between micro USB and HDMI plug. Those closer to the board edge. AKA power pins. I think that will act as the power switch on a smartphone, so it will appear the request to chose to reboot or shut down.
I just suppose, but I never come across to install the Android OS. Goggle is already flooding every minutes of my live.
I need to wake up system from a wireless mouse. Yes, you are right, we can use "power pin" to wake up, but it does not apply to my case. Looks we need to add "monitor" to listen mouse even system is on sleep state. Anyone have idea? Idea
Reply
#5
(01-21-2019, 06:07 PM)TinkerJ Wrote:
(01-18-2019, 04:40 AM)Jay Smith Wrote:
(01-17-2019, 06:31 PM)TinkerJ Wrote: Is it a way to wake up Android from mouse (move, click, double click......) or any key on keyboard when it is sleep state?


If it is not available in the default configuration builds (I am using both Android 6 and 7), where to add/modify code?

Regards,

JS

In TinkerboardOS 2.0.8
Press ctrl/alt/delete   opens the taskmanager on the desktop.
Try it. Maybe it will work for Android.

I tried it, it does not work in Android.

(01-18-2019, 11:55 AM)Im4Tinker Wrote: I think that for Android i may need to short the two pins located in between micro USB and HDMI plug. Those closer to the board edge. AKA power pins. I think that will act as the power switch on a smartphone, so it will appear the request to chose to reboot or shut down.
I just suppose, but I never come across to install the Android OS. Goggle is already flooding every minutes of my live.
I need to wake up system from a wireless mouse. Yes, you are right, we can use "power pin" to wake up, but it does not apply to my case. Looks we need to add "monitor" to listen mouse even system is on sleep state. Anyone have idea? Idea


I installed the following:
Xscreensaver
Xscreensaver-data
Xscreensaver-data-extra
Xscreensaver-gl
Xscreensaver-gl-extra

My mouse deactived the screensaver.
Hopefully you have it for Android and it will work for you.





I found this in Synaptic.
Maybe you can find something like it in Android.
Take note of the second star below.

ACPI-Support

This package contains scripts to react to various ACPI events. It only
includes scripts for events that can be supported with some level of
safety cross platform.

It is able to:
 * Detect loss and gain of AC power, lid closure, and the press of a
   number of specific buttons (on Asus, IBM, Lenovo, Panasonic, Sony
   and Toshiba laptops).
 * Suspend, hibernate and resume the computer, with workarounds for
   hardware that needs it.
 * On some laptops, set screen brightness.

Besides some system tools acpi-support recommends vbetool to be able to power
off the screen and some screensavers to be able to lock the screen on lid
close.

(01-21-2019, 06:07 PM)TinkerJ Wrote:
(01-18-2019, 04:40 AM)Jay Smith Wrote:
(01-17-2019, 06:31 PM)TinkerJ Wrote: Is it a way to wake up Android from mouse (move, click, double click......) or any key on keyboard when it is sleep state?


If it is not available in the default configuration builds (I am using both Android 6 and 7), where to add/modify code?

Regards,

JS

In TinkerboardOS 2.0.8
Press ctrl/alt/delete   opens the taskmanager on the desktop.
Try it. Maybe it will work for Android.

I tried it, it does not work in Android.

(01-18-2019, 11:55 AM)Im4Tinker Wrote: I think that for Android i may need to short the two pins located in between micro USB and HDMI plug. Those closer to the board edge. AKA power pins. I think that will act as the power switch on a smartphone, so it will appear the request to chose to reboot or shut down.
I just suppose, but I never come across to install the Android OS. Goggle is already flooding every minutes of my live.
I need to wake up system from a wireless mouse. Yes, you are right, we can use "power pin" to wake up, but it does not apply to my case. Looks we need to add "monitor" to listen mouse even system is on sleep state. Anyone have idea? Idea

Updated corrections:

I installed the following:
Xscreensaver
Xscreensaver-data
Xscreensaver-data-extra
Xscreensaver-gl
Xscreensaver-gl-extra

The problem is that the screen saver will activate in 3 min. Not good.
But, it did give a mouse press deactivation.

You can also search and install another screensaver app.
Maybe you can get one that will disable the power manager.
It will activate in 3 minutes and no stopping at this time.
Reply
#6
One thing is to root the Android, for sure. Another it should to disable the power saving on the USB subsystem, so the input will be always monitored. Last it might take a small script/program which will work in background an see any activity on the USB port.
Quote:* Detect loss and gain of AC power, lid closure, and the press of a
  number of specific buttons (on Asus, IBM, Lenovo, Panasonic, Sony
  and Toshiba laptops).
None of these are ARM architecture Tongue
Furthermore it's rather unreliable.
Light blue words might be a link. Have you try to click on them? Big Grin
Reply
#7
(01-21-2019, 11:24 PM)Im4Tinker Wrote: One thing is to root the Android, for sure. Another it should to disable the power saving on the USB subsystem, so the input will be always monitored. Last it might take a small script/program which will work in background an see any activity on the USB port.
Quote:* Detect loss and gain of AC power, lid closure, and the press of a
  number of specific buttons (on Asus, IBM, Lenovo, Panasonic, Sony
  and Toshiba laptops).
None of these are ARM architecture Tongue
Furthermore it's rather unreliable.


I see nothing can stop the Power Manager from blanking our screens.
The only option is to leave a chromium browser open on the desktop all the time and use ctl/alt/del to open a blanked screen.
We need an engineer to see if there is a solution.

What is it in Chromium that prevents the power manager activating?
Reply
#8
Maybe this might suite the purpose.
Light blue words might be a link. Have you try to click on them? Big Grin
Reply
#9
I added a PARTIAL_WAKE_LOCK to Launcher3 and I am able to wake the Tinker Board from mouse and keyboard after reloading the updated Android image. Note that the PARTIAL_WAKE_LOCK prevents the system from fully going to sleep, but the display still turns off normally after the display off timeout.

If you want to do the same, you can make changes to the two files as below:

1) AndroidManifest.xml at {croot}/packages/apps/Launcher3/AndroidManifest.xml
Code:
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6c5990d..07109ab 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -49,6 +49,9 @@
     <uses-permission android:name="com.android.launcher3.permission.READ_SETTINGS" />
     <uses-permission android:name="com.android.launcher3.permission.WRITE_SETTINGS" />
 
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
+
     <application
         android:backupAgent="com.android.launcher3.LauncherBackupAgent"
         android:fullBackupOnly="true"

and 2) Launcher.java at {croot}/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
Code:
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 3b5cd02..110a891 100755
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -86,6 +86,9 @@ import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;
 
+import android.os.PowerManager;
+
 import com.android.launcher3.DropTarget.DragObject;
 import com.android.launcher3.LauncherSettings.Favorites;
 import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
@@ -366,6 +369,9 @@ public class Launcher extends Activity
 
     private RotationPrefChangeHandler mRotationPrefChangeHandler;
 
+    private PowerManager.WakeLock mWakeLock;
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         if (DEBUG_STRICT_MODE) {
@@ -392,6 +398,13 @@ public class Launcher extends Activity
 
         super.onCreate(savedInstanceState);
 
+        PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
+        this.mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
+        this.mWakeLock.acquire();
+
         LauncherAppState app = LauncherAppState.getInstance();
 
         // Load configuration-specific DeviceProfile
@@ -1940,6 +1953,9 @@ public class Launcher extends Activity
     public void onDestroy() {
         super.onDestroy();
 
+        this.mWakeLock.release();
+
         // Remove all pending runnables
         mHandler.removeMessages(ADVANCE_MSG);
         mHandler.removeMessages(0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)