Prompt for package uninstall when signature differs

If a package with a different signature is already installed on the
launch device, the current behaviour is to simply abort the launch
process and print an error message to the console. The developer has
to use adb to actually do the uninstall.

This patch prompts the user if he wants to uninstall the current
package directly from within Eclipse.

Fixes #22480.

Change-Id: I8b32d19ebba511cace389696848ad9da411011bd
Update master version from 21.0.0 to 22.0.0

Change-Id: I3cff176281b4949f814023f0c7ecda897bc1354b
UI Automator Viewer improvements

* Non-root device needs to do dexopt into alternative dalvik
  cache when uiautomator is called for the very first time; This
  may incidentally lead to long response time from XML dump via
  UI Automator Viewer; The 40s timeout is long enough but it was
  actually not passed into IDevice#executeShellCommand()

* Dumped XML has "rotation" attribute on root node since API
  Level 17, we now make use of this to rotate captured screenshot
  image

* Fixed an Eclipse warning on unclosed InputStream

Bug: 7564716
Bug: 7564146
Change-Id: Ie46968aff323ed392990febfd89e18f2dbd099de
Move tools to revision 22.

Also makes them depend on platform-tools 16 officially.

Change-Id: Iaaeb4ea5d5e04baeef4cb088bce35df4ac42e212
Fix goto @+id, and order layout_width before width in completion

This changeset makes two XML editing releated tweaks:

* First, Go To Declaration now works on @+id/ attributes. Until now,
  it ignored these with a comment that we're already at the
  declaration. However, there are cases where these are also used as a
  forward reference, such as in layout parameters for a relative
  layout. Now Go To Declaration will allow you to jump from these
  layout parameters to the actual element defining the attribute.

* Second, if the user types "wi" in code completion, we offer both
  android:width and android:layout_width. However, the layout
  parameters were offered second, meaning users would sometimes select
  width instead of layout_width, the more likely choice. This
  changeset tweaks the order of the results in this scenario to offer
  the layout parameters first.

Finally, it also makes some tweaks the the unit test framework to for
example wait for all Android targets to be loaded (this wasn't always
the case which made the test sometimes fail when running, but not when
debugged.) It also updates the target SDK used for golden files to API
16 (from API 12) so some golden files are updated with changes in
available attributes and descriptions.

Change-Id: I84c92961f42fe63d39b6eeff9186d66183d67d6c
Add tools:targetApi to control local minSdk (like @TargetApi)

Also add XML editor quickfix to set the attribute on
an API violation.

Change-Id: Ife95d73659656e98a6fb1a322354f5fcfcef1888
API check: Only check calls and field accesses, not declarations

It appears Dalvik is very forgiving and doesn't try to preload classes
until actually needed, so there is no need to flag variable and field
declarations, and in fact, patterns used for supporting new and old
versions sometimes declares these methods and only conditionally end
up actually accessing methods and fields, so only check method and
field accesses.

Also fix lint such that it doesn't flag XML resource warnings for
tools URI namespace elements, such as ListView preview layout
selections.

Change-Id: I9018a64845b5b29744926e3d0be371801bbdd167
Add override detector

This lint detector finds method declarations which are likely
to clash and accidentally override framework classes defined
on newer platforms

Also, fix method position computation in class files.

Change-Id: If0d03feb55e44816f75938dae3164c53ed5b3183
Fix rename type, rename package and move type refactorings

This CL updates the various refactorings to properly handle layout
refactoring such that it not only updates custom views, but also
updates fragment references, tool:context references etc. It also
fixes missing manifest updates (such as replacing the
parentActivityName attributes).

Most importantly, it also fixes bugs where the wrong elements in the
manifest could get updated. There are a lot of diffs in this CL
because I basically replaced the old refactoring code (which had a lot
of custom text change and document manipulation code) with code based
on the new resource refactoring, where there is a single iteration of
the XML documents. This also improves the emitted refactoring elements
such that it only lists each file once.

Also updated the unit tests to check additional scenarios; adding a
second activity with the same prefix as the first is what revealed the
broken document handling in the old code.

Change-Id: I7c5959ca6b046ce3dab566663988cdd0389b0e5b
Close resource

Change-Id: I4683dc68a9f74ad8a2c709c8313c17ccbfbd64a1
Merge "Close resource"
Merge "Fix rename type, rename package and move type refactorings"
Merge "Add tools:targetApi to control local minSdk (like @TargetApi)"
Merge "API check: Only check calls and field accesses, not declarations"
Merge "Add override detector"
Merge "Fix goto @+id, and order layout_width before width in completion"
Add missing LOCAL_MODULE_TAGS to makefiles

Change-Id: Icbf4401f65e257c0bdcce3ccde6ef7cc6cb5d53b
Merge "Add missing LOCAL_MODULE_TAGS to makefiles"
40876: Lint should flag "extension" pattern specifiers in SimpleDateFormat

Change-Id: I427e498a314aeaeb2a302811bfde1dc719e435d5
Merge "40876: Lint should flag "extension" pattern specifiers in SimpleDateFormat"