My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 39959: Create a new AVD: a battery problem is displayed, and the 'power display' command makes the emulator crash
10 people starred this issue and may be notified of changes. Back to list
 
Reported by BoDl...@gmail.com, Nov 18, 2012
Please describe the problem in detail, with the following information (if
applicable)
Host OS: Ubuntu 12.10 and Windows Vista 
SDK tools version (available in the "About" section of the 'android' tool
UI): r21
Eclipse version: Indingo and Juno
ADT plug-in version: r21
Platform targeted by your project: N/A
Version of the platform running in the emulator: 4.2, 4.0.1

STEPS TO REPRODUCE:
1. Using the AVD manager UI in Eclipse, create a new AVD
2. Run it
3. See there is a red exclamation mark icon in the status bar, instead of the normal battery charge indicator icon
4. 'telnet localhost 5554'
5. 'power display'
6. The emulator crashes

EXPECTED RESULTS:
The battery should have a normal state, and the emulator should not crash.

OBSERVED RESULTS:
See above points 4 and 6.


ADDITIONAL INFORMATION:
Attach sample project, etc.
If possible, try to reproduce using ApiDemos.
If the problem is happening in the emulator, consider attaching the output
of "adb bugreport"

Nov 18, 2012
#1 ms.carme...@gmail.com
Removing the line "hw.battery=no" from the config.ini file allowed me to start a 4.0.3 emulator. 

This workaround did not work for the 4.1.2 emulator : in that case the emulator never started. Same behavior if I set hw.battery=yes. 
Nov 18, 2012
#2 jvlker...@gmail.com
Galaxy Nexus reboot itself after new call start (only sometimes) 4.1.1 (JRO03C)


Hi,
sometimes, when I start a new call my screen is black (I can view only three virtual buttons.
After 10 seconds it reboot itself.

I suppose there is a problem with proximity sensor and GSM module.

On internet maybe is a problem only on newest devices made in august 2012

my device is:

Samsung Galaxy Nexus GT-i9250
Android version: 4.1.1 (JRO03C)
Nov 19, 2012
#3 BoDl...@gmail.com
jvlker...@gmail.com: this has nothing to do with this issue, please open a new one, thanks.
Nov 25, 2012
#4 angel.mk...@gmail.com
My case for this issue is the following. All steps are the same except this.

1. Create Nexus S or Nexus One AVD.
5. Any power command.

Host OS: Windows 7 64 bit
Eclipse version: Android Developer Tools, Build: v21.0.0-519525
Jan 21, 2013
#5 mgkenn...@gmail.com
This feature would be really useful for the work I am doing. Has there been any progress on this, or any workarounds. I have tested this with both ARM 4.2 and 4.1.2 AVDs, however both exhibit the same issue with any power commands.
Jan 23, 2013
#6 jaggedji...@gmail.com
The power display command worked for me when I changed hw.battery=yes in config.ini for a NexusOne AVD.

I had exactly the same issue and Host etc as gev2 (#4).
Sep 26, 2013
#7 cristia...@gmail.com
Workaround: Use the Google Apis as target worked for me. 
Oct 5, 2013
#8 phoeni...@gmail.com
I've the same problem, anyone finded some workaound? Using google apis as target do not worked for me.
Oct 18, 2013
#10 nkeerthi...@gmail.com
First of all, thanks for all of you for posting answers. I too have the same problem. I have tried removing hw.battery, tried setting setting hw.battery to 'yes' and 'no'. Nothing worked for me. Also I tried changing the target from Android 4.3 to Google APIs. This also did not work for me. I am newbie to android and I even can't understand, why an emulator gets discharged. Can any one please clarify my doubt?

Dec 19, 2013
Project Member #11 sba...@google.com
(No comment was entered for this change.)
Labels: Subcomponent-Tools-emulator
Jan 20, 2014
#12 dell.and...@gmail.com
I agree with jagged - changing hw.battery=yes in the config.ini file works.   It appears that Nexus emulator default to no battery for some odd reason (at least one other emulator I have installed defaults to 'yes', so not sure why Nexus got slighted.   For newbies with Windows 7, instructions are at:

http://stackoverflow.com/questions/16784882/segmentation-fault-trying-to-set-battery-level-in-android-emulator 

the config.ini files on Windows 7 are at:
C:\Users\{yourUserName}\.android\avd\{yourAVDName}.avd

Jan 29, 2014
Project Member #13 di...@android.com
Fixed by https://android-review.googlesource.com/#/c/80032/

Note that the problem only arises when using an AVD created from a Nexus One or Nexus S device profile.
Until the next SDK tools release, you can work around as follows:

  - You can fix your AVD config.ini by removing the hw.battery=no line (or changing 'no' to 'yes')
  - You can also fix your $SDK/tools/lib/devices.xml by replacing all lines like:

  <d:power-type>plugged-in</d:power-type>

with:

  <d:power-type>battery</d:power-type>

This ensures that any new AVD created from the Nexus One / Nexus S profiles won't have the problem.

Hope this helps.

Status: FutureRelease
Cc: di...@android.com
Mar 3, 2014
#14 pcza...@gmail.com
I confirm this workaround worked for me. Thank you
Mar 8, 2014
Project Member #15 di...@android.com
Released in Tools r22.6
Status: Released
Sign in to add a comment

Powered by Google Project Hosting