Signal strength: add more checks to signal strength,

so it doesn't fall under the range of poor signal and automatically
assumes a gsm signal, actually checks if all values are true and not
valid then pass it on to lte or gsm. This fixes cases when gsm signal
is not valid and lte is active. When lte is active and shows a really
weak and gsm signal is not avalible due some broken vendor ril or
just running cdma lte and a few others senario creates this issue.

Change-Id: If9c5dc1a969605cd1eeb9218de02a9f8dbbd3ae1
Framework: Fix GSM signal strength

Certain OEM gsm ril libs send back a bogus value for LTE signal
that causes SignalStrength.java to default to LTE and report
incorrect signal values.
Use prop value ro.telephony.ril.v3=signalstrength to get proper
GSM signal reading on certain devices.

Signed-off-by: dhacker29 <davidhackerdvm@gmail.com>

Change-Id: I86279dcbc350fe718d89070acc12178de3c600c2
Tethering: Skip link local addresses when enabling NAT

Only one entry is allowed to be added to route table 60 for all
interface ipv6 link local addresses, so skip ipv6 link local
addresses on all interfaces when enabling NAT

Change-Id: Ibbe6c2bdae83586cdd38287089715f3433bbb91f
Signed-off-by: jiaguo <jiaguo@marvell.com>
Structure device not freed in error case

In case of an error in the call usb_device_get_fd()
the memory created by usb_open_device() is never
freed.

Added a call to usb_device_close in case of error to
release the allocated memory.

Change-Id: Iaa83674f000242d80604dd30c782236f7afd90c2
Fixed a possible infinite loop in JsonReader#skipValue()

Bug: https://code.google.com/p/android/issues/detail?id=65846

Change-Id: Idaa0e75fc5612550c4b9ccb9afa5535ea5b189df
Remove java.io.tmpdir assignment in AndroidRuntime.

This value is overridden by the framework anyway
(see ActivityThread.handleBindApplication). Besides,
it doesn't seem like a great idea to let tools clutter
/sdcard/ with temp files.

Change-Id: I26c710cbea7397f89e6103e54a73044a87da95b1
A background started service is removed from mStartingBackground when timeout.
Fix is to make sure mStartingBackground is updated to remove one.

Change-Id: I0e42beb550d33e6e400349b85bbb89848e18d520
Release locked buffer when it fails to acquire graphics buffer

The JNI buffer in ImageReader_imageSetup is not released when
it fails to acquire graphics buffer. After all JNI buffers are
exhausted, ACQUIRE_MAX_IMAGES will be returned and leads to
error. The JNI buffer should be released when it fails to acquire
graphics buffer.

Change-Id: I3319a58ac44e36c8593b404672a685c4b589a735
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
PackageManager: Fix reconnection logic in Installer.

Change-Id: Id4b352647ed51aaf64bb85dff9030a25e295758f
Smooth Spinners: Makes the loading "spinner" animation smoother in non-holo apps

The loading "spinner" animation is quite jerky by default when the progress xml's from
drawable are called in applications that don't use the holo progress animation. The holo
"spinner" animation is already smooth by default. This makes every other "spinner"
animation smooth.

We've been changing this value in all ROM's we release, both AOSP and CM based ones
as well as stock ROM's, since it gives a more polished look to the entire system. In the past
3 years we've been using this small tweak we have not noticed anything that would
adversely affect battery life or system operations as a whole.

Change-Id: I4c333ecaee72844fb4d06a3cc6925b17e2208433
Signed-off-by: Sar Castillo <sar.castillo@gmail.com>
Fix null check for BaseObj.equals.

Change-Id: I4f060697db175cbf0b5617c1220db853bbe53f1f
Avoid duplication of AppWindowToken in created Task

When WindowManagerService creates a new Task, it passes atoken to the
Task constructor. In this case atoken is added to mAppTokens list by
the Task constructor and then it is added manually again by calling
newTask.mAppTokens.add(atoken). As a result, the same atoken is present
in mAppTokens list twice.

When another window token is added to the list, it may be placed in
beetwen duplicated tokens and corresponding window will be hidden from
the screen by corresponding duplicated windows.
From user perspective it means that some windows will not be displayed
on the screen.

The issue is fixed by avoid adding atoken to mAppTokens list manually
when it was added already in Task constructor.

Change-Id: I10628e68186160fffdde07beb7d84ab3cecb7051
Harden NsdManager against null-dereference crashes

Due to race conditions or programming errors, the NsdManager
can attempt to process an asynchronous status message (and issue
a callback to the listener) after the listener has already been
removed from the NsdManager state.  This causes dereferencing of
null objects, and a crash.

Split out the three async-queue message cases:  these are ones
in which message.arg2 does not hold an NsdManager array index
and the code should not interpret this field as if it were.

Add an explicit check for "null listener" (the array index in the
message has already been released), log a warning, and exit early.

Safeguard accesses to the "NSD service type" string from a (possibly
null) NsdServiceInfo object... return a constant "?" string rather
than crashing.

Bug: 9016259

Change-Id: I40aabdfc65d86fdd0eaac7a1e7e56e6ff69796cf
Validate objects are from the correct context.

Change-Id: I7d87b0e253b8d2e36d1aed790cfe3a7dd23e158f
Fix descriptor leak after accepting connections

After accepting a connection on a listening socket and
storing the resulting FileDescriptor into a newly created
LocalSocketImpl, the new impl's "descriptor was created
locally and should be closed normally" flag should be set.

(cherrypicked from 3e7305c6bf6062b5cb1e2ddcec6c6d30b4a8bc0d)

Bug: 11805817
Change-Id: I0a1a7c62ec3fbcf647a44a22110ddc778d14e5f4
frameworks: including build.prop property "ro.config.vc_music_vol_steps"
to control music steps amount (like it is
with "ro.config.vc_call_vol_steps" and call volume steps)

Change-Id: I81a3188919482383e015974818e7042d521ac679
Service: Keep services needing restart.

Services needing restart after crash include:
1) service with 'persistent == true'
2) service explicitly reuqired restart by returning START_STICKY
   or START_REDELIVER_INTENT from onStartCommand

Change-Id: Idc490a1ceb1e151a3eb7f34b7b4cf8058a06f34a
Signed-off-by: Liangcai Li <liangcail@nvidia.com>
Tethering: fix NPE when retrieving active interfaces

When in airplane mode getActiveNetworkInfo() may return null.

Change-Id: Icba37abb51b9378c8af73d9f6587e04c588dd85e
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
SystemUI: Update Ringer tile code.

Fixed the issue when ringer tile shows not correct ringer state.

Change-Id: Iddf7122d66a86caa032b026919857ccb0fa33497