am: Allow more hidden apps on devices with lots of RAM

 * If more than 1.5GB is present, allow up to 40 hidden apps.
 * Number is somewhat arbitrary, but was found to work well on D2.
 * Also look at the sys.mem.max_hidden_apps value if given.

Change-Id: I2d3cf6e0dad1bc0b482cc37bf9c61ed2f2b4be51
[2/3] mediaeditor: Allow custom DOMX source instead of Google DOMX default

Part 2 of 3 patches: To allow omap4 devices to use custom "domx" source
via a new BoardConfig.mk item:
TI_CUSTOM_DOMX_PATH := device/<manufacturer>/<device-name>/domx

This setting provides for 3 changes during the build:
1. In hardware/ti/omap4xxx this settings stops standard Google domx
source from being built and changes the domx reference for tiutils.
2. In frameworks/base it changes the default openmax references for
frameworks/base/media/jni/mediaeditor/Android.mk to the new location
3. In frameworks/av changes the openmax references in 5 places, and adds
new includes in ACodec.cpp, CameraSource.cpp and OMXCodec.cpp

This commit is based on cherry-pick from omapzoom (with a more descriptive
BoardConfig setting name):
http://www.omapzoom.org/?p=platform/frameworks/base.git;a=commit;h=f7f929ff477955333bf7e7413a81a66d683d1f3f

Change-Id: I76e558ce840ea45eec14194f2e9107fb83cebf8f
Signed-off-by: Hashcode <hashcode0f@gmail.com>
input: Add workaround for broken hardware keyboard support

* Add workaround var for devices with broken kernels

Patchset 1 : Stick to android code guidelines

Change-Id: Iefbd2389656f5da7bcaa02337aed1ef48ba9653a

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
remove duplicate symbols
input: Fix workaround for broken hardware keyboard support

Using a wrong reference to mHardKeyboardAvailable caused device config
to never report physical keyboards.

Change-Id: I9b64e2d89512436c17fa8929464e2b727fba1cf3
Camera : Powerkey shutter (1/2)

Allows user to take use power key to take pictures/videos

Change-Id: I85a1e1761199f4604672be42a3a5005227f5451a
Squash commits cm misc functions porting
Including:
- Power menu Reboot
- Power menu screenshot
- Profiles
- Quiet hours
- Notification light customization
- Battery light customization
- IME Selector notification toggle
- Volume Rocker / Wakeup
- wimax support changes from CM
- and a few more things to support Settings

commit 6045100f85cef40303be6f738aebe75d8688b37b
Author: SunRain <5908183@163.com>
Date:   Thu Oct 3 23:13:28 2013 +0800

    Framework: Forward port Power menu config

commit 404ec211b78227451f9bdc82b7c1f44f44746931
Author: SunRain <5908183@163.com>
Date:   Thu Oct 3 22:43:13 2013 +0800

    fix typo

commit ad3c9797347977f79f37914a485c1589096b2607
Author: SunRain <5908183@163.com>
Date:   Mon Sep 30 02:24:40 2013 +0800

    Config.xml remove duplicate line

commit 0bd495a727337518243d4d7407f389a276a7a9e1
Author: Koushik Dutta <koushd@gmail.com>
Date:   Sun Jul 7 09:28:42 2013 -0700

    Notification cancellation fixes:
    Permission should only allow cancellation of other app notifications, not enqueueing.
    Fix checkapi breakage.

    Change-Id: Idbcfd4617057984250dc4d4fa32ff55bfbb155e2

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

commit 42f177eed87bf7092f98eb4864afe32f2668f021
Author: Koushik Dutta <koushd@gmail.com>
Date:   Sat Jul 6 16:48:44 2013 -0700

    Add permission that allows cancelling notifications from other apps.

    Change-Id: I055b17873e174f71174898a7649b1e221fd8c436

    Conflicts:
    	core/res/res/values/cm_strings.xml
    	services/java/com/android/server/NotificationManagerService.java

