National Roaming: Allow T-Mobile AT (MNC03) to roam on 3 AT (MNC10) in Austria

Change-Id: Ief827259fdcb5bfa13bd643f80a8547a56cc934c
Use alpha channel instead of red in drawCachedGlyphBitmap

the correct value to copy in bitmap is alpha component from
the cachebuffer. currently it is offset to red channel if format is
RGBA which is wrong.

this is followup fix for https://android-review.googlesource.com/#/c/93943/

Change-Id: I96b5ba35df5ccaef44caf2542d35d6585ba1df80
Signed-off-by: Digish Pandya <digishp@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
Virgin Mobile (MNC07) considered non-roaming on Movistar (MNC02)

Change-Id: I46a782aefbe62295d6ce9d3c15a2e25630bdcacc
base: App crash when select suggestion's length more than specified.

App crashed by catch IndexOutOfBoundsException which raised
by check span range when select suggested string.The root
cause is that the editor will truncate the suggested string
which length is more than it specified, but it also set span
use the suggestion's original length.

Update the suggestion's real length after editor replace the
original string to suggested.

Change-Id: I2d765701934a9e68be172cb87a104590f3cdeceb
CRs-Fixed: 532211
Fixing IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within the loop may delete
the elements from History stack.

Change-Id: I195da10a8e9161572bdb653ad3021998d4f2a939
CRs-Fixed: 651963
Added validity check for Pointer Index

Checking if the pointer index is valid before querying for X & Y
coordinates. This is done to avoid IllegalArgumentException.

Change-Id: Ic7f3022d33c313a0bfe8b55c9bc89019b33d23b7
Frameworks: Fix to avoid crash when the tab is not set.

Tab is not highlighted in Videoapp unlike Music app.
Instead the list is highlighted with mSelectedTab a negative value
when onFocusChange is called.
Add a check for mSelectedTab.

Change-Id: I930657b8a9be4be4d973f876242a15a667ec6f94
CRs-Fixed: 657606
audio: Inform audio HAL if it is a voice call initiated by Telephony

setMode() API with IN_CALL mode can be called by any of the Apps.
In HAL, it is required to distinguish if it is a real voice call
or not. Inform to audio HAL if it is a voice call by checking
getPhonestate() updated by telephony.

CRs-Fixed: 662804
Change-Id: I20a661f49f6566bdd1e23d6de18b509e2728ef19

Conflicts:
	media/java/android/media/AudioService.java
Fix the texture ID reuse issue in HWUI.

Issue: When the layer of previous frame is destroyed, it doesn't clear the
texture id in mBoundTextures[mTextureUnit], so in the next frame, if
glGenTexture returns same texture ID of the previous frame,
the new texture is not bound.

CRs-fixed: 671736

Change-Id: Ifc5fd2115fb1863b3c006ab14b0faabeaeb4eab4
update parameters in uploadToTexture() for GLES20

Google optimized the uploadToTexture with GLES3.0+,
This allows us to upload a sub-rectangle of texture,
but this has compliance issue with GLES 2.0.

With OpenGL ES 2.0 we need to copy the bitmap in a
temporary buffer if the stride doesn't match the width,
and then upload entire temporary stripes.

Change-Id: I8987cd8347913c61b7fa45bd47be1189aa6bdb05
Signed-off-by: Shenghua Lu <shenghua.lu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Guobin Zhang<guobin.zhang@intel.com>
base: Add support for FLAG_SUPPORTS_PROTECTED_BUFFERS

For the clients (WFD) which need secure HWC composition,
FLAG_SUPPORTS_PROTECTED_BUFFERS need to be set.
- Define new flag VIRTUAL_DISPLAY_SUPPORTS_PROTECTED_BUFFERS
- In VirtualDisplayAdapter, add support for the flag
FLAG_SUPPORTS_PROTECTED_BUFFERS.

CRs-Fixed: 653794
Change-Id: Ib954943f3e27067b2805188771f951c115833237
Common: Add the api to parse the string to current language

These APIs are used to parse the text to local languange.
For example, if the carrier name in English is got from network or SIM card, we will
use these APIs to parse it to local language and display it to the user.

Change-Id: Id4922c526d77f434b43c5ac013472b6a1cd5069c
Do not kill app when closing floating window

Change-Id: I151a475cd81354153951549a6f752b771f04be30

Conflicts:
	packages/SystemUI/src/com/android/systemui/slimrecent/RecentPanelView.java
Fall back to "tl" if "fil" is absent.

For JB-MR1, there was a hack that used "tl" where
we really meant "fil" because ICU didn't have localizations
for "fil". This has now been fixed, and we now support 3 letter
language codes for AAPT so we can use "fil" where required.

For the benefit of apps that need to target older platforms,
we fall back to "tl" if the app has assets for "tl" and the
resource locale is "fil".

See bugs 7291355, 7207176 and 8049507 for more context.

Change-Id: I1ac8502525f99b40f9091d5efd2df33518d47a41
Fix broken assumptions in LocalePicker.

This code assumed that the locale is always 5 chars in
length and was of the form xx-YY. This is not necessarily
true. The language can be 3 letters in length and the locale
might have a script and variant.

Also cleans up several nasty pieces of code and eliminates
unnecessary array copies and improves readability by using
idiomatic java.

bug: 15873165
bug: 10090157

Change-Id: Iab1cfd7b78e5772b1245654f2153caf63a96033d
Show number of devices connected to the WiFi hotspot in notification

Change-Id: I8378e0ae07332f62b92a1681951f1236f6ef5ff9

Conflicts:
	core/res/res/values/symbols_custom.xml
Fix NullPointerException in ListView

There is a NullPointerException in `handleHorizontalFocusWithinListItem()`
because `selectedView.findFocus()` returns null and then there is no null
check when when the assigned variable `currentFocus` is used, although
`View.findFocus()` states that it may return null.

Change-Id: I6897027e9a2a238d9283e6b9f5146198989fcac0
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 the bug in replacing a fragment with itself.

Summary:

We are facing a bug that some fragments in our app got removed
randomly. We debugged the app and it seems there is a bug in
the fragment API.

When we we are trying to replace a fragment with itself. We will
try to make the operation a null op, then both `op.fragment` and
`f` will be reset to null.

  op.fragment = f = null;

But since it's inside a loop, if the list `mAdded` still have
items to be visited, the code will continue to the next
iteration. Then it will compare the fragment with null, and
reach the line:

  mManager.removeFragment(old, mTransition, mTransitionStyle);

Eventually it will delete all left fragments in the list `mAdded`.

This diff adds a break to abort the searching after we null
the operation.

Test Plan:

1) Tested with our app. No fragment is randomly removed.

Revert Plan:

Change-Id: I5dc2c07a1bb1d1da1b0fd4e5610d970d55a81e86
Tags:
Signed-off-by: Kang Zhang <kangzhang.cn@gmail.com>
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