[1/2] Base: DownloadManager: add support pause/resume/stop notifications

Add pause, resume and stop functions to make user can pause, resume and stop downloads by manual in downloads application.

Change-Id: I82ffff5a539448faab8933e2b47591199bf24cb9
Frameworks: TRLS [1/5]

Initial publish of TRLS frameworks patch. Please no bug reports. I'm only publishing this as a preview. It's still very much a WIP.

PS: remove system dialog hololight themes due to clashing
        with apps that use system dialogs with their own
        resources/text colors, resulting in a white foreground/
        white background (unreadable).

PS: increase readability of notification icon

PS: redirect holo system themes to hololight

PS: preparations for hololight volume panel and global menu

PS: volume panel java crap

PS: redirect alert dialog style for global menu and other
        alert dialogs throughout the system

PS: TRLS default global menu icon/text colors

PS: get rid of unnecessary holodark theme redirects

PS: commenting out main holo theme redirect for now...

PS: commenting out other non-dialog holo theme redirects.

PS: remove some tabs and whitespaces
Change-Id: I89e4ff6c4950948689adaa93dade3d85392f0cbd
Lockscreen Notifications [1/2]

My try on making notifications easily accessable from lockscreen.
Credits to ChameleonOS, I got the notification listener permission and some small other stuff from their ActiveDisplay implementation.

Lockscreen Notifications allow you to manage all your notifications directly on the lockscreen.

Features:
- Pocket mode turn screen on when phone is pulled out of pocket and turn it off when phone gets back in pocket
- Hide low priority notifications
- Hide non-clearable notifications
- Allow dismissing even non-clearable notifications from lockscreen
- Just turn screen on when there's currently a notification pending
- Toggle between expanded and normal notification view by longpressing
- Wake on new notification
- Configure notification count displayed at once
- Privacy Mode: Hide notifications content on secure lockscreen.
- Blacklist apps - thanks to ChameleonOS for the original implementation and @Der-Schubi for bringing it to lockscreen notifications
- Show all/dismiss all button, does not dismiss on going notifications, they must be swiped away

Overlay setting:
dynamic width is disabled by default, to enable it for a specific device, add
<bool name="config_lnDynamicWidth">true</bool>
to yourdevicetree/overlay/frameworks/base/packages/Keyguard/res/values/config.xml

PS3: Disabled by default
PS4: Removed many whitespaces

Change-Id: Ife8cbe1ef86691c391de061964bf4d14be03a59f
Signed-off-by: kecinzer <kecinzer@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java
	core/java/com/android/internal/statusbar/IStatusBar.aidl
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
	packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
	packages/SystemUI/res/layout/navigation_bar.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/NavigationBarView.java

Change-Id: Ife8cbe1ef86691c391de061964bf4d14be03a59f
[1/2] Base: Lockscreen blurred see through

ezio84: removed omnirom battery ring lines

Lockscreen: See through (1/2)

Add the ability to see through lockscreen.
Adapted to kitkat from jellybean by @BigBrother1984

Signed-off-by: D4rKn3sSyS <jesdga95@gmail.com>
Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS2:

* Adding missing sem-colon.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: I9057a6e302a5a824799844f27e8f64ff677a520a

PS3:

* Replace and remove undefined mContext.
* Define the boolean enableScreenRotation inside new method.
* Whitespaces clean up.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS4:

* Restore mContext in setKeyguardParams().

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS5:

* Fixes for setKeyguardParams() and maybeCreateKeyguardLocked() methods, kitkat changed some things.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS6:

* Missing sem-colon.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS7: Fix all the things.

* Effects doesn't vanish after first unlock.
* Created condition in updateShowWallpaper() method that just return if see through is activated, he was restoring the wallpaper at second lock.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS8: Cosmetic changes.

* Correct java style name to seeThrough() and place it above updateShowWallpaper().

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS9: Other cosmetic changes.

* Better name to the see through boolean.
* Removed a space nitpick.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS10:

* We had two booleans for the same thing, ditch the one defined in one class only and take the global.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: I06d952f85baf284961a24c8c9f90b29f4aef719a

Conflicts:
	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	services/java/com/android/server/wm/WindowAnimator.java

Fix: Ensure lockscreen see through setting persists after reboot

If see through was enabled and the device was rebooted,
the user had to toggle the setting off and on again to activate.

Change-Id: I726220a39ac61cf135e5c63a9dbb8def7ed6fa2e

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Fix: Correct possible null pointer when enabling see through lockscreen

PS2: Remove unused variable

Change-Id: I28884cb18964b273539261b8c0f72cedf2e60666

Frameworks: Lockscreen Blur

  If user selects "See through" under screen security,
  the locksceen background will now appear transparent
  with the content behind it blurred.

Modificaitons made to the orginal commit to support Hammerhead and Flo.
It seems full HD images causes rendering artifacts. To prevent this,
we scale the image size to something more manageable.

PS2: Reduce calls to System.Settngs
     Move bitmap scaling to DisplayPowerController
PS3: Fix styling
PS4: Fixes: 1. Black wallpaper after turning off see through
            2. Wallpaper flicker on unlock when blur is enabled
PS5: Ignore status bar and nav bar when capturing screenshots
PS6: 1. Remove content observer and unnecessary calls from viewManager
     2. Restructure the flow of setting the custom image
         * now closely follows setting album art as lockscreen image

Change-Id: Ie72bab697726af5e145bd0192980885ea7222ecd

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java
	services/java/com/android/server/power/DisplayPowerController.java

fix build error

Change-Id: I921aa3da4faafc624247d912efe6f79a7a2d6049

Fix: onBoot brightness

When device boots the brightness is always on highest level.