commit 66ebe7700f12c7d60e64ca5c0b9f06865982d9d9
Author: Danny Baumann <dannybaumann@web.de>
Date:   Mon Jul 1 11:53:49 2013 +0200

    Add an option to allow a (subtle) notification vibration during calls.

    Change-Id: I8a5e1d15d17d56089158b24f9a4b246ae6e60285
    JIRA:CYAN-1550

    Conflicts:
    	core/java/android/provider/Settings.java
    	core/res/res/values/symbols.xml
    	services/java/com/android/server/NotificationManagerService.java

commit 33c37ff34e3017788a83fa4a373a8e41d668e82a
Author: Danny Baumann <dannybaumann@web.de>
Date:   Wed May 15 12:59:42 2013 +0200

    Fix up notification LED behaviour

    - Commit 5713307e3d2eb457ba148df3683ad09733727506 (in ICS) attempted to
      fix the problem that the notification LED wasn't reenabled after
      turning off the screen again, but introduced another bug in the
      process: If another pending notification with LED at the time when the
      notification with the new magic flag introduced by that commit (which
      was used by phone and MMS apps) was active, the LED still wouldn't be
      turned on at screen off time. Also, this commit didn't handle locking
      correctly.
      This commit essentially reverts 5713307e and makes sure the LED is
      reevaluated when the screen is turned off again.

    - This change also makes the assignment of the LED when multiple pending
      notifications want to use the LED more clear: The notification with
      highest priority gets the LED. If multiple notifications with same
      priority exist, the most recent one gets the LED.

    JIRA:CYAN-652
    Change-Id: I1df0b40cca2af7a08c240677d22d2a95097b7184

    Conflicts:
    	core/java/android/app/Notification.java
    	services/java/com/android/server/NotificationManagerService.java

commit 60d3204d28bf71a27389d4cd7e291ffa6583313b
Author: DvTonder <david.vantonder@gmail.com>
Date:   Wed Feb 6 20:57:54 2013 -0500

    Framework:  Fix security exception

    Change-Id: I4fa1f55c8209e6890b6cea13b0ed4d781f9f615d

commit ed69de5c10f65a2a8d7ea31df003836dd5a87957
Author: DvTonder <david.vantonder@gmail.com>
Date:   Sun Feb 3 10:40:48 2013 -0500

    Framework: Enable multi-user support for Quiet Hours

    Change-Id: Ica967ff6bf5842a08421583449876ba73de13d51

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

commit 5eec43c5542968ccb213f9bde8eb49c7bc1d993e
Author: Aaron Echols <atechols@gmail.com>
Date:   Wed Nov 28 09:26:14 2012 -0500

    Port "Add resource to disable the CM Phone IME selector method"

    Change-Id: I6fb482e227bf1de4799923cc952d4e3c8ad0d037

    Conflicts:
    	core/res/res/values/config.xml
    	core/res/res/values/symbols.xml

commit 6e693c7698c5294ed9fb53c2a584c4ed41d30680
Author: SunRain <5908183@163.com>
Date:   Mon Sep 30 01:38:09 2013 +0800

    [service] InputMethodManagerService.java fix typo

commit 3ddd7981e587021a786c1d0be06e117b1082db69
Author: Pawit Pornkitprasan <p.pawit@gmail.com>
Date:   Wed Apr 3 20:55:27 2013 +0700

    Profile: respect DPM when overriding screen lock (1/2)

    Profile currently allows the user to override the keyguard set by
    device policy, which is undesired.

    Change-Id: Id8d80cfdad51ca0a64dc231a77e53b104ecb9825

    Conflicts:
    	core/java/android/app/admin/DevicePolicyManager.java

commit b98c8d296d71eda7b682b6f9095b3ba10144e6d8
Author: SunRain <5908183@163.com>
Date:   Mon Sep 30 01:24:18 2013 +0800

    Policy longPressActions

