Telephony: Register/Unregister Phones with CallManager

Unregister the outgoing phone and register the new one when Technology change
is detected. Otherwise, CallManager keeps trying to use an already dead phone,
which causes a crash

Change-Id: I2a04c76ce882d034d1a2073d2a9f9739d4dd9a38
Adds documentation to CdmaCellLocation get lat/long methods

Adds better documentation to the getBaseStationLatitude() and
getBaseStationLongitude() methods to indicate the units for latitude
and longitude in CdmaCellLocation. Unlike the Android Location API
methods, latitude and longitude in CdmaCellLocation are not in decimal
degrees but instead in 0.25 seconds due to a more obscure 3GPP standard
underlying the Telephony API.  The current Javadocs on the Android
developer page (http://goo.gl/hvWo6) do not indicate the units for
latitude and longitude in CdmaCellLocation, making it very difficult
for developers to interpret the output of these methods, especially
since 0.25 seconds is not a commonly used unit for latitude and longitude
in application-level code.  This patch adds clear documentation to
these methods so developers can clearly understand the units for
latitude and longitude without having to dig through the Android
platform source code.

Change-Id: I259bfe3b68e3999804877821680fb99a22937651
Signed-off-by: Sean Barbeau <sjbarbeau@gmail.com>
MountService: unlink death notification when unregistering listeners

Change-Id: I09045cfe67f7da84bc68a50fc5440ea2c6b754e5
Modify installd to set the SELinux security context on package directories.

installd already sets the UID/GID/mode for package directories.
Extend it to also call libselinux to set the SELinux security context.

Change-Id: I22d38e3e7facdfcee20a34bf30f1412dbb87761f
Improved documentation (clarify on issue 8727)

Signed-off-by: Jacob Nordfalk <jacob.nordfalk@gmail.com>
Change-Id: I2bea866542c95eb0558004a64c9a2fd74aeff35b
ApplicationThread: Check interface before invoking scheduleLowMemory

Change-Id: I51317386e1729366d19f7e3a1747b05170b9305a
SystemServer: Looper's getMainLooper to return ServerThread

Fix to ensure Context.getMainLooper and Looper.getMainLooper
returns ServerThread for system_server. Currently, Looper's
getMainLooper returns null.

Change-Id: I5324a1cc00e27a79ba97836a9377a584e6f76b15
ImageWallpaper : get bitmap width before calc screen offset

Inside drawFrameLocked, updateWallpaperLocked() is called after
calculae drawing offset using mBackgroundWidth/Height. Because
mBackgroundWidth/Height is modified inside updateWallpaperLocked(),
it sould be called before Mbackgroundwidth/Height is used.

Many market launcher and some phone vendor launcher call
suggestDesiredDimenstions with argument (w,h) instead aosp's
original (w*2,h) for single page wallpaper. In that case, when
launcher orientation changed, ImageWallpaper does not properly
display wallpaper image and mostly you can see Black Edge at
left.

Change-Id: I93ebc4337b01f73d3154346943afa4afd6b1988a
Build overlay packages just like regular packages.

Previously, building overlay packages required passing aapt its -o flag.
This commit decouples the idmap generation code from the effects of the
-o flag.

Since this commit renders the -o flag obsolete, support for the flag was
removed from aapt as well.

Change-Id: Ied2e0ab8cb800e49623f0a2044b06cd4935473d5
WallpaperManagerService does not properly propagate setDimensionHints()

During bootstrap, Launcher could be initialized in between
WallpaperManagerService and ImageWallpaper. In case Launcher's
WindowManager.suggestDesiredDimenstions() is called after
WallpaperManagerService begin to create ImageWallpaper and before
ImageWallpaper Engine attached, that mostly resulted in Black Edge
of image wallpaper.

This can be reproduced easily (1 in 3)
 - set image wallpaper other than default.
 - modify Launcher/Workspace to call suggestDesiredDimenstions(w,h)
 - reboot

To fix Black Edge, WallpaperManagerService modified to maintain
a flag mDesiredDimensionChanging and set desired size at Engine
attach. Black Edge still can be shown for some moment. but, always
recoverd. To eliminate Black Edge it seems that
IWallpaperConnection.aidl need more method.

NOTE: Many market launcher and some phone vendor launcher call
suggestDesiredDimenstions with argument (w,h) instead aosp's
original (w*2,h) for single page wallpaper.

Change-Id: Ib28636e6b2964d9deeee1f1e1d304554cc7a837e
Wipe the user data out in any case.

When the external storage is not mounted, the android system won't
wipe out the user data (i.e. "/data") if wipeData() is called with
the flag WIPE_EXTERNAL_STORAGE.

We think that the user data should be wiped out in any options and
also wipeData(int) method currently supports also for a external
storage. So we will also change the API reference comment.

If we should care about backward compatibility of this method behavior
with the option WIPE_EXTERNAL_STORAGE, then we would add an another
bitmask something like a ALWAYS_RESET.

Change-Id: Id7bf673c722bacc0480d32e46553b9a348513879
Runtime resource overlay: clean-up.

This is a combination of three minor clean-up tasks:

- Generate correct idmap even if name lookup fails:

  Any resources following a resource with a spec but no actual values
  would receive an incorrect ID in the idmap due to an accumulating offset
  error. To combat this, a dummy value is inserted in the idmap whenever
  a resource with a spec but no values is encountered.

- Optimize pruning of padding zeroes in idmaps:

  Earlier, trailing zeroes were iteratively popped from the end of each
  type block of an idmap. This commit instead tracks where to make the
  cut, and does so with a single function call.

- aapt: warn about resources which lack values:

  The resource framework assumes every resource to have a value for
  at least one valid configuration. However, if multiple resource
  directories are used (several -S options to aapt), the list of
  configurations is limited by dpi (-c option to aapt) and a resource
  is only available in discarded dpi configurations, aapt will create
  a resource entry where each configuration lack an actual value. This
  commit lets aapt emit a warning whenever this has happened.

Change-Id: Ic7451b7f4adfef5bfa6b0d7e64e057f317a2cdaa
Improve robustness of resource overlay test suite.

Test runner will now create directory /vendor/overlay/framework, if
missing.

Also, move wallpaper from drawable to drawable-nodpi for it to actually
take effect on ICS code.

Change-Id: I7615345e847c5fca91aedc459f6aa3316a45aab5
Avoiding horizontal keypad navigation trapping within gallery.

Non touchscreen devices such as Google TV require the keypad
navigation to properly move the focus among widgets.

The Gallery is misshandling the keypress event and avoiding
the focus from going to other widgets on it's sides upon
keypress even after the user has reached it's first and
last items.

Change-Id: If32ee57e8513cac692deb161e1941d6cc85e3188
Signed-off-by: David Sobreira Marques <dpsmarques@gmail.com>
stagefright aacenc: Add parentheses in expression with mixed && and ||

This doesn't maintain the exact behaviour, but seems closer to
what the original author probably intended.

This avoids a warning.

Change-Id: I191292faa0a25f715f2b7d46ec770827e2ac0b7b
Add a new API on DRM Framework for streaming

In case of DRM streaming, decrypt session can start just after
receiving the header, and it doesn't need to wait for the entire
content. However, current API of DRM framework only accepts file
handle or URI. With this new API, DRM session can start
without waiting for the entire content.

Changes are made by SEMC and Sony.

Change-Id: I74375fe127df636067f1c300ea91654ba3d1aa3c
Fixes an issue that occured unexpected exception "pointerIndex out of range".

The findNewActiveIndex method may return -1.
So, the code should check case of -1 before event.getPointerId
and if index0 is -1, gesture should be ended immediately.

Change-Id: I4aae5c84e3db61d10b0bfcfa7bfa6b9115231a52
Fixed group and child view caching in SimpleExpandableListAdapter.

Now the adapter reports the correct type count and type for group and child
views by overriding the respective methods from the base class. Each group
view has two types, one for expanded views, one for collapsed views. Each
child view has two types, one for the last view within a group, one for the
other views within a group.

Change-Id: I117b2c0f7e98fb7fe2fdd35c15f7d1f9dc06674f
Signed-off-by: Georg Hofmann <georg.hofmann@gmail.com>
Modify getState to prefer AKEY_STATE_DOWN and AKEY_STATE_UP over AKEY_STATE_UNKNOWN.

For the getState() routines that operate on multiple devices / mappers:
Return AKEY_STATE_DOWN (or AKEY_STATE_VIRTUAL) if any of the devices/mappers
have the key down.
Otherwise, return AKEY_STATE_UP if at least one device/mapper returns AKEY_STATE_UP.
Otherwise, return AKEY_STATE_UNKNOWN.

Change-Id: I45a1f83d751c3c0cbfcc744dd3d6f0137ec8e01a
Fix off-by-one error when filtering application UIDs

A filtering check in writeLPr() mistakenly includes the first application UID
(10000) with the result that the package with UID 10000 is missing from
packages.list. This patch fix the error.

Change-Id: I3651beb346290db8e09317391b95a77aed1946b6
Signed-off-by: Magnus Eriksson <eriksson.mag@gmail.com>