device panel and process chooser: Show user id if applicable

On a multi user device, append the user id to the process name
so as to allow distinguishing between the same packages running
on different accounts.

Fix for b/16701966

Change-Id: I247d7fa50845feda88a3040537e13ab167750b5e
(cherry picked from commit 03045f423409f340f0fa3f5fa2e2fbd85d044b66)
Merge "device panel and process chooser: Show user id if applicable" into idea133-milestone
Replace treeStructureProvider with nodeDecorator

We introduced a treeStructureProvider earlier (1c68971dea0) in order
to change the displayed name for the build folder in cases where it
is outside the project root. This provider was then enhanced
(in 49af431c) to customize the icons displayed for modules.

Both these use cases can be handled using node decorator instead of
a full tree provider. This CL removes that tree structure provider
and replaces it with two node decorators: one that updates the build
folder name and another for the module icons.

Change-Id: I8f41e699cddd0384c93f17e10ad9dfbcc7fd03f9
(cherry picked from commit 6ec816c056bb6aeedac6139903202c2f312c6a1d)
Merge "Replace treeStructureProvider with nodeDecorator" into idea133-milestone
navigator: Provide VIRTUAL_FILE_ARRAY context data

This is required for certain actions that look at the list of
selected files. e.g. Synchronize selected files needs to know
the list of files that have been selected.

Fixes https://code.google.com/p/android/issues/detail?id=74054

Change-Id: Ib763729af4d5d3c3aad43e21833dbcae758eb7ab
(cherry picked from commit c9c25dc9c8ba90caab24f4447f01252c64033fde)
Merge "navigator: Provide VIRTUAL_FILE_ARRAY context data" into idea133-milestone
navigator: Show source providers for java packages

When multiple Java sourcesets are present (from different source
providers), the android view simply puts them all inside the java
source type. This results in a view like:
 - java
   -- com.foo.pkg
   -- com.foo.pkg
where the two packages come from two different source sets, and
are physically present in different folders (src/main/java and
src/debug/java for example).

In order to distinguish between these two, this CL appends the
name of the source set to those packages.

Fixes https://code.google.com/p/android/issues/detail?id=74149

Change-Id: I3afd24b9f52064e1aad17d4ae9b6582cb8d9b345
(cherry picked from commit 6d4225e7468f36042d2b169f3b7cf95758b51d66)
Merge "navigator: Show source providers for java packages" into idea133-milestone
Apply node decorators only in the project has an Android Facet.

This CL re-implements commit 89a83f764 done by Jetbrains in
the master branch. We don't use a tree structure provider anymore,
but we include the same checks in the node decorators.

Change-Id: I95a9103abfaf4fd38f531414f9c744e8a8e07d25
(cherry picked from commit c9fdfce7b3808f7ce28f6fbe5d3dd4131fe5b70a)
Merge "Apply node decorators only in the project has an Android Facet." into idea133-milestone
Fixed issue where resources in AAR dependencies were not found.

Apparently Android Gradle plug-in v0.12.2 broke this
functionality. The folder 'exploded-aar' used to be in the
top-level 'build' directory and now it is in the module's
'build' directory, where it was excluded from the project.

Fixes issue
https://code.google.com/p/android/issues/detail?id=74341

UI test in
https://android-review.googlesource.com/103192

Change-Id: I17437180396406215f9dcb17430e8ee3ca095ce6
(cherry picked from commit 2e4028deab6d5e061fb364c2fad066add43dccfb)
Merge "Fixed issue where resources in AAR dependencies were not found." into idea133-milestone
Improve debugger's "View Bitmap" action.

A previous CL added the ability to view bitmap objects on the
device while debugging. This CL improves that feature in two ways:
 - Errors are now properly reported back to the user
 - When the buffer containing pixel data is not present, then we
   fall back to manually creating a buffer and invoking the
   copyPixelsToBuffer method to get the pixel data.

Change-Id: I1b8d90cd9b49b416224325203b02cf0d8ac4bb15
(cherry picked from commit 9794c12312626e33541d40b1c8306ec30f17284d)
Merge "Improve debugger's "View Bitmap" action." into idea133-milestone
Show licence agreement if missing SDK in new project wizard.

Bug: http://b.android.com/73242

Change-Id: I6f055f12878f7914a1e89987b8e08c78e5e13c20
(cherry picked from commit a86b2ecc81f0e7e9023216ef7b43a918b656715e)
Merge "Show licence agreement if missing SDK in new project wizard." into idea133-milestone
Updates module creation to check for new APIs

This change updates the module creation paths to update their target/build
API levels if a new platform with a higher API level has been installed
during the wizard.

Change-Id: I28c8c931ffdc7b938ca780e649094f975d893542
(cherry picked from commit 67c019f33af4df03f2815bfc2ab00efb410a87c7)
Merge "Updates module creation to check for new APIs" into idea133-milestone
navigator: Rework how the source provider is obtained for a resource

Res files are annotated with the source provider's name in the Android
project view. The provider corresponding to a res file was obtained
by looking at user data stored in the res file's containing res folder.

However, this mechanism of relying on user data on PsiElements may not
be a good approach since PsiElements may end up being recreated.

So rather than relying on this user data, we simply query the list of
source providers to identify which source provider contributed the
given res folder.

Change-Id: I83fba8affb8b1b45d590c0dc1aa5346a3aea2832
(cherry picked from commit 717aaa72d03b1f6d7d75aa1371b7f28d1de6a5ca)
Merge "navigator: Rework how the source provider is obtained for a resource" into idea133-milestone