LockScreen: Fix crash when unlocking twice

This will keep track if the BroadCastReceiver is registered and
will unregister it only if so.

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

Conflicts:
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
Lockscreen Longpress: Unlock Logic

In my opinion, we should unlock after
    user removes their finger.
This matches short-press unlock better
    and allows the user to change their mind
    on a target (I do that a lot).
Added a vibration action on longpress
    being true.

Change-Id: Ife590119dbdf10474b9c62f252e7f5d6dfc87387
KeygaurdSelectorView: Unregister reciever in onPause

Also check if we already have a reciever instance before
creating a new instance

Patch Set 2: Refactor field reciever to mUnlockReciever
           : Add null check to Context#unregisterReciever
Patch Set 3: Add null check to Vibrator#vibrate(int);
Change-Id: Ie9b03b20da29d05a64293ef6b7931393c34796a2
Fix Lockscreen FC/reboot

PS2: register receiver in onResume()

Change-Id: If475f0750bbc408e727eb0d3cf532c936ad418e8
Signed-off-by: Gergely Szell (sethyx) <szell@hu.ibm.com>
Avoid NullPointerException in getHandler()

mAttachInfo may be set to null by other threads while running
getHandler().

This fix assigns mAttachInfo to a local variable. Checking null pointer
and getting a member variable are executed through the local variable.
This local variable is constant. So NullPointerException doesn't occur
even if mAttachInfo is set to null while running getHandler().

Change-Id: I4013dfb7951bd864628868ed58f8c4f5b7cbd1d3
Recognize odex files in memory accounting.

Give odex files the same heap category as dex files.

Change-Id: I82539e20ac20a2b80c63c0cfceb266d9c59e22b7
Free resources in correct order in ResStringPool::uninit

mOwnedData contains the mHeader data structure

Change-Id: I0ae9ba3a0d18fc3f368c629501fadebce8807198
Remove duplicate code in Editor.java

Eliminate duplicates by calling resumeBlink()/suspendBlink().

Change-Id: Ia19ae1bf1a5c981700aa20be67ed9d557e2bfc56
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
removing ineffective code in WifiService.java

no need to use wrapper class Long.
I think this looks like typo.
However, this fix will give us more space.

WifiService.class 33646 -> 33541.

Change-Id: Ia3a57285170315a9563c6ccf687424fe95ccc2df
A tiny optimalization

Change-Id: Ib2cb773ffe5cb579c2b46bd0e6a5a3f2c55d190d
fix potential memory leak

use delete before return

Change-Id: I5449ad90bb6910f057bd825b722c9803a7343c34
framework:When turn off of SoftAp immediately call turning ON SoftAp

Due to sub system restart,There is state change of softAp tether state machine
in tethered state triggering turnoff SoftAp this should be
follwed by turnon softap.

Change-Id: I93051f17bcaae72ae0694f1f23557cc1d3bea280
Optimize drawHardwareAccelerated method in Editor class

When inserting a new line or breaking a line,
every display list was invalidated and rebuilt before.
However, we can reuse the display lists above intactly and also
reuse the display lists below with only updating drawing locations.

This patch reuses the display lists if possible.
The display lists above the inserted line are just reused
and the display lists below are reused with only updating
drawing locations not fullly rebuilt.

mIndexOfFirstChangedBlock is the index of the first block
which is moved by inserting or breaking a line.
So the display list whose index is >= mIndexOfFirstChangedBlock
only needs to update its drawing location.

Change-Id: Ica20deb0ebb5750de21356ed31fa9f86e657ff92
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Fix logging typos in GpsLocationProvider

Change-Id: Ibf12947f3758defee990fbf685323334b8d1eeda
Signed-off-by: Magnus Eriksson <eriksson.mag@gmail.com>
Race condition in Toast.

1. mTN.mNextView set in toast.show() but can be invalided by posted
runnable mTN.mHide. If application call toast.cancel() right before
toast.show(), this problem happen.

2. mTN.hide() is called twice if toast.cancel() is called.

Conflicts:

	core/java/android/widget/Toast.java

Change-Id: I554c5d44c59e18f5066f6175faec3e256b4e40d6

Conflicts:
	core/java/android/widget/Toast.java
MediaScanner: delete abnormal elements in prescan procedure.

There is a race in MediaProvider's mUnmountReciver.
when it doing external storage's database clean up at power down procedure,
if the datebase is big, system may shutdown after db.update, but db.delete
not done, there will be many elements with no filename in the database.
That may cause duplicated files and folders shown in MTP.

This patch clean up these abnormal elements in MediaScanner's prescan procedure.

Change-Id: I0a3dacffd12892b1a2a892b2749a02ab3dea109b
Author: Liang Wang <liangx.wang@intel.com>
Signed-off-by: Liang Wang <liangx.wang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 58969
Detach engines before destroying WallpaperService

WallpaperService contained a race condition where the service might be
destroyed before all its engines had been detached. For subclass
ImageWallpaper this would leak the engine's BroadcastListener, which in
turn would trigger a system crash (as ImageWallpaper runs as part of
the system).

Change-Id: Ia900173a1d3070cbf6bcf769f68376c8c8cbc62a
just a lil tweakaroonie to make recents draw with hardware acceleration

Change-Id: I179733ba231af1b45f5608d47cc00a4096643538