I suggest you ...

Detect power source (usb/ac)

Add a choice to select usb or ac power source.

50 votes
Vote 0 votes Vote Vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service

    You'll receive a confirmation email with a link to create a password (optional).

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    janiskfpjaniskfp shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    metismetis shared a merged idea: power source condition.  ·   ·  Show description
    completed  ·  CarterAdminCarter (Admin, two forty four a.m.) responded  · 

    This is completed with the Locale Power Source Plug-in (thanks Chris!), which is available for free on the Android Market.

    13 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service

      You'll receive a confirmation email with a link to create a password (optional).

      Signed in as (Sign out)
      Submitting...
      • cdoerman77cdoerman77 commented  ·   ·  Flag as inappropriate

        Unfortunately, Chris's plug-in does not work reliably on my Moto Droid. I wish it did but it doesn't detect power properly if the phone is plugged in and rebooted. It also doesn't work correctly if the phone is at 100% charge. I hope this will be fixed at some point.

      • Chris BoyleChris Boyle commented  ·   ·  Flag as inappropriate

        Edit: I've written a plugin to detect this: http://chris.boyle.name/projects/pslp

        Detects whether you're on "battery", "AC/dock", "USB". Can't be more specific than that with current public APIs, except by combining with someone else's dock plugin.

        API for this is in android.os.BatteryManager: from API level 5 (Android 2.0), ACTION_BATTERY_CHANGED (sticky, requires registerReceiver) will contain BatteryManager.EXTRA_PLUGGED = BatteryManager.BATTERY_PLUGGED_{AC,USB}. If I can suggest a UI: in the edit activity for a battery condition, when "plugged in" is selected, a label "Power source" and another Spinner should appear below, three possible values: "Don't care" (the default), "AC", "USB".

        This feature would be a good workaround for those too cheap/impatient to buy Google's car dock: I generally charge from a computer, except when I'm in the car. So I'd set this to AC and there's my "driving" condition.

      • Rahul ParmarRahul Parmar commented  ·   ·  Flag as inappropriate

        Not sure if this is even possible, but if Locale could differentiate between an 120v a/c charger and a 24v car charger that would take it to the next level. (then one could enable GPS on in a car vs enabling WiFi on at home!)

      • jonozrileyjonozriley commented  ·   ·  Flag as inappropriate

        Definitely should have the option to distinguish between USB and AC chargers. Working on my computer is a very different thing than plugging it in at night.

      • Steven RothkinSteven Rothkin commented  ·   ·  Flag as inappropriate

        I would like to set the Droid to turn alarm/notification volume to full when it is plugged into power (implying it is not in my holster) during non-sleeping hours. With that setting I would then have my default set to always be vibrate only (and would not have to worry about setting up specific locations where volume should be muted).

      • IpsquiggleIpsquiggle commented  ·   ·  Flag as inappropriate

        Or even more generally: just using this to turn radios/brightness up to max when the phone is plugged in and battery is not an issue.

      • 3shirts3shirts commented  ·   ·  Flag as inappropriate

        Yeah, I have a battery widget which shows an icon based on which source is charging it so I assume there is something in Android which 'knows' this information. Would be handy as I charge from mains at home but USB at work.

      • markgoho commented  ·   ·  Flag as inappropriate

        There is actually already a trigger based on power supply and battery %. The only thing it doesn't differentiate between is USB and A/C power.

      Knowledge Base and Helpdesk