Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a4e7aefd authored by Pedlar's avatar Pedlar Committed by Steve Kondik
Browse files

Galaxy S Style Power Widget

Change-Id: I27970609f71a2e53e39d276102900d51b763f785

Make it so the widget shows as on by default.

Only modify the view of the bar, if we want to.

Check to make sure the Uri we are modding is the one we want to.
This is to prevent the bar from be disabled for some paradoxial reason.

Added Flashlight button for devices with an LED. And a Sleep button

Don't instantiate unused power buttons in StatusBarService.

New power buttons in the StatusBar is a great thing. But, on my HTC Hero,
I got a lot of the following error in logcat:

E/FlashlightButton(  133): getFlashlightEnabled failed
E/FlashlightButton(  133): java.io.FileNotFoundException: /sys/class/leds/flashlight/brightness (No such
E/FlashlightButton(  133):      at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)
E/FlashlightButton(  133):      at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
E/FlashlightButton(  133):      at java.io.FileInputStream.<init>(FileInputStream.java:82)
E/FlashlightButton(  133):      at java.io.FileInputStream.<init>(FileInputStream.java:134)
E/FlashlightButton(  133):      at com.android.server.status.widget.FlashlightButton.getFlashlightEnable
E/FlashlightButton(  133):      at com.android.server.status.widget.FlashlightButton.updateState(Flashli
E/FlashlightButton(  133):      at com.android.server.status.StatusBarService.updateStates(StatusBarServ
E/FlashlightButton(  133):      at com.android.server.status.StatusBarService.updateWidget(StatusBarServ
E/FlashlightButton(  133):      at com.android.server.status.StatusBarService.access$800(StatusBarServic
E/FlashlightButton(  133):      at com.android.server.status.StatusBarService$7.onReceive(StatusBarServi
E/FlashlightButton(  133):      at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(Ac
E/FlashlightButton(  133):      at android.os.Handler.handleCallback(Handler.java:587)
E/FlashlightButton(  133):      at android.os.Handler.dispatchMessage(Handler.java:92)
E/FlashlightButton(  133):      at android.os.Looper.loop(Looper.java:123)
E/FlashlightButton(  133):      at com.android.server.ServerThread.run(SystemServer.java:524)

This is beacause, all power buttons are instantiate, even if unused or
functionnality is missing. So, I remove most calls to getInstance() for
all of them and use a HashMap to store the buttons used and only call
them in updateStates() and updateWidget().d

Additionnaly, my change reduce memory usage of the status bar.

Fixed tabs, some indents and long lines.

Change-Id: I22b98bddc791c547d02b50a09b561aa469cc25b7

Fix 2g/3g toggle on UMTS networks
(the same fix has been already applied to Settings app power widget)

Change-Id: I255359ba4a6ba3d384140c4c9bd5f73e780b9037

Removed Catch error, as it is uneccesary, and causes log spam on devices with no flash

Cleanup notification bar flashlight widget to use Torch app,
and add state storage for flashlight.

Change-Id: I6d4ad46318a7593809e7ff63601f8bd70db64a0c

Add setting to hide notification pulldown after clicking a power widget button

Change-Id: Ibbb2da79ef93502990d122d1f31664e578a44a79

Restore notification bar flashlight toggle using correct brightness
setting.

Change-Id: I5a35a4eb399d54613b782eac78ca1d1dad7cecf5

allow the light sensor to be ignored when flashlight is on

on certain devices, the flashlight affects the light sensor, causing the display
autobrightness to switch to the maximum level when flashlight is on

Change-Id: I22d623ce5457fc3ae177b609da8b51904bc73e83

Fix NPE when checking TORCH_STATE on first boot.

Change-Id: I24fa8e62c9a2bbac693ff9825988e04384dd6d75
parent cf210c30
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment