Frameworks: add never sleep screen mode (1/2)

to qs ScreenTimer Tile
to PW ScreenTimer toggle
as general option as well

PS3: Rebased
PS4: Rebased
PS5: Fix compiling error

Change-Id: Ic78356c1b96044562efbce3cb0d0d5c93d773a19
fb: fix on tablets notification drawer height on custom image background

The measurment bases always on the height of the complete view. Due that we set
an image as background (does not make a difference if we do it like now with an image
view or set the background resource for the complete view) the image is calculated into
the measured height as well which leads into the problem the the panel completly opens
to the bottom.

To prevent that measure only the real content and decide based of this value how much the
rubberbands should go into action. This will be only done on devices which set a minimum
height for the drawer which indicates that we need to measure the content more exactly.

Change-Id: I9772abc8a48d5e46b5bb6e6239c0b4826115ac6a
fb: add bottom margin to stock default battery icon

We set the layout parameters programmatically so the fix from
google does not take effect. To solve set the bottom margin
programmatically based on the current display density

Change-Id: I9caa0e729afa19eb7cb852a1df6ad036a2839d1b
Prevent nullPointerException by updateBondedBluetoothDevices

In some very rare cases difficult to identify, it seems that the
IBluetooth.getBondedDevices() returns a Set with a null element.

This patch will prevent calling getBondState() if the device is null to
avoid a nullPointerException.

Change-Id: I9bcad60c37e03c77ec39227e5c947c002a3ae2c7
Orig-Change-Id: I8845f0e6b8fdcda679bc71e2b5c33fd4a52f3ac5
Signed-off-by: Patrick Combes <patrick.combes@intel.com>
Reviewed-on: http://android.intel.com:8080/116592
Reviewed-by: Bondier, CedricX <cedricx.bondier@intel.com>
Reviewed-by: Chen, HuaqiangX <huaqiangx.chen@intel.com>
Reviewed-by: Yao, Yong <yong.yao@intel.com>
Reviewed-by: Aquilone, RaffaeleX <raffaelex.aquilone@intel.com>
Tested-by: Lestienne, ChristopheX <christophex.lestienne@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 90085
Fix error checking in MemoryFile.

mmap returns MAP_FAILED on failures, not 0 (NULL).
Also, convert some C style casts to C++ since they
make intent clearer.

Change-Id: I367993c73e9ee576f11ebe76e530d2c2f27c662d
Fix preference puts with "null" values.

Null values were being written out as <null /> elements in the
XML prefs file (as expected). This allowed the getFoo() functions
to work correctly because they treated null values as missing mappings
but containsKey would fail.

bug: https://code.google.com/p/android/issues/detail?id=64563
Change-Id: I1f466d01db96bf26e208d4fed3a6f257228bea5d
Add NULL check in updateProxyConfig

If the exclusionList was null in updateProxyConfig the VM would
crash when converting it to a UTF8 string. Avoid this by adding a
null check.

Change-Id: I0d8106fd54385bd9ae9c652a6c67d459a119cf2b
Before requerying a cursor, check if it is closed.

Before updating a cursor,
it needs to be checked if it is valid.
Currently a defence code only checks
if it is not null.
But in case of "Cursor", it is not valid,
if it is closed.
So just like in CursorAdapter.onContentChanged(),
add the additional defence code to check validation.

Change-Id: I1302f1b6d009897815d4bdb2f20f625688cf9901
Fix a JNI local reference leak in MediaDrm

A reference leak was found in the subtitle usecase that also
applies to android_media_MediaDrm.cpp
(Code taken from the similar fix in android_media_MediaPlayer.cpp)

Change-Id: Icc4b25e4adc9a600ff4ac99a7a8478bb55a6e348
Do not show Home behind full screen activity

When ensureActivitiesVisibleLocked goes through foreground activity
stack and reaches non-fullscreen activity, it sets showHomeBehindStack
variable to true.

