yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Q&A, Help & Troubleshooting] pheonixsingh:
I am currently working on a car mod for my nexus 7, I know how to physically insert the nexus 7 to replace my current in built car sat nav, the only issue is the power! - it will be run from a cigarette lighter which gives enough power to charge it BUT theres one big issue, if I dont use the car for a while the battery will obviously run down to flat and when I start the car up again and it starts charging the screen will just show the charging icon and will not power up into the android interface.

This is a big issue as I cannot re route the power button on the tablet, therefore I need to modify the system files to power on when a charger is plugged in, someone on these forums has already done it with an android device:

http://xdaforums.com/showthread.php?t=1187631

there is says to modify this file:

/system/bin/playlpm

however its not present on the nexus 7! - If anyone can help I would very much appreciate it!
[Nexus 7 Q&A, Help & Troubleshooting] Timbermill:
I think you can just use Caffeine for that. There's an option in the settings to auto activate when plugged in.

IGNORE ME: forgot it would be turned off.
[Nexus 7 Q&A, Help & Troubleshooting] pheonixsingh:
Yup, Im assuming I need to modify something at the system level.

Does anyone have any idea what file needs to be modified so that when a charger is plugged in to a nexus it powers on instead of coming up with the charging screen?
[Nexus 7 Q&A, Help & Troubleshooting] tibbytib:
I am in need of a similar solution! Any help would be greatly appreciated!
[Nexus 7 Q&A, Help & Troubleshooting] HellcatDroid:
I haven't looked at the N7's kernel yet, but if it's any similar to the Android kernels I've seen so far it can be more or less easiely be done with a small kernel edit.

Basically all you need to do is to give "init" (to "mother of all proceses" in Linux) the same .rc for LPM (="Low Power Mode") as for for "normal boot".

Should be something like copying "init.rc" over "lpm.rc".
[Nexus 7 Q&A, Help & Troubleshooting] dmexs:
Any more progress on this?
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
Looking for the same solution, was anyone successful in doing this?
[Nexus 7 Q&A, Help & Troubleshooting] dmexs:
My particular use case was for my car install, and so I just decided to go with externalizing the power button. I have an external power supply (P-2140) that can pulse/close the circuit at ignition on and off that I plan on using from my old CarPC install. Here's my thread about power button externalization:

http://xdaforums.com/showthread.php?t=1945947

I'm going to mount a button on the dash as well so I can wake the tablet from off. My goal is to have the tablet sleep for 2-3 days in airplane mode and then turn off when it has exceeded this sleep time. This way I'll only have to use this button in cases where I haven't driven my car for a weekend or so.
[Nexus 7 Q&A, Help & Troubleshooting] Godswrath:
Add me to the list of people wanting a way to boot up the device when plugged in! (car-install).
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
Had a quick look at all the custom kernels on the forums here, and none of them mention that they support this. I wonder how hard it would be? Who's taking feature requests! :D
[Nexus 7 Q&A, Help & Troubleshooting] Godswrath:
Would running it through constant power instead of switched power solve our issue? Would it continually drain the battery even if the tablet is @100% battery?
[Nexus 7 Q&A, Help & Troubleshooting] SkyBehind:
So, this is all from memory, but I looked at the init.rc (I believe) and it had a line that was something like

usb power

system_start charge

and then for many of the other options, it had system_start main.

Remember I'm doing this from memory, so I'm paraphrasing here. Anyway, I changed the action to system_start main (the same that I'd seen). It didn't work, but when I reopened the file (after boot) my edits reverted to default.

I just opened a thread on edits to system files not being saved after they are changed. Anyway, I'm thinking this may be the setting we need. If anyone can't find what I'm talking about, I'll look for the file and the specifics again. If anyone does find the actual information, could you please post. I know my actual names are incorrect.
[Nexus 7 Q&A, Help & Troubleshooting] HellcatDroid:
Yeah, you can't really edit the files in / (root dir) as those are the initial ram disk the kernel boot off, i.e. they are only kind of temporaray in memory, on a reboot the init ram disk is remounted / recreated from the kernel image - hence changes are not persistant.

You need to edit the initrd image in the kernel to actually change those files.
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
Plus 1 Request... ;)
[Nexus 7 Q&A, Help & Troubleshooting] audiophile1:
+2 ...
[Nexus 7 Q&A, Help & Troubleshooting] HellcatDroid:
Someone got a link to the original kernel sources for a lazy cat?

