Properly null check all button usages.

Users might have hidden them.

Change-Id: I7f52d570cf4ef0833c6bde9159475345d581a00f
frameworks/base: Fix for the race in Wallpaperservice

Wallpaperservice has a race among message handler of
DO_DETACH and service's onDestroy. In certain cases,
the engine kept track in mActiveEngines is removed by
message handler of DO_DETACH and service's onDestroy
doesn't get a entry in mActivieEngines and isn't able
to invoke detach. This keeps the broadcast receiver,
mReceiver active and is unregistered by the framework
and a corresponding leak is reported.

  Later, the message handler of DO_DETACH continues
and invokes detach on mEngine, which attempts to
unregister mReceiver and framework throws an exception
"Receiver not registered: android.service.wallpaper.
WallpaperService$Engine$1@40874580" and causes the
framework to reboot.

  In case of system_server, WindownManagerPolicy and
android.server.ServerThread contest for access of
shared members, mActiveEngines and mEgine. Fix is to
protect the critical section via synchronized block.

Change-Id: Ice79cb8344fb54bcc6e9f76f4b143daac2608d7b
memoize activity manager graphics acceleration check

also account for devices without hardware rendering support

Change-Id: Ib400d85a261d9c5d0fd5770d6cda5f61832cba6b
services: don't clear wallpaper when SystemUI
disconnects.

When we restart SystemUI (or the user), sometimes
the wallpaper would get cleared. This patch just
captures its originating component and
if that is our SystemUI component, ignore the event.

Change-Id: I3e159dc2c013e7d7e552e3c0cef55e3ab970ca87
Signed-off-by: Roman Birg <romanbirg@gmail.com>
StorageManager: fix android.process.media process stop while plug a discontinuous partitioned SD Card

While get volume state, throw an IllegalArgumentException, catch
this exception in StorageManager and return null to MtpService to
avoid process stoping.

Change-Id: Iebb5c38e375d3f54505d9b9d64fcd0f02a2b60c1
Author: Li Gang <gang.g.li@intel.com>
Signed-off-by: Li Gang <gang.g.li@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 47459
Fix to NullPointerException when activity is relaunched

When ChooseTypeAndAccountActivity is relaunched and resumed
by ActivityManager a call is made to onActivityResult without
first triggering onResume. This leads to mAccounts object
still being null.

Fixed by properly setting mAccounts object if it is null prior
to use after function onCreate has been called.

Change-Id: Ife7e1e052c473970d923fa43ee6189eb62a1113b
Remove possible leak when exception occurred.

nameUtf8 is not released after exception.
In addtion, Fix code going down after ThrowException.

Change-Id: Id46e8ed55acd98e982ae532f7da2c0c48847f010
allow wallpaper cropper to read sdcard

Signed-off-by: ChampionSwimmer <championswimmer@aokp.co>
BootReceiver: Skip subdirectories inside tombstones scan

Properly handle (vendor-specific) subdirs under tombstones
directory by skipping over them.

CRs-Fixed: 407529
Change-Id: I0cecd9fa629fad35d62d508ddaf13968c2e46f93
(cherry picked from commit 1440830e6ea3097278bc74762f09a21854d1b416)
(cherry picked from commit e042bd6f036a6dd3af4924b9a9111d9499259ae4)
Turn on verify app by default

Change-Id: Ibd96502059c84210ad84ecb03aac5eca28f3c9fe
Turn off carrier provisioning by default

Whether or not to use carrier provisioning is a setting hidden to the
end user that is currently not set. Unfortunately, on some carriers that
may result in it being set to yes, or effectively set to yes, without
other accompanying changes that must occur, such as setting a tethering
apn and possibly having a carrier provisioning app, resulting in hitting
a paywall when a tethering plan exists, or, worse having nothing happen
at all when you try to tether since the data doesn't have an apn set.

Change-Id: I3b5b3cc86e3325302411f46e3fd5f7a7c1b9f57e
Recents: Always show translucent decor
Add german translations
Fix inconsistency in LoggingPrintStream.

LoggingPrintStream prints "null" for null strings from
print(String) but throws an NPE from println(String).

Fix this by delegating to the underlying builder (and avoiding
the "fast" path when the input String == null)

bug: https://code.google.com/p/android/issues/detail?id=63380
Change-Id: I89c5c12db6ed5af8037d46f67369b38c5b4cbc9f
add a missing recycling call

Change-Id: I09af07c836ab20242d3cc3cb47d5311ad210cb49
WindowManagerService: fix application transitions in expanded mode.

Change-Id: If7d3fc3ab566dedc3a5b38cd0a6dc3185f494e20
base: added national roaming info for Play in Poland

Cherry-picked from OmniROM:
https://gerrit.omnirom.org/#/c/3382/

Users of Play in Poland (MCC 260 MNC 06) can roam on
Plus, T-Mobile, Orange (MNCs 01/02/03)

Change-Id: I8ea62b0ca40bac9ced11802ee8ef583d6392a199
core: added national roaming info for Free Mobile in France

  Users of Free Mobile in France (MCC 208 MNC 15)
  can roam on Orange (MNC 01)

Change-Id: I2c0c3940a72262b1257fb1c2dfdd01da652d2959
National roaming info for Drei in Austria

3AT roams in T-Mobile AT networks

Change-Id: I915edccf92bcbb088fa25b958eb345c624f61597
DocumentsUI: Add a standalone File Manager

This commit adds a standalone mode to the DocumentsUI, to let
it act as a file manager/explorer.
You can browse your storage contents, open files, and delete them,
as well as do everything that the DocumentsUI can do (ie. sort
by name/size/type, list and grid view, recents, search, ...).

This gives us a consistent file browsing UX accross all apps
that uses the new documents API.

Change-Id: If73a3c100f010bdb766c843976d4fd3573ea805c