If there is a fullscreen activity behind, showHomeBehindStack remains
unchanged, which causes Home application to be displayed anyway.
In this case user will see a fullscreen activity and Home activity
simultaneously.

To fix the issue we set showHomeBehindStack to false when we reach
fullscreen activity in the activity stack.

This was made visible by the following commit:
446ef1de8d373c1b017df8d19ebf9a47811fb402

Change-Id: I535c1283a4e26f5cf606375b837d4b7195324af0
Framework: Glowpad Torch (1/3)

PS2: Torch active? Keep screen on.

--------------------------------------------
PS2: Add author
PS3: Fix tabs
PS4: Update commit msg
PS5: Add slim's Deviceutils, TorchConstants and also added actions needed for torch on ButtonsConstants.
Change-Id: I95df200b19db6d9321de2b923aadc914044d9a03

Conflicts:

	core/java/com/android/internal/util/slim/DeviceUtils.java
	packages/Keyguard/src/com/android/keyguard/KeyguardSelectorView.java
[1/2] Notification Reminder Thanks SlimRoms

Click notification header to set a reminder
Long-click to dismiss current

PS1: Update author
PS2: added missing strings & imports
PS3: Rebase

Change-Id: I452b975f73bb5c0b5404f9d182188cb2162e6cd8

Conflicts:

	packages/SystemUI/AndroidManifest.xml
	packages/SystemUI/res/layout/status_bar_expanded_header.xml
	packages/SystemUI/res/values/pac_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
[1/2] Notification Reminder Interval && Fixes

Original commit:

Calculate actual length acceptable for the
	flipper to flip through per device,
	dpi, shade type, etc. A crespo user
	emailed me and said they were having
	issues in this area... Added benefit
	is we can now have separate
	flippers for landscape on devices
	where landscape shade is longer than
	portrait shade (non-tablets).
	Create second flipper and set
	visibility rather than doing the
	complex string breaking on each rotation.

Change EditText type to capitalize sentences
	by default when setting message.

Notification updated to allow user to stop
	the sound by clicking and dismiss
	with a button.  Allows a user to
	cancel the sound but keep the
	notification around.

Also add Flip Interval option since (device dependant)
	the strings parts can potentially be a
	lot longer with this method.

PS2: Oops forgot to git add and ammend lol
PS3: Update file name so I don't conflict with
	mnazim's upcoming feature lol
PS4: Set title limit as well.  Use marquee
	in the case that user's input is too
	large to fit the view.
PS6: Bad math is bad for layout padding

--------------------------------------------------------

PS2: update author
PS3: update commit message
PS4: miss one line in phonestatusbarview

Change-Id: Id55475163e9b6d3472d33e6e326e6efc1076f3c8

Conflicts:

	packages/SystemUI/res/values/pac_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
SystemUI: Notification Reminder New layout && Fixes

Set mCurrOrientation on init

Reimagine Notification Reminder:
	Set beneath normal header.
	No more need to guess size...
	Needed update since apparently
	many users have issues here.

Music Sleep Timer && Reminder:
	set time to start of minute,
	not where we are now.

PS2: Update Author & derp in strings
PS3: Update message
PS5: Unhook unnecessary dependencies

Change-Id: I4f79117b65a967575510c91a4b472f1bc807ae73

Conflicts:

	packages/SystemUI/res/layout/status_bar_expanded.xml
	packages/SystemUI/res/layout/status_bar_expanded_header.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
SystemUI: Update Notification Reminder

Add button to notification to update reminder
	time once it fires (to let it fire again).

need this ---> http://review.pac-rom.com/#/c/831/

PS2: Update author

Change-Id: I8fb67b81e56bf49a18fd7d0df199881e81c0284a

Conflicts:

	core/java/com/android/internal/util/slim/SlimActions.java
FW: add Slims Actions for Pie [1/2]

include partial this commits:

