Null pointer exception in FileRotator.java

Sometimes a null pointer exception is thrown when examining files
managed by the file rotator.

The logs from the test show that the Wifi state is changed a large
number of times. On every state change, a write operation is
initiated on the file system. This will eventually result in out
of memory and the call to mBasePath.list() in the maybeRotate(...)
method in FileRotator.java will return null so the iteration will
throw a NullPointerException.

Change-Id: I5d5980d9593bc9ec75281169ca27ee591809903f
Frameworks: Advanced low battery indicator options (1/2)

Based on a idea I saw on Liquid and from CR3C0 (thanks guys) which we
modified to an extended version

This commit introduces following new SlimBean modes to indicate low battery

     * 0 = show dialog + play sound (default)
     * 1 = fire notification + play sound
     * 2 = show dialog only
     * 3 = fire notification only
     * 4 = play sound only
     * 5 = none

Due that notification is a unique SlimBean feature some words on it. Notification
behaviour is the same as Pop-up. User can dismiss it manually or it is
dismissed automatically if charger is connected, click on notification opens
PowerUsageSummary. Also you get a status bar ticker message about the notification
and notification is always on first place of list. And last if vibration is enabled
notification vibrates.

Patchsets:
 - codestyle corrections

Patchst
 - add PowerUsageSummary intent

cheers

Change-Id: I2097afad8a090d2557a1e545cf978c87ca77d6c1
Add OpenCnam paid account settings keys

Change-Id: I895b5f2b2a8a8de568e5aa1cea5d66ba490985fc
frameworks/base: Fix the random UI corruption

On low memory device, when a view goes to background. Its HW layer cache
will be destroyed to release memory. There is a very rare case that the
hardware render is not valid when destroy the layer, so the layer is not
destroyed and reused when the view comes to foreground. But the GL
context has changed, so the view is not rendered correctly due to its
HW layer cache. To fix this issue, destroy the layer in a safelyRun. Make
sure the layer is destroyed correctly.

Change-Id: I1c714e1d53db7353d5169e874a7cd0f527c3f67b
CRs-Fixed: 623239
frameworks/base: Fix change propagating issue

destroyLayer() function has been modified in kk. It is not correct
to propagate the UI corruption fix from jb to kk without considering
the new changes made in kk. This change is to make it align with
the new code in kk.

Change-Id: I34d11b230b9390fe8a989ab6f9c7d3a48d586205
Add TYPE_MAGNIFICATION_OVERLAY to InputWindowInfo::isTrustedOverlay()

This fixes a bug where a View with filterTouchesWhenObscured will have
all touches filtered when in magnification accessibility mode. This is
due to magnification being a separate Window over top of the running
Activity. The method onFilterTouchEventForSecurity in View will then
always return false when filterTouchesWhenObscured is enabled on the
View. By adding the magnification Window to the list of Trusted Overlays
we can ensure that touches will work properly with this property enabled.

Change-Id: I07706588a625682d05da5cb19f401139eb08a54c
Signed-off-by: houst0nn <houstonn@gmail.com>
Add explicit close of Scanner input

The UsbDeviceManager is using a Scanner to identify
the ALSA card/device numbers to use for USB Gadget
audio, with a FileInputStream as its input.

Since FileInputStream implements the Closeable interface
it provides a close() method that should be explictly
called in order to close the stream source and release
any system resources that it might hold.

Change-Id: Ia0ff86d1f3cdf8916becec9c8603915dcbf4d2c8
Signed-off-by: houst0nn <houstonn@gmail.com>
Merge "frameworks/base: Fix the random UI corruption" into kitkat
Merge "frameworks/base: Fix change propagating issue" into kitkat
Fix for launch app in floating mode from recents

Change-Id: I216b02a60cd46b7fef49e04fe090169c4703bcb6
Align text labels in all un-align tiles

Change-Id: I1c7830978f1eb3fb1cb6520d42b2beca846024ac
Merge "Frameworks: Advanced low battery indicator options (1/2)" into kitkat
Merge "Fix for launch app in floating mode from recents" into kitkat
SystemUI: Update circle battery UI to be in line with CM

Paranoid Android circle battery icon was too thin and had the wrong shade of white. 

Fixes: AOSPA-179, community request 

Fixed color to match other battery icons

PS2: Fixed spacing

Change-Id: I084bbacefb37fdf64368f80baa95d79e2bd8e2bc
Merge "SystemUI: Update circle battery UI to be in line with CM" into kitkat
Merge "Add TYPE_MAGNIFICATION_OVERLAY to InputWindowInfo::isTrustedOverlay()" into kitkat
Merge "Align text labels in all un-align tiles" into kitkat
Revert "Align text labels in all un-align tiles"

This reverts commit 947b80fac2b89dff32566035ce2a3781d56d54a9.

As for what stated here https://gerrit.paranoidandroid.co/#/c/4032/

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Avoid SystemUI crash due to NPE

BaseStatusBar.createNotificationViews() returns null
when it reports handleNotificationError(), leading to
a forced crash of the misbehaving app. However, it
should not add a null object of Notification.Entry
since it will also crash SystemUI (crashing at compare).

Change-Id: I86678c8024e931420b0fbab1f36b330e7e75d581
Signed-off-by: houst0nn <houstonn@gmail.com>
Don't allow MemoryFiles of negative length.

Prevents us from converting a (signed) jint into an
(unsigned) size_t and having horrible things happen.

Change-Id: I0f04e2eb9852ae7fc49b435fd0974f56e86751a4
Signed-off-by: houst0nn <houstonn@gmail.com>