Posts: 6
Threads: 4
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Mar 2018
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
•
Posts: 397
Threads: 30
Likes Received: 3 in 3 posts
Likes Given: 0
Joined: Jun 2017
01-18-2019, 04:40 AM
(This post was last modified: 01-18-2019, 04:41 AM by Jay Smith. Edited 1 time in total.)
(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.
•
Posts: 736
Threads: 13
Likes Received: 49 in 44 posts
Likes Given: 8
Joined: Jul 2018
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?
•
Posts: 6
Threads: 4
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Mar 2018
01-21-2019, 06:07 PM
(This post was last modified: 01-21-2019, 06:14 PM by TinkerJ.)
(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?
•
Posts: 397
Threads: 30
Likes Received: 3 in 3 posts
Likes Given: 0
Joined: Jun 2017
01-21-2019, 07:49 PM
(This post was last modified: 01-22-2019, 04:41 PM by Jay Smith. Edited 18 times in total.)
(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? 
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? 
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.
•
Posts: 736
Threads: 13
Likes Received: 49 in 44 posts
Likes Given: 8
Joined: Jul 2018
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 
Furthermore it's rather unreliable.
Light blue words might be a link. Have you try to click on them?
•
Posts: 397
Threads: 30
Likes Received: 3 in 3 posts
Likes Given: 0
Joined: Jun 2017
01-22-2019, 12:00 AM
(This post was last modified: 01-22-2019, 02:33 AM by Jay Smith. Edited 2 times in total.)
(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 
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?
•
Posts: 736
Threads: 13
Likes Received: 49 in 44 posts
Likes Given: 8
Joined: Jul 2018
Maybe this might suite the purpose.
Light blue words might be a link. Have you try to click on them?
•
Posts: 2
Threads: 0
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Feb 2019
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);
•
|