commit cd6c5198b58b9b9327ba5c9210d430743855c166
Author: Buga Dániel <bugadani@gmail.com>
Date:   Mon Jan 28 12:03:37 2013 +0100

    Keyguard: remove duplicated code

    Patchset 2: fixed whitespace error
    Patchset 3: a few more tiny changes
    Patchset 4: some code moving, removing an unnecessary member
    Patchset 5: make toggleSilentMode() a bit easier to read
    Patchset 6: revert most of the cleanup
    Patchset 7: fix syntax error
    Patchset 8: fixes pointed out by Danny Baumann

    Change-Id: I4e5f8c92b223c1260891472dbf807d5ff53e5721

    Conflicts:
    	policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
    	policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java

commit 8ee013ce0bc8e93f1807614adc5c4d668d38ae7a
Author: DvTonder <david.vantonder@gmail.com>
Date:   Mon Dec 17 17:12:48 2012 -0500

    Framework: Fix Profiles Insecure lock screen not working (take 2)

    Change-Id: I16744dc6523787dbe011a9a0a8d61b0702b62344

commit 5474c88f6cd349d85b33784be0530a2810b8b1c2
Author: SunRain <5908183@163.com>
Date:   Sun Sep 29 22:59:10 2013 +0800

    Profile clean up

commit 49fe080d73490790d56aeaa96ea265ebe263d4d5
Author: SunRain <5908183@163.com>
Date:   Sun Sep 29 22:56:48 2013 +0800

    ProfileMangerService clean up

commit 7761410260d99f6bd3d5b198adbc42913749d4fa
Author: Danny Baumann <dannybaumann@web.de>
Date:   Mon Sep 2 16:41:03 2013 +0200

    Cleanup.

    Change-Id: If5fc34b681615e600430478807c53f6d4440a5ec

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

commit 46ca18d19c29d07c921616c7bcab210cf0ddb631
Author: Danny Baumann <dannybaumann@web.de>
Date:   Mon Sep 2 16:11:24 2013 +0200

    Factor out profile trigger code into separate class.

    Makes it easier to extend the trigger mechanism later on.

    Change-Id: Ied318e7efa7e1755022deecb8172f862943ca6ac

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

commit ea3624c53736610a3147bb86e2f443ca2e72a720
Author: Danny Baumann <dannybaumann@web.de>
Date:   Mon Sep 2 15:50:07 2013 +0200

    Move broadcast actions from service to ProfileManager so all API is
    there.

    Change-Id: Ic8a8ad8f86f01864a30963457687f5be70e99ef4

    Conflicts:
    	core/java/android/app/ProfileManager.java
    	packages/SystemUI/src/com/android/systemui/quicksettings/ProfileTile.java
    	services/java/com/android/server/ProfileManagerService.java

commit 7f4319a312c60eb112a4aa12157b2d8ee22fb323
Author: Danny Baumann <dannybaumann@web.de>
Date:   Fri Jul 5 15:05:46 2013 +0200

    Also backup profiles file via backup manager.

    Change-Id: Id70cb1bce15b7de127e4291e9482ab3fd7270f9f

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

commit 0ead2563962e276df2d47695f67ded59732105e5
Author: Jo De Boeck <deboeck.jo@gmail.com>
Date:   Mon Jun 17 22:53:47 2013 +0200

    [2/2] Add bluetooth triggers to profiles

    Change-Id: I374cc93364c88b8b29c88345deccf297234ff624

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

commit 409808905322f816891437ea638ef2c3557a290a
Author: Jo De Boeck <deboeck.jo@gmail.com>
Date:   Thu Jun 6 21:16:12 2013 +0200

    [1/2] Add triggers to change profile based on AP

    Add data structure mWifiTriggers to store triggers per profile.
    Add network change listener to switch to profile

    Change-Id: I97e360d7783d3b0e2bbd70fe7a9a866d8c0fa7cd

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

commit ee923e20a2b56258291ca2529ae18a6ebf937fe2
Author: Pawit Pornkitprasan <p.pawit@gmail.com>
Date:   Wed Apr 3 20:55:27 2013 +0700

    Profile: respect DPM when overriding screen lock (1/2)

    Profile currently allows the user to override the keyguard set by
    device policy, which is undesired.

    Change-Id: Id8d80cfdad51ca0a64dc231a77e53b104ecb9825

    Conflicts:
    	core/java/android/app/admin/DevicePolicyManager.java
    	core/java/com/android/internal/widget/LockPatternUtils.java
    	policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java
    	policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java

