aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 35049: @SuppressLint("NewApi") doesn't work on local variablesTor Norbye2012-07-236-2/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The @SuppressLint annotation can deliberately be placed on not only classes and methods but on parameters and local variables too. For AST-based (Java source-based) lint checks, this works fine. However, some lint checks, such as the API Check, is based on analyzing the bytecode. Annotations placed on local variables and parameters do not make it into the .class file, so these annotations do not work to suppress errors when placed on local variables (or parameters). The @TargetApi annotation applies only to the bytecode based API check, so its metadata only allows the annotation to be placed on methods and classes and constructors. However, the @SuppressLint annotation needs to continue to be available for the AST-based checks. This CL adds a new lint check, a "meta" check, which actually looks for invalid @SuppressLint annotations, and warns about these. With the new lint-on-save behavior, this means you instantly get feedback if you attempt to suppress an annotation in the wrong place. (Note that the quickfix for adding annotations has always enforced this and placed annotations out at the method level, but as shown in issue 35049, developers place them there deliberately themselves.) This CL also fixes an unrelated problem (shown in issue 34198) that the add suppress annotation code could sometimes add multiple versions of the same id into the annotation. Change-Id: I5bc61c6315edfcfc20103d1e580e389dd8e6a09b
* Merge "Add basic flow analysis support to lint"Tor Norbye2012-07-2323-10/+811
|\
| * Add basic flow analysis support to lintTor Norbye2012-07-2323-10/+811
| | | | | | | | | | | | | | | | | | | | | | This changeset adds in the ASM analysis library (an optional part of the ASM package lint is already using to process bytecode). It also adds some basic flow analysis to the SecureRandom detector to detect whether a given dispatch to a field of type java.util.Random is actually pointing to a java.security.SecureRandom, in which case it flags calls on it to setSeed() where the argument is a fixed integer. Change-Id: If85ab9f8db0e801a01f1a3ea845865b4f98e259c
* | Merge "Add lint checks for wakelock and secure random problems"Tor Norbye2012-07-2312-1/+445
|\ \ | |/
| * Add lint checks for wakelock and secure random problemsTor Norbye2012-07-2312-1/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset adds new two lint bytecode-based detectors. The WakelockDetector looks for problems with wakelocks: - Calling release() in onDestroy() rather than in onPause() - Calling acquire() but never calling release() anywhere in the app. The SecureRandomDetector looks for problems with the SecureRandom random number generator: - Calling setSeed() with a fixed number, such as a string literal, or something equivalent (such as a static field reference of this or some other class) - Calling setSeed() and passing in System.nanoTime or currentTimeMillis since these are considered predictable seeds. These are both using the new fast-dispatch mechanism for bytecode detectors in lint. In both cases, there are more complex control flow we should be checking using flow analysis; that's for an upcoming CL where we add ASM's analysis library. Change-Id: Iec2a95b042b8a3e4e976923cc62e9dccf2dfeca5
* | Merge "Add bytecode method call dispatch for lint rules"Tor Norbye2012-07-2315-226/+552
|\ \ | |/
| * Add bytecode method call dispatch for lint rulesTor Norbye2012-07-2315-226/+552
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset adds shared dispatch for bytecode based rules. We already have this for XML and Java source trees: detectors can register interest in a particular element or attribute name, or a particular method call name, and then the source is processed in a single pass, and a quick map lookup dispatches to any detectors interested in that particular item. This has the important property that adding new detectors does not linearly slow down lint: it does not process each XML document an extra time for each newly added rule: the new rule just adds one more entry into a dispatch table, and only for the specifically interesting tag name (for example) is there an extra dispatch to the new detector. This changeset adds a similar mechanism for the ASM based bytecode detectors. Until now, each detector would be handed the class node of the outer class. This changeset adds a couple of new dispatch methods: First, a way to register interests in method calls of a particular type, and second, a way to registere interest in types of ASM nodes. In addition to the new visitor, this changeset rewrites a couple of detectors to use the new dispatch approach (there are new detectors in the pipeline which will also take advantage of this), and cleans up handling of positions a bit. Change-Id: Ib115bd3418b6c63bdcd49fec046e91a73daf38a9
* Merge "Send full-size framebuffer to OnPost callback"Jesse Hall2012-07-233-10/+23
|\
| * Send full-size framebuffer to OnPost callbackJesse Hall2012-07-203-10/+23
| | | | | | | | | | | | | | | | | | | | | | When the emulator window has non-1.0 scaling, the scale is applied when blitting the Android framebuffer to the host window. For the OnPost callback, we were not only reading the image back from the window (so post-scaling), we were also storing it in a 1.0-scaled buffer. Now we read back from the Android framebuffer image, which is always 1.0-scaled. Change-Id: Ia9c974711a9a4b0b19f4b997f65ecc64481b4c6a
* | Merge "35228: Strip whitespace from default project name"Tor Norbye2012-07-202-14/+26
|\ \
| * | 35228: Strip whitespace from default project nameTor Norbye2012-07-202-14/+26
| | | | | | | | | | | | Change-Id: I14041db3996be2afa3bfec82aa1f0a2191eb4872
* | | Merge "junit: Launch tests on multiple devices concurrently."Siva Velusamy2012-07-202-63/+181
|\ \ \ | |/ / |/| |
| * | junit: Launch tests on multiple devices concurrently.Siva Velusamy2012-07-202-63/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than launch tests sequentially on each device, launch them concurrently on all devices. An Eclipse Job is created per device from which the test tree information is collected and then tests are run. Change-Id: I564f04616e2f1dc26571ad7eec77df1d77c0afa9
* | | Merge "Fixed test cases for exported services that previously used wrong ↵Tor Norbye2012-07-201-2/+2
|\ \ \ | | | | | | | | | | | | test input files."
| * | | Fixed test cases for exported services that previously used wrong test input ↵Sebastian Porst2012-06-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | files. Change-Id: I8e0f8986da5be6a640a8aadb44f9f7c364c84bce
* | | | Merge "Added a lint check that makes sure no private keys are packaged in an ↵Tor Norbye2012-07-204-1/+184
|\ \ \ \ | | | | | | | | | | | | | | | app."
| * | | | Added a lint check that makes sure no private keys are packaged in an app.Sebastian Porst2012-07-194-1/+184
| | | | | | | | | | | | | | | | | | | | Change-Id: I65d7064efb36002713a3083378af9200331ce793
* | | | | Merge "Handle window events across multiple workbench events"Tor Norbye2012-07-206-49/+105
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | Handle window events across multiple workbench eventsTor Norbye2012-07-206-49/+105
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ADT uses a "window coordinator" which listens for various window related events (such as part activation, editors getting maximized etc) to implement its various layout editor handling (to dock property sheets within the layout editor unless it's shown in the surrounding frame), to activate/deactivate editors for keybinding handling, etc. This did not take into account the possibility of multiple workbench windows getting opened. This CL adds proper support for this. The window coordinator is no longer a singleton; there is one instance per workbench window, and AdtStartup listens for workbench events and creates or disposes these on demand. Change-Id: I298d9d82c7aefd684bcb1ace3bee0267e1f94a60
* | | | Merge "Prevent NPE when activating layouts that have been deleted"Tor Norbye2012-07-191-2/+6
|\ \ \ \
| * | | | Prevent NPE when activating layouts that have been deletedTor Norbye2012-07-191-2/+6
| | | | | | | | | | | | | | | | | | | | Change-Id: I78af9a552757f3e28369d5f2de112541b1a8ea98
* | | | | Merge "35184: Initialize new projects to use JDK 6"Tor Norbye2012-07-194-4/+63
|\ \ \ \ \ | |/ / / /
| * | | | 35184: Initialize new projects to use JDK 6Tor Norbye2012-07-194-4/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the templates require JDK 6 (because they specify @Override on methods implementing an interface). Rather than attempting to figure out what the default is and conditionally adding these annotations, always tie the project to JDK 6 instead, since it's a better language. This fixes issue 35184: Using the wizard for a JellyBean only multi-fragment project creates uncompilable code Change-Id: I434d7b7335ac51110c6044f4ac4765a5a8813c3d
* | | | | Merge "35225: Tweak toolbar tooltips"Tor Norbye2012-07-191-13/+8
|\ \ \ \ \
| * | | | | 35225: Tweak toolbar tooltipsTor Norbye2012-07-191-13/+8
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix 35225: Change the ADT tooltips for toolbar buttons to be noun-phrases or verb-phrases (not descriptions) Change-Id: Idb1b5d30f96d8fd66344562f1087dabe254ee25d
* | | | | Merge "Prevent NPE at shutdown if targets haven't finished loading"Tor Norbye2012-07-191-1/+8
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Prevent NPE at shutdown if targets haven't finished loadingTor Norbye2012-07-191-1/+8
| |/ / / | | | | | | | | | | | | Change-Id: I54c3adee5ff85a91d13740796ef6809707f00333
* | | | Merge "Fix classpath for ddmuilib-tests"Siva Velusamy2012-07-191-1/+2
|\ \ \ \
| * | | | Fix classpath for ddmuilib-testsSiva Velusamy2012-07-191-1/+2
| | |_|/ | |/| | | | | | | | | | Change-Id: Ie085ec76f9033d50acf086b89748e764b33f5f0c
* | | | Merge "35190: Lint doesn't detect illegal API usage in constructor"Tor Norbye2012-07-196-7/+58
|\ \ \ \
| * | | | 35190: Lint doesn't detect illegal API usage in constructorTor Norbye2012-07-196-7/+58
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constructors are not like methods: they are not inherited into subclasses. The Lint API check needed some special handling of constructors to avoid this, since it was looking up inherited constructors and treating them as accessible. In particular that meant it wouldn't flag new IOException(Throwable) as requiring API 9, since its superclass had a constructor which also took a Throwable (with API 1). Change-Id: I268752be506f12399ce4855d2cf7bec76012e4c2
* | | | Merge "Fixed bug in creating already existing layout configs."Xavier Ducrohet2012-07-191-4/+2
|\ \ \ \ | |_|/ / |/| | |
| * | | Fixed bug in creating already existing layout configs.Michael Wright2012-07-191-4/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the issue where if you try to create a resource qualified layout via the layout editor where one already exists, ADT will overwrite the the contents of the existing layout. Even worse, if the layout you try to create is the one you're currently editing, it will replace it with an empty file. Change-Id: If3017c1c77d21cf99a4d77e62b46fb079997596e
* | | Merge "Allow junit tests to be run on multiple devices."Siva Velusamy2012-07-1817-142/+302
|\ \ \ | |/ / |/| |
| * | Allow junit tests to be run on multiple devices.Siva Velusamy2012-07-1817-142/+302
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we allow launching an activity on multiple devices from a single launch configuration. This CL adds support for running Junit tests on all connected devices/emulators from a single launch config. At the UI level, all test results now show up as children of per device test suites. The changes are primarily in 3 different areas: - In ddmlib, the main change is to save the device name on which a particular test was run. This information is saved in the TestIdentifier that is created per test case. - In ADT, the general launch action (IAndroidLaunchAction) is modified to support launching on multiple devices. This simply loops over the existing launch action for each device for Activity Launch or Empty Launch. The Junit Launch Action is modified to launch a single Junit UI and collects the results from all devices and passes it on to the Junit UI. - ADT's ITestRunListener's are modified to look at the device on which a test was run and add results in the appropriate per device test suite. Change-Id: I936c2db2398fcad16544794441dedc714de9bea8
* | Merge "Fix keybindings in various XML editors for Eclipse 4.x."Tor Norbye2012-07-185-45/+53
|\ \
| * | Fix keybindings in various XML editors for Eclipse 4.x.Tor Norbye2012-07-185-45/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset attempts to fix the issue with cut/copy/paste (and other keybindings) not working properly in the non-layout XML files. The symptom is that the action appears not to work, but is actually applied to a different editor. I haven't figured out why this happens in e4; after you switch focus the editor action map should switch, but the fix here is to listen for part changes, and manually reset the action bindings whenever this happens. This fixes issue 34630 (as well as several duplicates filed recently). Change-Id: Ia1134c16ac3323a8a03f2c61182d810b7f7d2589
* | | Merge "Update URL to the support library"Tor Norbye2012-07-181-1/+1
|\ \ \ | |/ / |/| |
| * | Update URL to the support libraryTor Norbye2012-07-181-1/+1
|/ / | | | | | | Change-Id: Ieddcad27b077914730dce2456e23b499451391ef
* | Merge "35098: ADT resource editor doesn't understand plurals"Tor Norbye2012-07-171-0/+39
|\ \
| * | 35098: ADT resource editor doesn't understand pluralsTor Norbye2012-07-171-0/+39
| | | | | | | | | | | | | | | | | | | | | This CL adds code completion support for <plurals> elements in resource files. Change-Id: I96c4bdb4fc677437a7426d394f57e8429c322219
* | | Merge "35054: lint reports resources as unused when used in plurals"Tor Norbye2012-07-175-1/+29
|\ \ \ | |/ /
| * | 35054: lint reports resources as unused when used in pluralsTor Norbye2012-07-175-1/+29
| | | | | | | | | | | | Change-Id: Id437ef30e1488c96a46ccea45459694fd23db582
* | | Merge "Detect incorrect state lists"Tor Norbye2012-07-173-13/+101
|\ \ \
| * | | Detect incorrect state listsTor Norbye2012-07-173-13/+101
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lint already had a check for <selector> lists where it detects the case where you have an empty child not in the last position; this will match everything, and hide all subsequent states. This changeset generalizes this check: It makes sure that no state is fully matched by a previous state. Change-Id: I43b80beb531e68008d82f6c620739ca179d0f8f8
* | | Merge "Re-enable the template development wizard between releases"Tor Norbye2012-07-171-2/+1
|\ \ \
| * | | Re-enable the template development wizard between releasesTor Norbye2012-07-171-2/+1
| |/ / | | | | | | | | | Change-Id: Ia029a8aabdc2cbaff034b1d378ddf51f126d1b56
* | | Merge "Change field getter threshold from API 8 to API 9"Tor Norbye2012-07-161-5/+5
|\ \ \ | |/ / |/| |
| * | Change field getter threshold from API 8 to API 9Tor Norbye2012-07-161-5/+5
| | | | | | | | | | | | | | | | | | | | | The Dalvik optimization to automatically inline getters was introduced in Gingerbread, not Froyo. Change-Id: If14288aa398206d4eebfa57ccc7ddfabc6dde83d
* | | Merge "Compute completion documentation lazily, and add docs for ?-attrs"Tor Norbye2012-07-163-13/+174
|\ \ \ | |/ / |/| |