Fixed race condition in Spinner.DialogPopup on null reference.

NullPointerException is triggered when DialogPopup is
dismissed due to object mPopup being null when not showing.
Race condition is triggered when dialog is dismissed before
touch event to dismiss dialog has been processed properly.

Fixed by adding a null check prior to accessing mPopup object.

Change-Id: I3c4fe9c279d92a7103fb4f68189d1d42beedc606
Before requerying a cursor, check if it is closed.

Before updating a cursor,
it needs to be checked if it is valid.
Currently a defence code only checks
if it is not null.
But in case of "Cursor", it is not valid,
if it is closed.
So just like in CursorAdapter.onContentChanged(),
add the additional defence code to check validation.

Change-Id: I1302f1b6d009897815d4bdb2f20f625688cf9901
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
Add NULL check in updateProxyConfig

If the exclusionList was null in updateProxyConfig the VM would
crash when converting it to a UTF8 string. Avoid this by adding a
null check.

Change-Id: I0d8106fd54385bd9ae9c652a6c67d459a119cf2b
Telephony: Modify code to check that PUK code length is always 8.

As per 3GPP TS 31.101 Release 11 section 9.6, the number of digits
for UNBLOCK PIN (PUK) is always 8.

Change-Id: I4ea69fd8e2e8e96330d10a67b2d1f5a1859c1016
AArch64: Use long for pointers in KeyCharacterMap class

For storing pointers, long is used in KeyCharacterMap class,
as native pointers can be 64-bit.

Change-Id: Idc1b39874202e96b9231d7801e6707003787659b
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
AArch64: Use long for pointers in MotionEvent class

For storing pointers, long is used in MotionEvent class,
as native pointers can be 64-bit.

Change-Id: I88ebfef26070b7f49c14945cad37aa3db209ec90
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
AArch64: Use long for pointers in VelocityTracker class

For storing pointers, long is used in VelocityTracker class,
as native pointers can be 64-bit.

Change-Id: I8c454663a97745c7440bb6f99ef49d28e9026876
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Fixed mistaken reference to "LTE".
Bug 7637224

Change-Id: I9c78fe6edd1182f8132cc5db9ecedbb69681b473
AArch64: Use long for pointers in view/input classes

For storing pointers, long is used in view/input classes,
as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: Iafda9f4653c023bcba95b873637d935d0b569f5d
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Telephony API extension v2

Added new AndroidManifest permission:

android.permission.READ_PRECISE_PHONE_STATE

Added the following PhoneStateListeners and corresponding broadcast intents:

onPreciseCallStateChanged(PreciseCallState callState);
onPreciseDataConnectionStateChanged(PreciseDataConnectionState dataConnectionState);

broadcastPreciseCallStateChanged(int ringingCallState, int foregroundCallState, int backgroundCallState,
	int disconnectCause, int preciseDisconnectCause)
broadcastPreciseDataConnectionStateChanged(int state, int networkType, String apnType, String apn,
	String reason, LinkProperties linkProperties, String failCause)

Added TelephonyManager intent actions with their extras and constants:

public static final String ACTION_PRECISE_CALL_STATE_CHANGED = "android.intent.action.PRECISE_CALL_STATE";
public static final String ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED = "android.intent.action.PRECISE_DATA_CONNECTION_STATE_CHANGED";

public static final int PRECISE_CALL_STATE_*

Moved public static final int DISCONNECT_CAUSE_* from PreciseCallState.java to a new class DisconnectCause.java

Moved public static final int PRECISE_DISCONNECT_CAUSE_* from PreciseCallState.java to a new class PreciseDisconnectCause.java

Change-Id: If3b88c679507c529b746046c4a17cf6d9974bd09
AArch64: Use long for pointers in android/os/MemoryFile

Long is used in android/os/MemoryFile class to store
pointers as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I07afc010524c16b5c852273b89becb0c08ff27d7
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
AArch64: Use long for pointers in android/os/MessageQueue

Long is used in android/os/MessageQueue class to store
pointers as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I7e901b8515a5b5e3afe1dadaaf3e5c186955c2a0
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
AArch64: Use long for pointers in graphics/PathMeasure

For storing pointers, long is used in
android/graphics/PathMeasure class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I4599a9d5f7dcf9c39838db96d9033059114d3a49
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Make YuvToJpegEncoder more JNI compliant

Minor changes have been done to conform with standard
JNI practice (e.g. use of jint instead of int in JNI
function prototypes)

Change-Id: I4015138921cc18ecae52daaa6710b3c9efd68e87
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Set Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE default value

To be able to customize the "WiFi scan always available"
setting we need to set a default value.

Change-Id: I3673f2613ab9b6a947aed7e29d4cc876140c2180
Merge "Add NULL check in updateProxyConfig"
AArch64: Use long for pointers in media classes

For storing pointers, long is used in media classes,
as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: Idc4ca0124d03df7f9cef412488abafd020e5e774
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
AArch64: Add AssetInputStream.getNativeAsset

This patch adds AssetInputStream.getNativeAsset. This function
returns asset pointer, which can then be passed to JNI functions.
Note that this function is hidden and not part of Android API.

This function will eventually replace getAssetInt,
once all the classes that use getAssetInt are changed
to use getNativeAsset instead.

Change-Id: I2a2b2e6864f1f57ae2b3a10c45559b3635266ed5
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
AArch64: Use long for pointers in Movie class

For storing pointers, long is used in Movie class,
as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I946325e4af6cb9282012bebdaee89e1117d8797b
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>