handle IllegalStateException from Surface.lockCanvas

Symptom: SystemServer crash because of this exception on startingWindow
Root Cause: IllegalStateException from Surface.lockCanvas
Solution: handle IllegalStateException from Surface.lockCanvas

Change-Id: Ifb1b3b72877dfd9994ebf17dcef4778f88821301
Forced to update whole region in case of computation error

Symptom: unexpected render result (a line is not refresh)
Root Cause: computation error between dirty rigon and drawing area
Solution: Forced to update whole region in case of computation error

Change-Id: I227ceb2cc14294ae2e4276b8c62b05ec758f1d56
automatic translation import

Change-Id: If96017523dce420403b5e13af1f5d0191ed7ecf5
NotificationHostView: fix some nullpointer exceptions, code cleanup

Change-Id: Ife281ec249f6c984cb25ef450319928579637a7d
Revert "Avoid collision with RIL constant 1138, used in some Samsung devices for RIL_UNSOL_TETHERED_MODE_STATE_CHANGED."

Later Qualcomm RILs will use the STK_CC_ALPHA_NOTIFY message, and this
causes the radio to parse the parcel in a very incorrect manner.

This reverts commit 8e3fee66ff3a1d55f1aa69df7b52fdcab33f1f82.

Change-Id: I94e2867f130b88c4c9eff17293edd0b64dda516a
Fix wrong scaling of QS tiles

Also increase margin with the number of tiles shown
and tweak sizes for better usability

PS2: Whitespace fix

Change-Id: I78a1e0d41d487ac48edc5f8992b7d5c95fbbfa71
Tethering: Enable NAT only when tether and upstream ifaces are different.

When enabling WIFI hostspot, chooseUpStreamInterface will choose WIFI
interface as it is still up. It will result in both tethered and upsteam
interfaces are same one. netd will reject this command and tethering
will fail this time.

This fix will not send NAT command to netd when it found these two
interfaces are same one. Later when the real upstream interface is
brought up by ConnetivityService, Tethering.java will continue the NAT
procedure.

CRs-Fixed: 692285
Change-Id: I1ecd700ad64748c3745fffc76b7ac0e7d7b9b96b

Telephony: Avoid Infinite loop problem in Tethering

1. Whenever data is enabled we will try to establish the tethered
call (USB tethering enabled case) for 5 fixed number of retries.
After reaching maximum number of retries we are turning off the
upstream connection. whenever the CONNECTIVTY_ACTION received
(because of USB cable disconnected and then connected case or
some changes), it can try to bring up the dun/hipri PDP again.

2. There is no retry in case of data disabled case.

Change-Id: I16af4d2983a8bf9ce0ce904877f86169bca549b4
CRs-Fixed: 401829
(cherry picked from commit 4c923c8537fdc49ef491b964adc1871c77bfd730)
(cherry picked from commit 3135e6a89ac14008df04fe6e068bd8dd95b4ee40)
(cherry picked from commit 137b7004f716a559c7249be20e25544fe10330b6)

Broadcast tethered client inteface along with upstream interface name

On change in tethering upstream interface for IPV4 of IPV6 address,
broadcast an intent with both tethered client interface as well as
upstream interface name, ip address type and update type.

Change-Id: I2f23e2b8ec125339bedd454446accb23e33cacae

base: Add P2P interface "p2p0" to tethering support list

Dnsmasq is running as singleton pattern, P2P GO start DHCP server fail
if dnsmasq has been started by USB tethering. Tethering management
feature in Tethering.java just support soft AP and USB tethering. Add
P2P interface "p2p0" to tethering support list.

CRs-Fixed: 719930
Change-Id: If3a07e6cac1678dfedf361abf99f52bc12a2f697

base: Fix for wifi tethering crash

Pass network info along with CMD_UPSTREAM_CHANGED
Added a NULL check for Network info in CMD_UPSTREAM_CHANGED

CRs-fixed: 562910
Change-Id: I98bd37205255d9d4025cfb95b0688c68bce3c9bd

Tether: fix the retry issue in Tethering

Since StartUsingNetworkFeature will always return success, it's
not a good place to set retry. With this modification, the retry
will work.

Change-Id: Ia2ea489ea57f99617004093bfedc8e7e6dba46ed
CRs-fixed: 667865
extmediaplayer: miscellaneous fix

Fix for issue 20936 reported by KW.

Change-Id: I512657696d99bbe64edfffa0ad7c687651a31acc
Fix memory leak in nativeDecodeFileDescriptor

Fix memory leak in nativeDecodeFileDescriptor:
SkFILEStream::kCallerRetains_Ownership is used to keep
life cycle of file in Java,so fclose is not called when
destruct SkFILEStream because ownership not belong to
native here, while when file is closed in Java, close
is called instead of fclose,that means buffer allocated
by malloc in fseek, when create SkFrontBufferedStream
with this filestream, will not be freed, because this
buffer will only be freedin fclose.
To fix this issue: duplicate this fd, and use
SkFILEStream::kCallerPasses_Ownership for SkFILEStream,
means Java and native manage file life cycle separately.
CRs-Fixed: 718738

Change-Id: I1c664551ab8d381db2e1f948a2207bc6fb7a11f9
AudioService: Fix monitorRotation for landscape applications

Current implmntation only sends rotation updates on orientation
changes, so does not handle direct 0<->180 or 90<->270 transitions.

Update rotation based on an OrientationEventListener instead of
Intent.ACTION_CONFIGURATION_CHANGED

Bug 17606902

Change-Id: I01dfcd1c587f5b2e8a96365c2389782ad77936ef
Fix an overflow found by ASAN.

Sometimes len is 0.

Change-Id: I031000188edc57663a5519b00cbbb751600d32f4
 MTU should be 1358 as per 3GPP standards, especially for LTE radio interfaces.

Change-Id: I5d3601b05a41d4c59cff3b39ddfb66d00cb23c45
Signed-off-by: Stacy Devino <swylie@oceusnetworks.com>
Automatic translation import

Change-Id: I7468481e50d23d5dd63b8a5ae48b6612207b9917
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
Keyguard: Move string to cm_strings

Change-Id: Id8ef38fdf57a01367f431e3397f4b4ec245d7fcc
Rename "Wi-Fi AP" QS tile to "Wi-Fi hotspot"

Change-Id: Iaa182e5dda2be940fbfd13d6410db327ed08a18c
move pa strings into custom strings for translation

Change-Id: Ibbaf5a08cca2733a2253f438b56f9aaad233c7b5
symbols: Remove duplicate symbol

* Also move intrusive notification LED symbol to the correct place

Change-Id: I0360f3faf08c1d36b47262dca596b2a48481826e
Add string resource for UICC storage

This will add one more string resource for the devices
which has UICC support in settings->storage option.

Change-Id: I19a5813749f51aec841769aa8d21792716d033a7
Revert "services: don't clear wallpaper when SystemUI"

This reverts commit da206ed880afb4c1629fdc0379efef2c593358cb.

Change-Id: Icdb36d4632d85ac5172b6b42d7598eb827b62e2e