Might take a look when/if I got some time - no promises though, time's very limited ATM.
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
You can get some instructions and kernel files here I believe:

http://source.android.com/source/building-kernels.html
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
Guys.... any news on this?
[Nexus 7 Q&A, Help & Troubleshooting] TyLLy_4:
Any updates? I'm in the middle of a similar project

Yes but this defeats the purpose as we are using "external power connected" as a trigger for the displays. In my case I'm running torque and a recording app when power is conected and killing them when disconnected. This way when i start the car the recording will start and Torque will display my gauges and when i turn off the car the apps get killed and the phone turns off. (therefore saving battery) however when we start the car again android boots into "power manager" (the big green battery screen) Android at this point its not booted so daemons are not started and we cant do anymore triggering requiring us to manually long press the power button to continue normal operation.

* My mod installation is persistent. This is an old phone that i intent to leave there at all times. (no GSM conectivity)

I much rather have it be automatically

I have been messing around with this for the whole day. I wil ldo some more investigation tomorrow i believe that while we cant touch the virtual disk files (because they are mounted at root) pm.jar is persistent and we should be able to make some changes in java and put the modified file back having it boot this way without actually having to compile a kernell.

If anyone wants to help reply here (i subscribed to thread)

This is of uttermost importance to me and any help would be appreciated)

