fix "Adding a list" demo code error

See: http://code.google.com/p/android/issues/detail?id=60125

The bug is on this page:
http://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog

The code for the AlertDialog "adding a list" is currently:
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setTitle(R.string.pick_color);
           .setItems(R.array.colors_array, new DialogInterface.OnClickListener() {
               public void onClick(DialogInterface dialog, int which) {
               // The 'which' argument contains the index position
               // of the selected item
           }
    });
    return builder.create();
}

It's a small error:
    builder.setTitle(R.string.pick_color);
           .setItems(R.array.colors_array, new

should be

    builder.setTitle(R.string.pick_color)
           .setItems(R.array.colors_array, new

The ";" should not be there.

Change-Id: Ib80a51287ab1d17f6f4cd9dfff0d62b9e1874623
Fixed VM memory leak in AudioSystem JNI interface

The function android_media_AudioSystem_error_callback from AudioSystem
JNI interface is using FindClass function but does not delete the
reference created by VM in this function.
By doing this call, VM will add a local reference in IndirectRefTable
and it's the caller's job to delete this reference.
By not doing this, everytime this callback is called, a new reference is
added and never deleted.
The effect is crashing the VM running system_server:

E/dalvikvm( 3071): JNI ERROR (app bug): local reference table overflow (max=512)
W/dalvikvm( 3071): JNI local reference table (0x732da288) dump:
W/dalvikvm( 3071):   Last 10 entries (of 512):
W/dalvikvm( 3071):       511: 0x42a90008 java.lang.Class<android.os.Parcel>
W/dalvikvm( 3071):       510: 0x4381fd90 android.view.KeyEvent
W/dalvikvm( 3071):       509: 0x439b9808 android.view.KeyEvent
W/dalvikvm( 3071):       508: 0x42d2fe18 java.lang.Class<com.android.server.input.InputManagerService>
W/dalvikvm( 3071):       507: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       506: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       505: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       504: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       503: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       502: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):   Summary:
W/dalvikvm( 3071):       510 of java.lang.Class (3 unique instances)
W/dalvikvm( 3071):         2 of android.view.KeyEvent (2 unique instances)
E/dalvikvm( 3071): Failed adding to JNI local ref table (has 512 entries)
...
E/dalvikvm( 3071): VM aborting

In this case, PID 3071 is system server.

Change-Id: I0c113eb72256984854d59a3ccef11a8d23f96e79
Signed-off-by: Robert Chiras <robert.chiras@intel.com>
frameworks: Make Spinner widget request the itemtype of the adapter

Prior to that change the itemtype is ignored, this prevent Spinner to
work with adapter containing multiple itemtype.

Change-Id: I1554f5bfd04c972f4eddb6da9d611b7f7ef4e0e7
ExpandableListView: Fix to nofity group collapse event

ExpandableListView is created with all groups as collapsed but this
isn't relayed to specified adapter. Fix is to invoke onGroupCollapsed
of ExpandableListAdapter via ExpandableListConnector.

Change-Id: I57614b1efb094ff7828d128c2885f7f009854984
Fix thumbnail bug

When there was no thumbnail for a given image, the getThumbNail() convenience
method could return a previously-returned thumbnail instead of null.

b/15771860
https://code.google.com/p/android/issues/detail?id=40714

Change-Id: Ibd18e048145bf347469f800afdf436247ea6b693
Add key layout file for Microsoft Corp. Xbox 360 Wireless Adapter

Change-Id: Ieed2d277e3197767c37d63cff0cedb855ee4fb74
Signed-off-by: John Grub <g@greyltc.com>
Fix "pm list permissions" crash if resource string missing

The "pm list permissions" command lists detailed information about
each permission on the system, including its label and description,
both of which can be stored as translatable resource strings in APK
files.  However, it is possible that the resource identifiers for
these strings point to non-existent resources.  When this happens, the
loadText() method throws Resources.NotFoundException, causing the "pm"
command to abort prematurely, simply printing "Killed" to stdout and
a stack trace to logcat.

This commit fixes the crash by explicitly catching the
Resources.NotFoundException exception in loadText() and returning null
if it is thrown.  The loadText() method already has the potential to
return null so none of its callers need be modified.  This fixes the
crash and simply shows "label:null" and/or "description:null" in the
output if the string resource is missing.

Change-Id: I92273399e1dac6029163750d004940ee1da67428
fix a ellipsis problem if a language setting is Japanese

CTS TextUtilsTest#testEllipsizeCallback will fail if a language
setting is Japanese. CTS program inserts the code \u2026 as an
ellipsis, but TextUtils.ellipsize() uses "..."(three dots)
internally.

Change-Id: I29056fc2e00fa45ecbecb794c62e88c78a2f4f7b
Fix systemServer crashes while running cts.

While running android.location.cts.LocationManagerTest on the Emulator,
the systemServer would crash on several tests (even if the test passes).
This is caused by calling enableProvider(NETWORK) when a NETWORK location
provider is not available.

Change-Id: I380ae59250196d8f35ca402f4d1b2c10f6d6dd22
Signed-off-by: Douglas Leung <douglas@mips.com>
Fix typo - issue 56748

Fixes a typo where the "package"
was misspelled as "pacakge".

Change-Id: I02289a1a3112d771eee7386a224b060ea1ce813d
Signed-off-by: Manuel R. Ciosici <manuelrciosici@gmail.com>
Update javadoc for android.os.Bundle.

Call out the fact that defaultValue is returned if a null
mapping exists for a given key.

bug: https://code.google.com/p/android/issues/detail?id=68453
Change-Id: Ifa6e94c1dee47809f70cadcb668cb98cb8dbef14
Fixed grammar in the comment that introduces the Debug.MemoryInfo class.

Change-Id: Ic021e689b7a8c55367277875b321358535c04e6a
Signed-off-by: justinmuller <justin.muller@acm.org>
Fix bi-directional text advances error

This bug occurs when bi-directional text is split up into left to right
(LTR) and right to left (RTL) runs. computeRunValues is done for each
run and the previous advance values are overwritten due to an offset
error. This change make sure that all new advance values are written at
the end.

Change-Id: I22cc0ae43ea9fe7862dc58ec33d7bcf8597ccbac
Fix documentation error in ImageView

ImageView.setImageLevel(int) incorrectly points the reader to
LevelListDrawable.  However, setImageLevel works with any Drawable.

Change-Id: Ib18402c336b10cd0e1e1f412a0e6acadfb9d4999
Fixed issue leading to state loss about child fragments

Fragments may now access the child fragment manager in
onCreate(). This ensures that fragments that exist in the
back stack have an opportunity to call
getChildFragmentManager().putFragment() and hence save
state that includes references to child fragments in a
reliable fashion.

NOTE: onCreateView() is not called for fragments in the
back stack.

Change-Id: Ib18402c336b10cd0e1e1f412a0e6acadfb9d4998
Correct a mistyped word "MSG_SET_CLEINT" to "MSG_SET_CLIENT"

"MSG_SET_CLEINT" is mistyped, so correct it.

Change-Id: Ib5eeaf7071e95db8b2375ca09d10420a5a445543
core: added national roaming info for Spring Mobil in Sweden...

Spring Mobil users in Sweden (MCC 240, MNC 10)
can roam on Sweden 3G (MNC 05) and on Sweden 2G (MNC 24).

Change-Id: Ie27ad3561de32557a1713d4962fcc9ec52a8b7fe
Broadcast an intent to mediascanner after executing screencap

PS2: Fix for spaces in file names

After doing screencap /sdcard/test.png in shell the screenshot is captured
but the gallery is not updated.
So we should broadcast the intent android.intent.action.MEDIA_SCANNER_SCAN_FILE
for the image to show up in gallery.

Change-Id: I8e384865082c717842d70d376d5828d74a2ad780
Signed-off-by: Umair Khan <omerjerk@gmail.com>
Current view findFocus maybe null, which cause NullPointerException.
When run monkey test on TabHost application, easily reproduce the NullPointerException.
Refactor bad code to better.
Signed-off-by: duzhaoxi <du.zhaoxi@zte.com.cn>

Change-Id: I80757489e23cedecb18a9bb978c567d02111b53c
Release SQLite page cache as much as it can

Call sqlite3_release_memory() until it returns 0

Change-Id: Id7a0942805c2c3ad5a7efe8bc3ecd8b7fffbf75b