PS1: workaround it
PS2: apply to all devices
PS3: fix blur issue
PS5: sorry, update old file
PS6: remove whitespaces thx Carlo
PS7: revert change in Keyguard, add new fix
PS8: remove tab and whitespace thx Evan

Bug: https://paranoidandroid.atlassian.net/browse/AOSPA-56

Signed-off-by: Matthias Freund <matthias88freund@gmail.com>
Change-Id: I9535e2c22132539e0ad7e9d718b5d0732ba53571

Fix possible NPE

Fix null pointer error as reported on Jira
https://paranoidandroid.atlassian.net/browse/AOSPA-218

Change-Id: I7929a518b49ba25ac97f4e184a21da427d5aa70c

Fix: Lockscreen Blur Rotation

Based on https://github.com/AOSPA/android_frameworks_base/commit/4dcc408182ccf0af8b2f82eedee37006e33105c9

Change-Id: I82cc6d6cac2416c27311e5920fe49976d303c312

Conflicts:
	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Conflicts:
	core/java/android/provider/Settings.java
Lockscreen Wallpaper

Custom lockscreen

Accessible via launcher wallpaper selector and
Settings - Display - Wallpaper - Lock screen

Change-Id: I2e4722d1a6d4ba80a3c656306ceb251d630a8e21

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Themes: Keyguard: Fix NPE setting lockscreen wallpaper

After boot the view might not be laid out and so getWidth() and
getHeight() return 0 and will cause a NullPointerException in
createBitmap().

Bug AOSPA-448

Change-Id: Ibacf4199a69709dc34d21695732c2a5360533a23
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>

Keyguard: fix NPE setting lockscreen wallpaper

Continue previous patchset (check history)

------- Cherry-picked commit -------

After boot the view might not be laid out and so getWidth() and
getHeight() return 0 and will cause a NullPointerException in
createBitmap().

Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
floating mode strings cleanup

Change-Id: Ib6173c7a22079ba2d737201602578eba1892b391

Conflicts:
	packages/SystemUI/res/values/slim_strings.xml
Kill floating activities running in the same thread when tapping outside

This change makes all activities from the same app to be finished when we tap outside the halo window. Other apps running in different threads
(floating or not) won't be finished.

Port from here: https://github.com/ParanoidAndroid/android_frameworks_base/commit/f489f45ab2ba5dd4991c241917f7f4b0fd74b884

Change-Id: Ie6d6f46b2e23be60f991520ed480c2866fb2d0e3
Dismiss IME when floating window is dismissed

Previously the IME would be stuck on screen if the
floating window was dismissed while it was showing.

Original id from PA gerrit -> Change-Id: I8ca61b07ed89bae85eabd8db23f87b6f1f0b179f
Signed-off-by: Evan Anderson <evan@thelinuxman.us>

Change-Id: If38e65f61ba309d22306bf4b37c3c55630c006ed

Conflicts:
	core/java/android/app/Activity.java
FW:more fixes and clean up
SlimRecents: add floating window menu
authored by: lion0738
edited matthew0776
remove objects

Conflicts:
	services/java/com/android/server/am/ActivityStack.java

Change-Id: I8ec9a48a77f177883edba71265248b404e47a8d5
FW:Notifications Cleanup need with previous FW notif original commit

Conflicts:
	packages/SystemUI/res/menu/notification_popup_menu.xml
	packages/SystemUI/res/values-es/slim_strings.xml
	packages/SystemUI/res/values/slim_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/res/menu/notification_popup_menu.xml
	packages/SystemUI/res/values-es/slim_strings.xml
	packages/SystemUI/res/values/slim_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Change-Id: I597629f0cf9ad080585a01ad856f69ee34b6cb16
Launch floating notifications from notification panel (long click)

* Status bar - long click on notification select 'floating mode' option

Change-Id: Icf2915cf71f07d19cf8179ee5e561891b0a78e77
Signed-off-by: anerikg <anerikgames@gmail.com>

Conflicts:
	packages/SystemUI/res/values/cr_strings.xml

Conflicts:
	packages/SystemUI/res/menu/notification_popup_menu.xml
	packages/SystemUI/res/values-es/slim_strings.xml
	packages/SystemUI/res/values/slim_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/res/values-es/slim_strings.xml
	packages/SystemUI/res/values/slim_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/res/menu/notification_popup_menu.xml
	packages/SystemUI/res/values-es/slim_strings.xml
	packages/SystemUI/res/values/slim_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Floating Window: Welcome back

* Port squashed jellybean floating window to kitkat.

Floating window contributors:
@drcmda
@beerbong
@D4rKn3sSyS

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Merge notification manager service changes.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: If3d6338f657915754bd6cb9cb987df62c17aa6d0

Conflicts:
	services/java/com/android/server/am/ActivityStack.java

Conflicts:
	services/java/com/android/server/NotificationManagerService.java

Conflicts:
	core/java/android/app/Activity.java
	services/java/com/android/server/am/ActivityStack.java
Revert "Floating Window: Welcome back"

This reverts commit 76f22409b03bcc2c1fa95e9e84f80a4de628672e.
Revert "Launch floating notifications from notification panel (long click)"

This reverts commit ba47a892e41436fe5f38da03cc75307cda017bfd.
Revert "FW:Notifications Cleanup need with previous FW notif original commit"

This reverts commit 24a80c0f3b1dc5fd923a9105b0a09fe99d8840da.
Revert "remove objects"

This reverts commit c957766a67a2782114e7d966326d5eb0b4389793.
Revert "SlimRecents: add floating window menu"

This reverts commit c740f15192aade2a8634066c5fb8fa74d9315a84.
Revert "FW:more fixes and clean up"

This reverts commit dc0a9c51f94d78aecb640ffba468748e84c1e989.