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: Actually start to use HEADS_UP_REQUESTED extra

Prepairing slim heads up feature, we do this here to allow apps to
send a heads up notification no matter what.

Google introduced this flag but is not using it in the actual API

Take HEADS_UP_REQUESTED into account to indicate that this notification
is a good heads up candidate.

How to use it you can see in email or mms app

Change-Id: I4a29404122ae12ab9b95e1d223911078a360b44e
Fix lockscreen selection view in landscape mode.

Added a dimen-value for selector in landscape-layout to fit screen. Issue is described here:
https://github.com/LegacyXperia/local_manifests/issues/677

Change-Id: I9501c91fed2660e947f1eae617f9a31d95766ed8
Forward Port: Volume button seek on screen off [1/2]

PS : Fix the short press event type

Change-Id: Id55a1240a133b5144502fced862bae040b390662
Framework: StatusBar Ticker (1/2)

Change-Id: I6135297792c7b42172e08e14acd37b252cb00102
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
Allow device to enter download mode on framework watchdog

This allows to get better insight of the device state at the
time of framework watchdog

Change-Id: Id62ab5c156793a91161770cd4ed388b3783a1960
ContentProvider: Use the mode the use chosen from the dialog

When the user try to delete contacts, we will show a dialog
to let the user decide whether the app can do the delete
operation or not. This issue's root cuase is that we did not
return the result we get from the user's choice.

Return the mode user has selected instead of the default mode
when we are checking the app's permission.

CRs-Fixed: 750841

Change-Id: I53355d6ff367fcc88330e39986d0a7fd7896861c
DocumentsUI: Fix download status was displayed incompletely

The layout arrangement of date, size and summary are unreasonable.
Text was ellipsized when summary has too much characters.

Reconfigure "layout_weight" of date, size and summary can fix this
issue.

CRs-Fixed: 619201

Change-Id: Ic2db20a303dd1db7e2d3375e4b733d704daf393b
androidfw: Use the last package to create idmap.

Overlaid packages contain one or two package groups, the first one is system
package(android), and the second one is application package. So it should use
the last package group to create idmap.

When inspecting the idmap, similar as above.

Change-Id: I97e0179bc5b5acdcacbe6ec5b5b7c22af51d1d0b
Download: use "control" column to mark paused/resumed status

Before, column "status" is directly updated when user pauses/resumes
download, this causes status shown to user is not same as real status
because pausing/resuming needs a little time not instantly, and then
causes some status error.

The column "control" is updated instead of "status". When user pauses
download, will update "control" as CONTROL_PAUSED and set "status" as
STATUS_PAUSED_BY_APP until pausing operation is finished; and when
user resumes download, will update "control" as CONTROL_RUN and change
the status as STATUS_RUNNING until DownloadThread is started to run.
Then the status shown to user will be same with real download status.

Change-Id: I2204b972d24b809f7914b0981cad11e9175f4ae6
CRs-Fixed: 737182
Add turn off action to WiFi Tether notification

PS 2+3 : Fixed Icon + Add persistence to WiFi state [mnazim]

Adapted to LP.

Change-Id: I320405ed7e90e4c06ecdb127cd4c1cad6bedbcdd
Signed-off-by: Gergely Szell (sethyx) <szell@hu.ibm.com>
Keyguard: Enable quick unlock (1/2)

old way does not work anymore exactly like before. So adapt the idea to new LP code

Thankd DVTonder for the basic idea prior LP

PS:
- do PIN view correctly

Change-Id: I86660afafb8648d36d6c135343c88afcfc5173fc
Frameworks: Policy: implement a pin keypad shuffler [1/2]

this is to further prevent people using the tablet guessing your pin based on fingerprints left on the screen
example of the expected outcome - https://www.dropbox.com/sh/r3xb2q53ksaqni9/Oz1Eu8Dm7O

- correct coding style
- added reload button

PatchSet:
- simplify shuffle code
- fix over shifting in some cases
- add reload button functionallity
- add lockscreenutils method to detect only PIN lock
  for settings
- exclude sim and simpuk PIN lock
- add drawables for reload button

PatchSet
- cleanup

PatchSet:
- fix shuffle NumKeyPad even if a theme replaces the xml
  and reload button is not present.

PatchSet:
- add mode disabled/always/on request

PatchSet:
- add nicer drawables

cheers

kufi

Ported to new keyguard package on LP

A bit rewrite of this feature + clean up and shorten aosp code

Change-Id: I08b5389c86f9c70e6887af5e41cb9fb0a8cf7c8a
Correct check of is user running

Before the ActivityManagerService sends an intent or
starts an activity it checks if target user is in
mStartedUsers array.

When removing a non-owner user process the
UserStartedState instance will still be in mStartedUsers
array with mState STOPPING or SHUTDOWN.

This should be checked before sending an intent or start
an activity.

isUserRunningLocked(...) will interpret mState STOPPING
and SHUTDOWN as a non running user.

Change-Id: I1b51bcdb62bdd0f6dbe05dab4d529d4ad40d0d44
Fix NullPointerException in ListView

There is a NullPointerException in `handleHorizontalFocusWithinListItem()`
because `selectedView.findFocus()` returns null and then there is no null
check when when the assigned variable `currentFocus` is used, although
`View.findFocus()` states that it may return null.

Change-Id: I6897027e9a2a238d9283e6b9f5146198989fcac0
Prevent ANR when broadcast receiver is killed

If the process of a BroacastReceiver is dying at the same time
as the system is trying to send an ordered broadcast to the
receiver, the system will try to start the process again. The
BroadcastQueue will store the BroadcastRecord in mPendingBroadcast
to be able to handle it again when the process is awake. A
timeout Message is posted to the handler of the BroadcastQueue.

As part of the shutdown sequence skipCurrentReceiver is called for
the ProcessRecord. This will check if there is a curReceiver set
for the application and make sure to finish the receiver.

Each of the foreground and background BroadcastQueues have their
own handler for managing broadcast timeouts. If the wrong
BroadcastQueue finishes the receiver, the pending timeout Message
will never be cancelled, leading to an ANR report for a receiver
that has already been finished.

Change-Id: I960c0d8f1a8b739b54a8f09f496b32a3498b9e9a
Keep deleteIntent when copying Notification attributes

Ensures that any previously registered deleteIntent is retained after a call
to Notification.setLatestEventInfo().

Currently, a call to setLatestEventInfo() effectively erases a previously
registered Notification.deleteIntent, which results in the app never being
notified when the user dismisses the notification.

This issue is described in detail in #73720:
https://code.google.com/p/android/issues/detail?id=73720

Change-Id: Ie58bf6a310058d40beb0d1af6506e9e1f4324b37
Signed-off-by: Sean Barbeau <sjbarbeau@gmail.com>
Consider RTL layout in DPAD navigation in AbsSeekBar

Changes the behavior of onKeyDown for DPAD_LEFT/RIGHT when in RTL
to move the progress in same direction as the DPAD key suggest.

Change-Id: I776a48711571884a10ef9315de78bf4ebffd6e4b
bug fix possible NPE while startProcessLocked()

In case, process doesn't create well while startingProcessLocked().
There is possibility to make NPE.
Setting app's crash handler needs to be assigned after null check routine.

Change-Id: I67fb6427f72d93f79fed36eb44c47d37eafdac31