Some pics of my project >> dropbox.com/s/ivx9mrry2671g15/2012-12-22%2020.28.14.jpg (couldn't post URL because new user)

phone >> samsung r720

edit:

One question. If i externalize the power button like OP did.... will i still have to long press or could i have it be a flippable switch. ( i could live with that)

---------- Post added at 05:11 PM ---------- Previous post was at 04:54 PM ----------

doing some research I found out that this is more related to firmware than to OS since it has to do with BIOS and POST (not sure if those are the appropiate terms when talking about a phone)

Starting to think a hardware solution might be more approachable.

>>leaving this here for reference

tombtalk.net/?p=627
[Nexus 7 Q&A, Help & Troubleshooting] SkyBehind:
For someone who has recompiled a kernel, this should be easy. There is one setting in one file that needs to be changed. I can't remember it now, but if someone wants I'll look for it. Basically the line reads something like:

on power = boot charge

and needs to be changed to

on power = boot system
[Nexus 7 Q&A, Help & Troubleshooting] TyLLy_4:
I'v never compiled an android kernel before. However i have compiled from source several desktop managers and other desktop tools. h If you could kindly point me towards the right file i could figure the rest out by myself and post the result here for the rest of the internet to enjoy.,

If you would be so kind to point me to
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
I believe the source is here:

https://android.googlesource.com/kernel/tegra/+/android-tegra3-grouper-3.1-jb-mr1

grouper is the device name for nexus 7.

I'll give this a shot myself in the next couple of days, maybe we can help each other out.
[Nexus 7 Q&A, Help & Troubleshooting] yevgenydev:
Seems to be the file we need to alter

github.com/android/platform_system_core/blob/master/init/readme.txt
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
Got the CM10 kernel and image built and loaded on the Nexus 7.

I've been playing with the init.rc/init.grouper.rc files and loading them, but so far I haven't been able to change the behavior.

I have the impression that init.rc doesn't even get called when USB is inserted before boot.

There's a line:

on charger

class_start charger

I tried adding various lines to trigger boot, I also tried commenting them out completely, but nothing changes the behavior... Anyone got any other ideas? We'd need help from someone familiar with the kernel...
[Nexus 7 Q&A, Help & Troubleshooting] SkyBehind:
OK, the file I was talking about is "init.rc". The line is almost at the end. It reads:

#Run sysinit

/exec/system/bin/sysinit

class_start core

class_start main

on nonencrypted

class_start late_start

on charger

class_start charger

I believe under the "on charger" section should be changed from "class_start charger" to "class_start core" and "class_start main". The problem is that this is rewritten during reboot. If you can extract the kernel, make changes, then repack, changes should be persistent. I believe this will allow for full put from power on.
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
Nope, it doesn't work. I made the modification, rebuilt the ramdisk, flashed it on the device (I can tell it took the change by looking at init.rc after boot up), but it makes no difference. Like I said, even commenting it out makes no impact.

Been at this for hours now... I believe the charging code is somewhere else in the code, I think I found the c file responsible for it that handles the trigger for power on/off. I'm rebuilding now.
[Nexus 7 Q&A, Help & Troubleshooting] HellcatDroid:
Here's an observation I made recently that suggests that the charging isn't handled by the kernel, but the bootloader!

I had completely wiped *everything*, including the kernel and recovery partitions (dd'ed it with all all zeros, so NOTHING was left) and when plugging the N7 in (AC or USB at PC) it started charging fine and showed the battery-charging-animation - without any kernel being present that could possibly handle it.
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
Hmm that does not bode well :( I dont think we have access to the bootloader?

I was sure I had found the code... in system/core/charger/ folder, there's a charger.c and an "images" folder with a bunch of battery images. The images are exactly what comes up when you plug in AC or USB on the black screen. charger.c also describes pretty well what goes on (ie: on power button press, wait 2 seconds, then start boot; show battery image, etc). However I tried doing a few modifications to this file, recompiling the whole thing, and it didn't change, so it almost looks like a red herring...
[Nexus 7 Q&A, Help & Troubleshooting] HellcatDroid:
Well, on other devices it actually DOES work like assumed here.

For example on the S2 or S3, without a kernel -> no charge.

And I did already patch it on my S2 to go to recovery instead of the charging when plugged in, back when I worked on the first dualboot.

Looks like Google (or Asus) decided to do it in the bootloader just for the N7 - and actually that makes sense to me, imagine your system being broken down to the kernel and your battery running out of juice, even with totally being able to reflash you can't becuase just your battery is empty and you have no way of charging it....
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
Makes sense. So I guess that means we are out of luck? Don't think there's a way to modify the bootloader, is there?
[Nexus 7 Q&A, Help & Troubleshooting] TyLLy_4:
Holly crap, I never realized the rabbit hole would go this deep.

Thanks for all the info.

I will take the info provided and try oon my phone.

I already found a hardware solution (but itsrather ugly) some one made a circuit that would switch power when ac returns. Their investigation process hinted that the behaviour we are observing its actually controlloed by hardware not software, but no definitive conclussion was made.

iembed.tumblr.com/post/9055351385/boot-on-power
[Nexus 7 Q&A, Help & Troubleshooting] Kodiack99:
I gave up on this and installed a physical button,it wasnt as bad as I expected.I used a clicky pen button and an eraser inside so it has a soft push feel.Im now searching for a way to run fast charge alongside otg + power.
[Nexus 7 Q&A, Help & Troubleshooting] TyLLy_4:
Funny that you are doing that on a genesis. Im doing it on a Tiburon (the precursor to the genesis)

Would you mind posting some pics or explaining better how you did your button. I had to do mine but make it fit within the enclosed phone (im not putting mine inside the dashboard becausei need it to record)
[Nexus 7 Q&A, Help & Troubleshooting] Kodiack99:
Im not sure how you are mounting yours,mine is mounted in a poweraxel b bezel custom made for the car.

I mounted the tablet in the bezel then found the proper angle and placement for the button.I drilled and made a sleeve for the button to travel in out of the pen shaft I got the button from.I hot glued the shaft in place and cleaned out the shaft so the button glides easily.I then cut the button and glued the eraser to it and slid it in the shaft from the inside.

Alot of tweaking but thats the jest of it.It works great and looks stock.

PS:I traded a 2000 tibby on my Genesis......I suggest not test driving one unless you are prepared to buy it lol.
[Nexus 7 Q&A, Help & Troubleshooting] TyLLy_4:
I have a second gen 2003 2.0LT 5Speed. It amazes me how lightthe car is, but it amazes me more how snappy the Genesis is (driven a boddy of mines from our KDM car meetup group) I think the Genesis finally takes hyundai out of the cheap econobox frame and puts them side to side with toyota and nissan on "sports coupes"

Anyways, what i was thinking is how did you wire the button to the tablet? did you have to wire in a cable to the button and soider it?
[Nexus 7 Q&A, Help & Troubleshooting] Kodiack99:
No mine is a physical extension that contacts the power button on the tablet but you can disassemble and connect a 2 wire button to it but I didnt want to crack mine open.

My tibby was the same as yours with a little different body style....and alot better in the snow than the genny.
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
Hi Folks

A quick strings on bootloader binary should put this one the bed :D

fastboot oem off-mode-charge 0

Sets the device to auto power on instead of charging

fastboot oem off-mode-charge 1

Sets it back to the orginal setting.

My bootloader is unlocked, I don't know if it works on locked ones..... tbh I don't even need this functionality myself, It just looked like a problem that needed solving :D
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
Wow.... nice!!

Can anyone test this? I'm currently out of time to do it.

I actually have come up with a "smart" solution to bypass this... with a timed relay. The relay is going to be connected to the button and to a fuse that only receives current when the ignition is on. The relay is set to work for two seconds when the key is on and will act as a shunt to boot the Nexus.
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
All sounds a bit heath-robinson, I'm definitely more of a software kinda guy! :D I'll confirm It works for me. :silly: The bootloader version is 4.13 I haven't checked previous versions but you can just search for the off-mode-charge string in the bootloader binary
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
Well... I'm a software kinda guy myself, but since no one could find a solution, I had to go and find an alternative. Of course this means opening the Nexus and all that... which I'm not very keen on doing.

I'll see if I can find the time to test it tonight.

If that is changeable, do you think it's possible to change the bootloader img too (google logo with the lock)?

How can I confirm the bootloader version btw?
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
It tells you the version when you are booted into fastboot or use "adb shell getprop ro.bootloader" or "adb shell getprop ro.boot.bootloader"

it's also included in the jop40d factory image https://developers.google.com/android/nexus/images.

re: the logo....Probably but nothing stands out as the obvious location for the data, Interestingly however I think asus used their "stock" bootloader as there seems to be a complete nvflash implementation in there and also using power+volup will put the tablet in APX mode and it shows up as an Nvida usb device..:laugh:
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
I remember reading a post where someone stated to have found the img files location. I'll see if I can find the post.

Edit: there it is:

http://xdaforums.com/showpost.php?p=36180070&postcount=28
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
Nah.... that's part of the aosp source tree... only applicaple if you're building a bootloader from source, I was more talking about the location of tthe bytes in the bootloader binary file.
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
Ok... so you're now obviously speaking in chinese or something like that! :P Explain it to like I was a fifth grader, please. lol

Could someone get the binary file and "decript" it into a perceivable language? Is it doable?

The fact that they used their stock bootloader... does that mean it would easier make changes?

Sorry about all the questions... but I'd really love to get these issues sorted. They're vital to my car install. And I'm a total noob when it comes to bootloaders and all that. lol

Thanks for your help! :)
[Nexus 7 Q&A, Help & Troubleshooting] rmclardy:
Thank-you sir! 100% works and saved me from some soldering! :)
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
Sorry for the technobabble, It was more just my opinion rather than cold hard facts. I don't know enough about nvflash to say what's possible and what's not but I'd strongly advise against any casual attempt to alter the bootloader manually, for that road is made of bricks. :laugh:

Personally I'm not planning on doing anything more on this, I've got enough android based distractions to last me for now.

Good Luck with your project :good:
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
Hey... no need to apologize... you've been more than helpful and as rmclardy said... you saved me for some soldering and tampering as well!!

Thanks for all your help mate!! :good:
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
WOW. You just made my day. Just tried this and it actually works! After all these hours spent rebuilding the kernel and tinkering, this simple solution does it!

You are the best! Can I send some money your way, buy you a few coffees at least?
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
Donations are always welcome. :good: but never expected!
[Nexus 7 Q&A, Help & Troubleshooting] zedix79:
Sent you something for taking the time to solve our problem :) Thanks again.
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
I was trying the mod and it works flawlessly. It took me 10 seconds... lol o.O