commit 7b1ee72c32d098c0a7b36b00f37a24d91518b78e
Author: DvTonder <david.vantonder@gmail.com>
Date:   Sun Dec 16 10:40:53 2012 -0500

    Framework: Call Ring mode what Google calls it, not Silent mode (2 of 2)

    Silent mode -> Ring mode cleanup

    Change-Id: I929f7d1699b623b4a93608dd32786ebc2691b51b

    Conflicts:
    	core/java/android/provider/Settings.java
    	policy/src/com/android/internal/policy/impl/GlobalActions.java

commit ea26e99954d7080ccd0cf12b26716df1abf70000
Author: Robert Burns <burnsra@gmail.com>
Date:   Sun Dec 16 22:08:57 2012 -0500

    Fix airplane mode

    Change-Id: I9259e6e90c7f67cf5fc31a8a3626917e41214379

commit 498643581a34dfaed2d038ba20c6bae3900722fc
Author: Felix Bechstein <f@ub0r.de>
Date:   Mon Dec 10 18:59:33 2012 +0100

    Profiles: Airplanmode Settings with Checkbox (1/2)

    Change Airplanemode Settings to look like Connection/SilentMode etc.

    Change-Id: Ic340c4eac22b1c94dd5f7a94a9608e98c76a0e98

commit 1751efdf4b9370728a678c1a0a9bffd3c7d07c85
Author: Felix Bechstein <f@ub0r.de>
Date:   Fri Dec 7 18:05:10 2012 +0100

    migrate vibrator to silent mode settings (1/2)

    Change profiles:
    * remove deprecated vibrator settings
    * add silent mode settings

    Available modes:
    * off
    * vibrate
    * silent

    Patch Set 1:
    Initial patch with plain ListPreference

    Patch Set 2:
    Use Checkbox + Dialog like ConnectionSettings

    Patch Set 3:
    Fix code style

    Change-Id: Ic5ec3486070866b7358f843a0843ccd0753e8c72

    Conflicts:
    	core/java/android/app/VibratorSettings.java

commit 005bedffdce9fb3b7d237b07919a9e15e417a92a
Author: Danny Baumann <dannybaumann@web.de>
Date:   Fri Jul 5 15:05:46 2013 +0200

    Also backup profiles file via backup manager.

    Change-Id: Id70cb1bce15b7de127e4291e9482ab3fd7270f9f

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

commit d2c57ee11b6da4a30edfaaefae9c484e35803561
Author: SunRain <5908183@163.com>
Date:   Sun Sep 29 22:13:07 2013 +0800

    Settings.java : update Wimax config

commit d650fade94f0f446f6aaed66c68981c6c96e7323
Author: SunRain <5908183@163.com>
Date:   Sun Sep 29 22:10:45 2013 +0800

    update WimaxManagerConstants

commit b89bf980024c78505ffd26e3a774d743f2d943ee
Author: Mike Kasick <mike@kasick.org>
Date:   Wed Feb 1 21:36:49 2012 -0500

    Port wimax support changes from CM9.

    - Register WiMax service in ContextImpl (fixes 4G toggle).
    - Fix misdocumented EXTRA_4G_STATE in WimaxManagerConstants.
    - Share wimaxClassLoader between WimaxHelper and ConnectivityService.
    - Add ACCESS_4G_RADIO_DISABLE, ACCESS_4G_STATE, and CHANGE_4G_STATE
      permissions to SystemUI.

    Note that WimaxManagerConstants was previously misdocumented, confabulating
    the lookup key EXTRA_4G_STATE ("4g_state") with EXTRA_WIMAX_STATUS
    ("wimax_status"), which no longer exists.  This is also fixed.

    Change-Id: I4f5973e7bd2ff4c860036df0f38589b34ad72b49

    Conflicts:
    	packages/SystemUI/AndroidManifest.xml

