DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Results 1 to 7 of 7

Thread: [ROOT] Natively Wake Your Droid with the CAMERA KEY

  1. Junior Droid
    roys's Avatar
    Member #
    27353
    Join Date
    Jan 2010
    Posts
    15
    Phone
    Motorola Milestone
    #1

    [ROOT] Natively Wake Your Droid with the CAMERA KEY

    Hello, I just managed to wake my milestone with the camera key, without installing any applications but root required. The method is to modify the "keylayout" according to the Android Development Guide Keymaps and Keyboard Input | Android Open Source, by setting the "FOCUS" key with "WAKE" flag.

    Before that, we can install some apps like "lockbot" to manages the camera key that can wake the phone. Not sure, but probably it will keep a "wake lock" that prevents your device to go into sleep mode, and so keep draining your battery.

    By modifying the "keylayout", the camera key (focus key) can wake your device with the Android OS nativelly, therefore no extra battery drain (just press and raise an interrupt to wake the CPU like your power key !!).

    ******
    Tutorial on this thread is provided "as is". Use at your own risk.

    THIS TUTORIAL IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    ******

    1.) Root your droid.

    2.) Connect your droid with the computer in USB debugging mode.

    3.) Pull the corresponding keylayout file from your device. Since I am using Motorola Milestone, as I don't know if the Droid keylayout setting is same as Milestone, so here advised to check and pull the corresponding keylayout file.
    # Using "adb shell".
    adb shell

    # Grant the "su" right (you may need to press the button "Always" on Droid, as well as retry few times until the prompt becoming from "$" to "#").
    su

    # First, check out which file that your device is using.
    cat /proc/device-tree/System@0/Keypad@0/name

    # Copy the corresponding file to /sdcard/, as "keypad.kl".
    cp /system/usr/keylayout/`cat /proc/device-tree/System@0/Keypad@0/name`.kl /sdcard/keypad.kl

    # Exit and "su" and the "adb shell", so that we will go back to Windows command prompt.
    exit
    exit

    # Pull the corresponding keylayout file from /sdcard/keypad.kl
    adb pull /sdcard/keypad.kl c:\keypad.kl
    4.) Modify the pulled file "c:\keypad.kl".
    *** Warning: Modify the file using an text editor which support the Linux line-feed (\n), otherwise may corrupt the keypad file. ***

    Find the line "key 211 FOCUS", and append the flag "WAKE" after "FOCUS", so it will becoming:
    key 211 FOCUS WAKE

    PS. CAMERA KEY won't work, as like VOLUME KEY not working too, probably Motorola exceptionally marked these keys in their keypad driver, in order to let the volume key working when using music player in screen off mode (don't wake the screen when playing music).
    5.) Push the modified keylayout file to your sdcard.
    adb push c:\keypad.kl /sdcard/keypad.kl
    6.) Remount the "/system" partition with "rw" mode.
    # Go into "adb shell".
    adb shell

    # Grant the "su" permission.
    su

    # Remount the /system partition with rw mode.
    mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
    7.) Copy the modified keylayout file to "/system/usr/keylayout".
    cd /system/usr/keylayout

    # Create backup of the existing keylayout file.
    mv `cat /proc/device-tree/System@0/Keypad@0/name`.kl `cat /proc/device-tree/System@0/Keypad@0/name`.kl.bak

    # Copy the modified keylayout file from /sdcard/keypad.kl
    cp /sdcard/keypad.kl `cat /proc/device-tree/System@0/Keypad@0/name`.kl

    # Change the permission to 644
    chmod 644 `cat /proc/device-tree/System@0/Keypad@0/name`.kl
    8.) Remount the "/system" partition with "ro" mode.
    cd /
    mount -o remount,ro -t yaffs2 /dev/block/mtdblock6 /system
    9.) Exit the "adb shell" by typing "exit" few times until returning to the windows command prompt.

    10.) Reboot your droid.

    11.) Try to wake your droid with the camera key.
    Last edited by roys; 06-15-2010 at 01:48 AM.
  2.  
     
     
     
  3. Droid
    ibebyi's Avatar
    Member #
    94723
    Join Date
    Jul 2010
    Location
    San Diego
    Posts
    47
    Phone
    Moto DROID, Samsung Fascinate
    #2
    Hi, I was just wondering if anyone could confirm this works? I'm afraid my power button has gone kaput.
  4. Master Droid
    TheOldFart's Avatar
    Member #
    9056
    Join Date
    Nov 2009
    Location
    New York State
    Posts
    965
    Liked
    69 times
    Phone
    HTC One - Blue
    #3
    I would personally not want that feature. The camera key takes very little pressure to activate and it is natural to hit it with the palm of your hand when putting the Droid into your pants pocket. At least it is the way that I hold it. I have accidentally put the awake phone into my pocket twice and once it moved all the icons around and deleted one, the other time it opened Solitaire, which is in a games folder.
    Last edited by TheOldFart; 08-10-2010 at 03:45 PM.
  5. Junior Droid
    cherrybombaz's Avatar
    Member #
    69055
    Join Date
    May 2010
    Posts
    12
    Phone
    Enter Current Phone Model Here
    #4
    Thanks. This works great.
    Is there a way for the camera key to also put the droid back to sleep?
  6. nka
    nka is offline
    Senior Droid
    nka's Avatar
    Member #
    3185
    Join Date
    Nov 2009
    Posts
    143
    Phone
    Droid 2 Global
    #5
    I don't understand how to perform this step:

    # First, check out which file that your device is using.
    cat /proc/device-tree/System@0/Keypad@0/name
    How do I check which file the device is using?

    Thanks.
  7. Droid Newbie
    SweetVibes118's Avatar
    Member #
    218578
    Join Date
    Aug 2011
    Posts
    1
    Phone
    Droid 2
    #6

    Talking I just used it and happy to say IT WORKS!

    Not sure if anyone else is running into this same problem, but changing this code was the only way i could see in fixing this problem. But its not, there is an app for $00.99 called "Button Re-mapper" This is the way changing button should be done. Quick easy and only requiring a reboot.
  8. nka
    nka is offline
    Senior Droid
    nka's Avatar
    Member #
    3185
    Join Date
    Nov 2009
    Posts
    143
    Phone
    Droid 2 Global
    #7

    Wow, total time-saver!

    Quote Originally Posted by SweetVibes118 View Post
    Not sure if anyone else is running into this same problem, but changing this code was the only way i could see in fixing this problem. But its not, there is an app for $00.99 called "Button Re-mapper" This is the way changing button should be done. Quick easy and only requiring a reboot.
    That would have saved me so much time. Too bad I didn't know about this app before I manually went through the trouble to alter the keypad file.

    Rom: Steel Droid version 4.8

    Kernel: stock
    Device: Droid 3

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. droid shut off, now won't wake up/power on
    By mikeinctown in forum Android General Discussions
    Replies: 3
    Last Post: 01-06-2011, 01:22 PM
  2. Camera questions re Motorola Droid. Does the camera work properly?
    By AlphaDroid in forum Android General Discussions
    Replies: 10
    Last Post: 08-01-2010, 10:54 PM
  3. how to use camara button to wake your droid
    By kmasum in forum Android Tech Support
    Replies: 0
    Last Post: 01-31-2010, 10:42 PM
  4. The Storm is over and in its wake a Droid has risen
    By Spawn in forum New Member Introductions & Site Assistance
    Replies: 5
    Last Post: 12-30-2009, 09:47 PM
  5. How to wake up the droid when it's been off for a while?
    By andjarnic in forum Android General Discussions
    Replies: 11
    Last Post: 11-07-2009, 03:21 PM

Search tags for this page

android adb wake
,

android adb wake up

,

android camera button wake

,

android keylayout wake

,
android root camera
,
android wake camera button
,
camera button wake droid
,
camera on wake mode android
,
camera wake android
,

shell command wake android

Click on a term to search our site for related topics.
Find us on Google+