PS1 -->
fb: Slims navbar and navring customizations
https://github.com/SlimRoms/frameworks_base/commit/bbbb6f6fb2b1db59825b6a32ae136c72cac52bfa

PS2--->
fb: Slims new Power Menu (1/2)
https://github.com/SlimRoms/frameworks_base/commit/a73d22224e266fe7cf9389790ba1e2a55dd5a256

fb: controll user case when user freeze or uninstalls or reinstall apps
https://github.com/SlimRoms/frameworks_base/commit/4cfbe5974ca477d1542f0d99e5cf72e44b2c8b78

PS3 --->
Frameworks: Port Lockscreen Targets and Shortcuts to SlimKat
https://github.com/SlimRoms/frameworks_base/commit/334a61061efcb0e593ef580af7de8328e91341a1

PS4 --->
Frameworks: Slim Shortcuts
https://github.com/SlimRoms/frameworks_base/commit/0d64b2e6e17e5e7314f4c43d0f5b2ac6c9ad8cca

SystemUI: Sleep Screen Shortcut
https://github.com/SlimRoms/frameworks_base/commit/b820f36ecb7243308e2236aa62d8fcf21ff2d077

SystemUI: Extra Slim Shortcuts && Cleanup
https://github.com/SlimRoms/frameworks_base/commit/1726dad6c017400be4ddb534e9fa1efb01c983ae

--------------------------------------------------------------------------------------------

PS1: initial
PS2: added more classes , now need a settings part
PS3: more updates
PS4: add Slim shortcuts classes
Ps5: dependency on --> 826 , 831 &
     added some images
PS6: more images & fixes
pS7: fix derp

Conflicts:

        core/java/com/android/internal/util/slim/SlimActions.java

Change-Id: I3a2b0a42044095c98705a1b9f4892a74af40f125

Conflicts:

	core/java/com/android/internal/statusbar/IStatusBar.aidl
	core/java/com/android/internal/util/slim/SlimActions.java
	packages/SystemUI/res/values/spirit_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
keyguard: add showCustomIntentOnKeyguard method

Extracted from here --> https://github.com/scotthartbti/android_frameworks_base/commit/89d203acd1ed22003e6fdb8211eee9d6ee92a7ad#diff-1

this is need for some slim features

PS2: fix derp

Change-Id: I476b94942b67843b0caab907bcee8f591740615e

Conflicts:

	packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java
Frameworks: Lockscreen Colors and Lock Image [1/2]

PS2: Separate all color elements
	into separate prefs.
	Also colorize bouncer frame
	for secure lockscreens.
PS3: Whitespace

PS?: Add Lock Icon Picker =]
PS?: Add "Colorize Custom Icon" option.

---------------------------------------------
PS3: Fix build
PS4: Re-add some import stuff

Change-Id: I542dfa01bb1d3d0e401bbf8a5f58b32f08cbfc62

Conflicts:

	core/java/android/provider/Settings.java
	core/java/com/android/internal/widget/multiwaveview/GlowPadView.java
	packages/Keyguard/src/com/android/keyguard/KeyguardSelectorView.java
fb: fix and pimp custom lockscreen handle (1/2)

problem on current implementation is that it is not
multiDpi compatible. As well it looks a bit weird if
the user set a square image always. This commit does

- introduce central circleimage method to get circle image crops
- before it was assumed that the height of the handle image is
  108px (mdpi base) which is correct but the original handle
  has a lot unused space around to fit better into the view.
  Whatever after messurment of the real height 68px is correct
  of course calculated against the current density
- both above combined results into a always nice looking
  custom circle icon on the lockscreen dpi and device undependent
- saved file in settings calculates the needed image size
  base on the current density.

PS1: Initial State

Change-Id: Id0321e0e9176f8f765980f69b412658dbb929ef3

Conflicts:

	core/java/com/android/internal/widget/multiwaveview/GlowPadView.java
Not needed for now

Change-Id: I85f5f90ab4f5499f4704ecd7d963ee51408c597c