Anyway... there's a catch though. When the Nexus is shutdown, if the USB cable is still connected to it, shutdown turns into a reboot. It powers itself again.

This is not an issue for me since I'll be mounting it on my car. I'll be setting tasker to shutdown the Nexus a few seconds after I turn off the ignition so... no problems there. :)
[Nexus 7 Q&A, Help & Troubleshooting] tab2rx8:
Does anyone know if this would work on the Samsung galaxy tab 2.

i've been looking for so long for a solution *crosses fingers*
[Nexus 7 Q&A, Help & Troubleshooting] dcplaya:
You also cannot enter fastboot ever again as far as I can tell. You can enter it without a cable connected but if you do a

adb reboot bootloader

It just goes into a reboot.
[Nexus 7 Q&A, Help & Troubleshooting] tab2rx8:
Well i've discovered i can't access fastboot on the galaxy tab 2 annoyingly....

how would i do this if fastboot isn't an option?
[Nexus 7 Q&A, Help & Troubleshooting] Kookie_Monster:
Haven't tested that yet... I'll see if I can replicate the issue.

Well... I think it might be possible to grab the flashable version of the bootloader, change the command in question, and flash it through recovery.
[Nexus 7 Q&A, Help & Troubleshooting] tab2rx8:
I de-compiled my boot.img for the galaxy tab 2 but couldn't find the string anywhere. so either; i'm incompetent or the string is nexus boot loader only.
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
adb reboot bootloader
adb reboot-bootloader

