ActivityManagerService: Increase key dispatching timeout value

Increase key dispatching timeout value for Fast Models to make sure
that applications e.g. Monkey wait for enough time before raising ANR
(Application Not Responding) errors.

Change-Id: Id11267567c5ef49ee578048c9bc6d98e8b153836
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
PowerManagerService: use disablesuspend property to disable suspend mode

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
core: fix arithmetic on a pointer to void

Use char* instead of void* for this
pointer arithmetic. Fixes the following:

error: arithmetic on a pointer to void
buf = buf + offset;
      ~~~ ^

Change-Id: I6cfc92c9240fda66a52e780cda7820fdba76914a
EGL14.eglCreateWindowSurface should set producerControlledByApp

Interface of Surface class changed.
To reflect the change for EGL14, add producerControlledByApp flag.
Similar change can be seen in 0fa257fe53bf520bdde93996a1901ce6bc3e1788

Change-Id: Ic8911d3131e033747cfdabe59ac2fea1e90bb4a0
Only send storage intents after boot complete

It is not possible to send a broadcast before the system
boot is completed. If you do it anyway you will get an
IllegalStateException: Cannot broadcast before boot completed.

If a memory card is inserted or removed while the phone is
booting up, there is a risk that the MountService will try to
broadcast a storage intent too early, and cause the device
to crash.

Use FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to avoid
problems with too early broadcasts.

Change-Id: Ied36a13d235df37c9788e45a35de40d919ae0cd0
Fix in MediaMuxer's JNI code

android_media_MediaMuxer_native_setup should return jlong. It was
incorrectly returning jint.

Change-Id: I31a475af0818f4d5dcbb39380b42612188cf3853
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Improve Parcel's handling of non-primitive arrays

Treat arrays other than actual Object arrays (i.e. those whose component type
is actually Object) and the primitive arrays already handled specially by
Parcel as Serializable's.

Issue: 64583
Change-Id: I3ff797f3262e77e4de27f35709bceee5410d1ed4
Miscellaneous small documentation fixes.

Most of these I noticed on my own. The change to docs/html/tools/testing/testing_ui.jd is mentioned in a bug report:
https://code.google.com/p/android/issues/detail?id=56324

Signed-off-by: Mark Doliner <markdoliner@google.com>
Fix documentation for Parcel.readException().

The old documentation was kind of useless and not clear, so this is an
improvement.

In addition to this change, I think this method should probably be private
instead of public, especially since the values for code are private. But it's
too late to change that now. Also the method name is pretty poor, since it's
not actually reading anything. Something like "throwException" would be more
appropriate.

I'm open to suggestions on how to improve this situation. Maybe mark the
method as deprecated with a comment that it will be made private in the
future?

Change-Id: I830f2bcf606714bd130d8c953aa33974b33c9a83
Fixed typo errors in documentation

Fixed some type errors in developer documentation.

Change-Id: I92629a4350508fb96fda1842741c5ced64171464
Signed-off-by: Taeho Kim <jyte82@gmail.com>
Open display settings by long-pressing the brightness tile

Change-Id: I379d09280ed796918fe504665b6303e82dfb7134
frameworks/base: Fix SystemUI crash on Recent Apps list

Issue: SystemUI crash is observed when Context MenuItem "App info"
       is selected on the recent apps activity
       1. Open the rencet apps list
       2. Long press on any one/more recent app(s)
       3. Lock the screen using power key
       4. Unlock the screen using power key
       5. select menu item "App info"
       6. SystemUI process will get crashed.

Fix: Changed the code to make sure that only one context
     menu is active at a time and also dismissed the
     context menu on pause of the RecentsActivity

Change-Id: Ia50bed7bfad6fde7beeaec37fa6402177eee1d40
Race condition in Toast.

1. mTN.mNextView is set in toast.show() but can be invalidated by posted
runnable mTN.mHide. If application call toast.cancel() right before
toast.show(), this race condition can occur.

2. Removes superfluous TN.hide() if toast.cancel() is called.

Change-Id: I554c5d44c59e18f5066f6175faec3e256b4e40d6

Conflicts:
	core/java/android/widget/Toast.java
Change the way to calculate the native heap size

Previously the native heap size returned by android.os.Debug's
getNativeHeapSize() is mallinfo.usmblks, which is the maximum
total allocated space. But this value is greater than current
total if trimming has occurred. In the output of 'dumpsys meminfo',
as a result, the native heap size dose not equal to the sum of
the allocated native heap size and the free native heap size.

I think this is misleading because actual and current footprint
of the native heap is usually smaller than the max footprint,
a peak number of bytes allocated to the heap.

This commit makes the native heap size returned by
getNativeHeapSize() to be the current footprint, which is the sum
of the allocated and free native heap size.

Change-Id: Ie5eec4ac43b82c8f8d7dcf9c6d7785fd9b4526eb
Signed-off-by: Kyungmin Lee <snailee@gmail.com>
fix null pointer exception in enqueuing

Change-Id: I6f9b104d06fc18b8465117436279a8e34d1622c2
Improve notification shade auto-collapse code.

- When the user dismisses a notification by swiping, also collapse
  notification shade if there are persistent notifications remaining.
  Only skip collapsing if there are still non-persistent notifications
  pending
- When the notification is removed by the app, wait a bit until
  collapsing the shade so the removal doesn't come as a surprise to the
  user
- Centralize the collapse trigger at one place

Change-Id: I4e5114f66e799a7c80e18b38abce5678da460846
Increase available volume levels

Increase media volume levels from 15 to 30 to have more precise
volume control instead of having only 15 levels from 0-100%

For example, when listening to music it is often the case that one
volume level is too quiet and the next one higher is too loud (especially with Headsets).

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: I7a8750c901967ce3c818fb9c33b082af6b86b8d6
Fix for MemoryLeak in InputMethodService

Problem: when onConfigrationChanged is called many times,
mInsetsComputer is added many times to the list.
Solution: check before if specific listener is already
in the arraylist.

Change-Id: Ic730395120d6dc8585628c142b2e161c42317f30
Avoid duplicate call to onLoadFinished()

When a loader is initialized in Fragment#onActivityCreated(Bundle), then
LoadersCallback#onLoadFinished() was called twice on device orientation
change:
 - once during fragment start();
 - once during loader finishRetain().

Reported as bug 63179:
https://code.google.com/p/android/issues/detail?id=63179

This commit prevents to call onLoadFinished() when the data has already
been delivered.

Change-Id: I893013049f819dd5543a8079ce9d8025a5fdb2f1
GREF leaks in AudioEffect and Visualizer.

When playing songs with MusicPlayer global references are leaked.
Added call to DeleteGlobalRef in the destructors for both classes.

Change-Id: I35b311b2accb8be7ca1eefa2ecdf5a37e0fb2027