commit ad10fdf73910c3fd672968fdb2b38692310a4efa
Author: SunRain <5908183@163.com>
Date:   Sun Sep 29 21:58:22 2013 +0800

    Strings : remove duplicate line

commit 9dee432f4df13c46faa2ce34c0172d035c63c39b
Author: SunRain <5908183@163.com>
Date:   Sun Sep 29 21:56:50 2013 +0800

    fix typo

commit 18066fa57e3f3a2061baf69dad5bfa5ab255cb32
Author: SunRain <5908183@163.com>
Date:   Sun Sep 29 21:54:02 2013 +0800

    fix typo

commit c6d4cc8d776bb8e02ded0eba91cf365ff6b0b9c8
Author: SunRain <5908183@163.com>
Date:   Sun Sep 29 21:52:05 2013 +0800

    Strings : remove duplicate line

commit fe00f6dfd39147a0a90ccdaf5e439dcc09fc6bbd
Author: Danesh Mondegarian <daneshm90@gmail.com>
Date:   Fri Apr 12 23:50:27 2013 -0400

    PowerMenu : Improve keyguard filtered actions

    Replaces the check for visibility of lockscreen with the state
    of the keyguard instead. This avoids the situation where actions
    returning false from showDuringKeyguard, are still shown if user enters
    emergency call screen.

    Change-Id: Idb5df14813d9479bd4178dbb9eb3b91cbecda5de

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

commit a0c34a7f0e0913987fcf93722264f3bce45c2d46
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Sat Jan 5 21:22:20 2013 +0000

    GlobalActions: Fix possible race condition when showing dialog.

    Depending on the presence of a previous dialog, the newly generated one
    gets either immediately displayed (no old dialog) or shortly delayed
    (after dismissal of the existing one).
    If a new show event happens (by rapid fire of the power key, for instance,
    using a keyboard with fast-repeating events) during that delay, a new
    dialog will be immediately displayed, and when the delayed show triggers
    it'll conflict with it (and bring everything down).

    This moves the creation of the new Dialog object to _before_ showing
    it (delayed or not), instead of the show method itself, to ensure the
    object isn't clobbered by competing/sequential calls to handleShow()

    Change-Id: Ie4d9a8507ebaf59da31869c38b98c3c98a74468e

commit 9c641336e8fe13231dca7dffe231831abe6e8785
Author: DvTonder <david.vantonder@gmail.com>
Date:   Sun Dec 2 08:02:08 2012 -0500

    Framework: Forward port Fixes

    1)  NPE in Power penu

    This fixes the NPE when the Reboot item is disabled and the Profiles
    switcher is not

    2) NPE in notification manager if profiles disabled

    No active profile group is returned and a NPE is triggered when a
    notification override is being set

    Change-Id: I5fa003ce08daf5ef86ddeca5d432dcea2e34a718

commit 2f1e959da1dcb77493efa43cb67a5cb47d54887d
Author: kufikugel <kufikugel@googlemail.com>
Date:   Wed Dec 12 01:15:02 2012 +0100

    Framework (1): Forward Port CM10 features

    This commit includes:
     - Power menu Reboot
     - Power menu screenshot
     - Profiles
     - Quiet hours
     - Notification light customization
     - Battery light customization
     - IME Selector notification toggle
     - Volume Rocker / Wakeup
     - and a few more things to support Settings

    PatchSet 2

    just changed commit message

    PatchSet 3

    rebased on initial Power Widget commit

    PatchSet 4

    rebased
    whitespace cleanup
    profile airplane mode fix
    delete GB drawable on reboot powermenu
    small fixes

    Change-Id: Ibab71331dbced41ef4b8cb20c1f9aac29a142551

    Conflicts:
    	core/java/android/app/ContextImpl.java
    	core/java/android/app/Notification.java
    	core/java/android/provider/Settings.java
    	core/res/res/values/config.xml
    	core/res/res/values/symbols.xml
    	policy/src/com/android/internal/policy/impl/GlobalActions.java
    	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
    	policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardViewMediator.java
    	services/java/com/android/server/NotificationManagerService.java
    	services/java/com/android/server/VibratorService.java