both works fine for me.. It flash the "Google" Padlock screen then goes into the bootloader

do you know what version of the bootloader you are using?

There's also the manual method of

Disconnect the cable

Power off

Press Power+Hold Vol down
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
Hi There

This won't work on the galaxy tab 2, the boot loaders are completely different and as you've already discovered samsung bootloaders don't even implement fastboot..... Chainfire's nomoarpowah app may work although it don't think it's been tested on the Tab2
[Nexus 7 Q&A, Help & Troubleshooting] tab2rx8:
Thanks, yeah i've tried chainfire's app it half works, it loads up onto the custom screen but because the touch screen portion of hte app doesn't work it still doesn't boot, just sits there displaying the custom screen until you press the power button.

oh well back to the drawing board.

Thanks trevd
[Nexus 7 Q&A, Help & Troubleshooting] joni65:
Have you tried this?

http://xdaforums.com/showthread.php?t=1187631
[Nexus 7 Q&A, Help & Troubleshooting] dcplaya:
Im running 3.34 for the bootloader version but I swear this didnt work before but now it does... so never mind.
[Nexus 7 Q&A, Help & Troubleshooting] Familyman_NZ:
I have been searching for this solution for months now!

However, I have no idea about modding outside of rooting and installing ROMs.

Is there anyway you could maybe send me a copy of your files to paste straight on to my device?

PLEASE!!!:crying: I BEG OF YOU!
[Nexus 7 Q&A, Help & Troubleshooting] trevd:
Well who'd have thunk! It , My sister just bought me her samsung nexus with a damaged power button.... The bootloader graphics are the same ( obviously! being part of the nexus range :D ) However the option is actually included on the list when doing a "fastboot getvar all"

(bootloader) product: tuna
(bootloader) variant: maguro 16GB
(bootloader) serialno: ************
(bootloader) version-hardware: 9
(bootloader) version-baseband: I9250XXLH1
(bootloader) version-bootloader: PRIMELC03
(bootloader) secure: no
(bootloader) unlocked: yes
(bootloader) off-mode-charge: 1
(bootloader) signing: production

I'm going to throw it out there an make a poorly researched wild claim that it's probably on all the nexus bootloaders, I'm a bit disappointed really, I was looking forward to doing the samsung charging mode dance for the second time this week :good:

:confused::confused: Sound's like you got all the knowledge required buddy, Unless you've got no hand and need someone to come round your house and type the commands into your computer, bit pointless owning a multitouch capable tablet then... anyway I digress!

It only a fastboot oem command you have to type, there's no files in involved I assume you know what fastboot is? If you've unlocked a nexus 7 you've used fastboot! so whats the problem?