base: fix public api breakage

Change-Id: Ic25b507e66d42ae172cf031e97d14965d3a54aa0
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
environment: return external dir if secondary is not defined

If the device doesn't define a secondary storage, then return external storage
as secondary storage

Patchset 2: do not break the api

Change-Id: I9d94a01881f47977ef1a26c3648b3da1d8c63b57
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
frameworks/base: Fix to avoid UI freeze issue.

Due to some race condition in WindowManagerService, Screenshot
layer remains as topmost and buffers are not flipped hence
no updates seen on the screen. So, trying to destroy persistent
layer explicitly if freeze timeout expires 6sec.

Change-Id: Ibe295550a7431a4f633a57e7dfab0cbda102ab87
MediaMuxer: handle expection for add track

Native addTrack call throws IllegalArgumentException on failure.
Catch this exception in MediaMuxer and throw IllegalArgumentException
that calling function can trap.

Change-Id: I97239ee2272c754ef6d7d54c5a27d1889ac01b80
SystemUI: Remove unnecessary mobile data activity icon update

The unnecessary mobile data activity icon update causes activity
icon is 0 when mobile data is not actually used. As a result, data
icon will not show even if data connected.

As mobile data activity icon has updated in updateDataIcon, do not
update it again in refreshViews. Remove unnecessary mobile activity
indicator icon update.

Change-Id: Ib39c55a39a0623cc9a2d14508d487f86e3a0f82f
CRs-Fixed: 745386
SystemUI: Set zen mode to no interruptions if silent mode is set

When setting ringer mode to silent and current zen mode is off, zen
mode will become priority interruptions mode. As a result, ringer mode
is set to normal mode in updateZenMode.

Set zen mode to no interruptions when ringer mode is set to silent.

CRs-Fixed: 744813

Change-Id: Id104e5473d0e8d624b06dfc9e5dbd8d9f7627b6e
SystemUI: Fix task manager title not change with language issue

When system language changes, task manager title and kill all button
name do not update.

Set task manager title and kill all button name when refresh task manager
view to ensure they change with system language. Rename task manager tile
to meet multi language requirement.

CRs-Fixed: 741079

Change-Id: Ic247c2a70cd63ccb87fd2f3bea05196e28060857

Conflicts:
	packages/SystemUI/res/values/strings.xml
SystemUI: Fix sim pin lock message displaying incorrectly issue

When verify password successfully and no sim card is pin locked,
getSimPinLockSubId returning invalid sub id causes slot name
displays incorrectly.

Do not update sub info if sub id is invalid, remove inappropriate
security message update to avoid displaying incorrectly.

CRs-Fixed: 737973

Change-Id: Ic4c4aca09456008c72677aedd9caa6af9e84da8f
VideoView: Check state before calling suspend

Only call suspend under certain states. There is a possibility
that when activity is finished, pause gets called before destroy
calling suspend and stop on mediaplayer respectively. This will
result in stop failure as it has already been suspended.

CRs-Fixed: 750459
Change-Id: I34c24d6abe3726b163f9a582d73b31dfd4094e44
Allow override of DUN settings

Allow override of system DUN settings by setting
persist.sys.dun.override
to one of the following values:
2 = not set, 0 = DUN not required, 1 = DUN required
If the prop is not set or is set to an invalid value the system setting
will be used.

Conflicts:
	services/java/com/android/server/connectivity/Tethering.java

Change-Id: I296f303a23351e4ab29898895abfcd313c747db9
Sounds: Cleanup duplicate ringtones/alarms

Removes duplicates from AllAudio makefile and fixes title tag of
Promethium (from Platinum).

Change-Id: I767a846dbc5575ec9f86b1326e0b9f7aa015086b
immersive mode: don't unconfirm a package, that's just dumb

* This is very annoying for specialized apps
* See here for a great explanation http://stackoverflow.com/a/20309721
* The fact that it doesn't even notify the user until the NEXT time they
  run it makes it completely pointless in my opinion anyway.

Change-Id: I423611efc07d467e1d81c66d58adcff331be8b38
frameworks/base: Add support for fully transparent layers

Allow apps to specify a window to be fully transparent. This hint
can be used later by the compositor to drop the layer.

Change-Id: Ib58f1026e74ca39e7160d2adcb34ebf50ec28a9a
Optimize drawBitmapMesh using TRIANGLE_STRIP

Draw BitmapMesh using STRIP instead of TRIANGLES.
Depending on where the bottleneck is located in the pipeline,
there is a potential for saving two-thirds of the time spent rendering.
The speedup is due to avoiding redundant operations,
i.e., mapping each vertex four times to texture and color attribute,
sending each vertex twice to the GPU, vertex processing of GPU ...

In this patch:
1. Refactoring mesh using Strip.
2. Batch triangles by adding degenerate triangles.
3. Optimize computing positions of texture and color attribute.

Benchmark: Drawing Bitmap(1152x768 px) with 200x200 meshes
Performance is doubled (from 26.4 fps to 53 fps, Nexus10).
Memory footprint: only 17% of original method.
(from 240000 to 40401 vertices with xy, uv, rgba data.)

Change-Id: I08c5c20d981d88528ce7b02012feefae468d6ec4
Signed-off-by: kui.zheng <kui.zheng@arm.com>
Configurable 0, 90, 180 and 270 degree rotation

Change-Id: Ia1859c51d71ef9d01cec2d13c6468ed89c6ac53e
Contributor: jonasl

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

- Add system setting

Change-Id: Ia7bf8cb64258e1d602230a8f9ea227d3b56a4dab
 Frameworks: Statusbar clock and date customizations

Some things changed on kitkat + our old code needed in general a bit
rework. All done with this patchset.

This commit add support for:

- Clock and date enable/disable
- Clock and date position
- AM/PM styles multilang support
- color
- Date format
- Date style

Originally by kufikugel. I only ported it to 5.0

PS2:
- several fixes and optimizations and code cleanup

PS3:
- more adaptions to LP

PS4:
- cleanup

PS5:
- animate hiding correctly on center clock mode

Change-Id: I456bc81c0c981c04467c9908c164e7c3b6cb75d3

Conflicts:
	core/java/android/provider/Settings.java
SystemUI: Status bar clock - fixes

This commit fixes:

- no overlapping more from status bar icons on center clock.
  The width depending on what the user has setuped (date and clock) is exactly meassured now
- do not start animations if they are not needed
- reduce settings provider calls
- a bit cleanup

Change-Id: I7a37a6ae8f9bad0f265119af05dc20cf21cd6890
SystemUI: Ensure that the Clock is actually enabled in IconMerger

to device if we need to calculate

Change-Id: If12b0e26b32f044f1a82cf8b539283194d1d0b4c
Frameworks: Do not allow to access quick settings on secure lockscreen - option (1/2)

We have a lot security guys as user due of using the phones as business phones...that
said a lot complains go into the direction of google how it is possible to have
access to quick settings on a secure lockscreen which is absolutely understandable
due that you are able to control Wifi BT AirplaneMode data etc.

This patch takes care on this problem and adds an option to control this behaviour.

ATTENTION: Due that this is really an UX derp for an average user this feature is
enabled by default now. User need to disable it explicit in settings to get on secure
locksreen the original android behaviour back.

PS2:
- fix derp

Change-Id: Ib437802ae8687dc8e99122a40e285bdd2df3e04c

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
SystemUI: Reduce activation area a bit of quick pulldown

Change-Id: I06b3a50982930491c6fd4e70ceda3b1ceee28f87

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java