Merge change 23515 into eclair

* changes:
  Update apkbuilder to support new property names
diff --git a/samples/Home/_index.html b/samples/Home/_index.html
index 2a62812..7581eed 100644
--- a/samples/Home/_index.html
+++ b/samples/Home/_index.html
@@ -6,4 +6,4 @@
 <p>This is actually the source of an old incarnation of the default Home application,
 which may look familiar if you played with some of the older pre-1.0 SDKs.</p>
 
-<img alt="" src="/guide/samples/images/HomeSample.png" />
\ No newline at end of file
+<img alt="" src="../images/HomeSample.png" />
\ No newline at end of file
diff --git a/samples/JetBoy/_index.html b/samples/JetBoy/_index.html
index 6665164..f7ce9ef 100644
--- a/samples/JetBoy/_index.html
+++ b/samples/JetBoy/_index.html
@@ -1,7 +1,7 @@
 <p>JetBoy is a sample game that demonstrates the use of the 
-<a href="/reference/android/media/JetPlayer.html">android.media.JetPlayer</a> 
+<a href="../../../reference/android/media/JetPlayer.html">android.media.JetPlayer</a> 
 class to implement an interactive music soundtrack in an application. JetBoy uses 
-<a href="/guide/topics/media/index.html#jet">JET content created with
+<a href="../../../guide/topics/media/index.html#jet">JET content created with
 JetCreator</a> and game-generated events fed to JetPlayer 
 to adapt the soundtrack to the user actions. Listen to how the melody picks 
 up when you start shooting asteroids, how you are congratulated when you 
@@ -18,7 +18,7 @@
 </p>
 
 <p><strong>See also:</strong><br/>
-<a href="/guide/topics/media/jet/jetcreator_manual.html">SONiVOX JETCreator User Manual</a><br/>
-<a href="/reference/android/media/JetPlayer.html">JetPlayer class</a></p>
+<a href="../../../guide/topics/media/jet/jetcreator_manual.html">SONiVOX JETCreator User Manual</a><br/>
+<a href="../../../reference/android/media/JetPlayer.html">JetPlayer class</a></p>
 
-<img alt="" src="/guide/samples/images/JetBoy.png"  />
+<img alt="" src="../images/JetBoy.png"  />
diff --git a/samples/LunarLander/_index.html b/samples/LunarLander/_index.html
index 6287b87..c2800eb 100644
--- a/samples/LunarLander/_index.html
+++ b/samples/LunarLander/_index.html
@@ -9,4 +9,4 @@
 </ul>
 </p>
 
-<img alt=""  src="/guide/samples/images/sample_lunarlander.png" >
\ No newline at end of file
+<img alt=""  src="../images/sample_lunarlander.png" >
\ No newline at end of file
diff --git a/samples/NotePad/_index.html b/samples/NotePad/_index.html
index 92486e5..093022b 100644
--- a/samples/NotePad/_index.html
+++ b/samples/NotePad/_index.html
@@ -9,11 +9,11 @@
 </ul>
 
 <p class="note">Please notice that this is not the same
-notepad code that's used for the <a href="/guide/tutorials/notepad/index.html">Notepad Tutorial</a>. 
+notepad code that's used for the <a href="../../../guide/tutorials/notepad/index.html">Notepad Tutorial</a>. 
 They are similar in nature, but there are several differences in implementation &mdash; the tutorial
 is slightly more simple. If you're new to 
 Android development, we suggest you start with the tutorial, then visit this
 code later to see more sample code.</p>
 
-<img alt="" src="/guide/samples/images/sample_notepad.png" />
-<img alt="" src="/guide/samples/images/sample_note.png" />
+<img alt="" src="../images/sample_notepad.png" />
+<img alt="" src="../images/sample_note.png" />
diff --git a/samples/SearchableDictionary/_index.html b/samples/SearchableDictionary/_index.html
new file mode 100644
index 0000000..de3345e
--- /dev/null
+++ b/samples/SearchableDictionary/_index.html
@@ -0,0 +1,21 @@
+<p>A sample application that demonstrates Android's search framework.</p>
+
+<p>This application includes a dictionary of words. By invoking a search inside the app
+(via the device search button or Menu > Search), a local search will be performed
+across the dictionary. As you type, suggestions will appear, which you can select
+to view the full definition. You can also execute the search to view all word definitions
+that match the entered text.</p>
+
+<p>The application also grants content provider privileges to 
+Quick Search Box, Android's system-wide search tool. This means that the
+dictionary definitions can be offered as search suggestions outside of the application,
+when text is entered into Quick Search Box.</p>
+	
+<p>See also:</p>
+<ul>
+  <li><a href="../../../reference/android/app/SearchManager.html">SearchManager</a></li>
+  <li><a href="../../../reference/android/content/ContentProvider.html">ContentProvider</a></li>
+</ul>
+
+<img src="../images/SearchableDictionary1.png" />
+<img src="../images/SearchableDictionary2.png" />
\ No newline at end of file
diff --git a/samples/Snake/_index.html b/samples/Snake/_index.html
index 56391b9..991bc5d 100644
--- a/samples/Snake/_index.html
+++ b/samples/Snake/_index.html
@@ -7,4 +7,4 @@
 request draws to the screen. A great example of a basic game that does not
 require a fast framerate.</p>
 
-<img alt="" src="/guide/samples/images/Snake.png" />
+<img alt="" src="../images/Snake.png" />
diff --git a/samples/SoftKeyboard/_index.html b/samples/SoftKeyboard/_index.html
index 7fc7af5..49f197d 100644
--- a/samples/SoftKeyboard/_index.html
+++ b/samples/SoftKeyboard/_index.html
@@ -4,4 +4,4 @@
 a basic example for how you would get started writing an input method, to
 be fleshed out as appropriate.</p>
 
-<img alt="" src="/guide/samples/images/SoftKeyboard.png" />
\ No newline at end of file
+<img alt="" src="../images/SoftKeyboard.png" />
\ No newline at end of file
diff --git a/tools/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java b/tools/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java
index 64fbef6..c8e5498 100644
--- a/tools/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java
+++ b/tools/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java
@@ -604,7 +604,7 @@
                         "Good handshake from client, sending HELO to " + mClientData.getPid());
                     JdwpPacket.consumeHandshake(mReadBuffer);
                     mConnState = ST_NEED_DDM_PKT;
-                    HandleHello.sendHELO(this, SERVER_PROTOCOL_VERSION);
+                    HandleHello.sendHelloCommands(this, SERVER_PROTOCOL_VERSION);
                     // see if we have another packet in the buffer
                     return getJdwpPacket();
                 case JdwpPacket.HANDSHAKE_BAD:
diff --git a/tools/ddms/libs/ddmlib/src/com/android/ddmlib/ClientData.java b/tools/ddms/libs/ddmlib/src/com/android/ddmlib/ClientData.java
index 2b46b6f..d396d15 100644
--- a/tools/ddms/libs/ddmlib/src/com/android/ddmlib/ClientData.java
+++ b/tools/ddms/libs/ddmlib/src/com/android/ddmlib/ClientData.java
@@ -24,6 +24,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -46,7 +47,7 @@
     * access should be synchronized against the ClientData object.
     */
 
-    
+
     /** Temporary name of VM to be ignored. */
     private final static String PRE_INITIALIZED = "<pre-initialized>"; //$NON-NLS-1$
 
@@ -62,7 +63,7 @@
     /** Debugger connection status: The listening port for debugger connection failed to listen.
      * No debugger will be able to connect. */
     public static final int DEBUGGER_ERROR = 4;
-    
+
     /**
      * Allocation tracking status: unknown.
      * <p/>This happens right after a {@link Client} is discovered
@@ -99,6 +100,18 @@
      */
     public final static String HEAP_OBJECTS_ALLOCATED = "objectsAllocated"; // $NON-NLS-1$
 
+    /**
+     * String for feature enabling starting/stopping method profiling
+     * @see #hasFeature(String)
+     */
+    public final static String FEATURE_PROFILING = "method-trace-profiling"; // $NON-NLS-1$
+
+    /**
+     * String for feature allowing to dump hprof files
+     * @see #hasFeature(String)
+     */
+    public final static String FEATURE_HPROF = "hprof-heap-dump"; // $NON-NLS-1$
+
     // is this a DDM-aware client?
     private boolean mIsDdmAware;
 
@@ -114,6 +127,9 @@
     // how interested are we in a debugger?
     private int mDebuggerInterest;
 
+    // List of supported feature by the client.
+    private final HashSet<String> mFeatures = new HashSet<String>();
+
     // Thread tracking (THCR, THDE).
     private TreeMap<Integer,ThreadInfo> mThreadMap;
 
@@ -232,11 +248,11 @@
         public void setProcessedHeapMap(Map<Integer, ArrayList<HeapSegmentElement>> heapMap) {
             mProcessedHeapMap = heapMap;
         }
-        
+
         public Map<Integer, ArrayList<HeapSegmentElement>> getProcessedHeapMap() {
             return mProcessedHeapMap;
         }
-        
+
 
     }
 
@@ -250,7 +266,7 @@
         mDebuggerInterest = DEBUGGER_DEFAULT;
         mThreadMap = new TreeMap<Integer,ThreadInfo>();
     }
-    
+
     /**
      * Returns whether the process is DDM-aware.
      */
@@ -290,7 +306,7 @@
      * Returns the client description.
      * <p/>This is generally the name of the package defined in the
      * <code>AndroidManifest.xml</code>.
-     * 
+     *
      * @return the client description or <code>null</code> if not the description was not yet
      * sent by the client.
      */
@@ -319,7 +335,7 @@
             }
         }
     }
-    
+
     /**
      * Returns the debugger connection status. Possible values are {@link #DEBUGGER_DEFAULT},
      * {@link #DEBUGGER_WAITING}, {@link #DEBUGGER_ATTACHED}, and {@link #DEBUGGER_ERROR}.
@@ -422,7 +438,7 @@
     synchronized ThreadInfo getThread(int threadId) {
         return mThreadMap.get(threadId);
     }
-    
+
     synchronized void clearThreads() {
         mThreadMap.clear();
     }
@@ -474,7 +490,7 @@
     public synchronized Iterator<NativeLibraryMapInfo> getNativeLibraryMapInfo() {
         return mNativeLibMapInfo.iterator();
     }
-    
+
     synchronized void setAllocationStatus(boolean enabled) {
         mAllocationStatus = enabled ? ALLOCATION_TRACKING_ON : ALLOCATION_TRACKING_OFF;
     }
@@ -486,11 +502,11 @@
     public synchronized int getAllocationStatus() {
         return mAllocationStatus;
     }
-    
+
     synchronized void setAllocations(AllocationInfo[] allocs) {
         mAllocations = allocs;
     }
-    
+
     /**
      * Returns the list of tracked allocations.
      * @see Client#requestAllocationDetails()
@@ -498,5 +514,21 @@
     public synchronized AllocationInfo[] getAllocations() {
         return mAllocations;
     }
+
+    void addFeature(String feature) {
+        mFeatures.add(feature);
+    }
+
+    /**
+     * Returns true if the {@link Client} supports the given <var>feature</var>
+     * @param feature The feature to test.
+     * @return true if the feature is supported
+     *
+     * @see ClientData#FEATURE_PROFILING
+     * @see ClientData#FEATURE_HPROF
+     */
+    public boolean hasFeature(String feature) {
+        return mFeatures.contains(feature);
+    }
 }
 
diff --git a/tools/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHello.java b/tools/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHello.java
index fb9697c..4818bd0 100644
--- a/tools/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHello.java
+++ b/tools/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHello.java
@@ -29,7 +29,6 @@
 
     private static final HandleHello mInst = new HandleHello();
 
-
     private HandleHello() {}
 
     /**
@@ -56,6 +55,18 @@
     }
 
     /**
+     * Sends HELLO-type commands to the VM after a good handshake.
+     * @param client
+     * @param serverProtocolVersion
+     * @throws IOException
+     */
+    public static void sendHelloCommands(Client client, int serverProtocolVersion)
+            throws IOException {
+        sendHELO(client, serverProtocolVersion);
+        sendFEAT(client);
+    }
+
+    /**
      * Chunk handler entry point.
      */
     @Override
@@ -87,12 +98,12 @@
 
         vmIdent = getString(data, vmIdentLen);
         appName = getString(data, appNameLen);
-        
+
         Log.d("ddm-hello", "HELO: v=" + version + ", pid=" + pid
             + ", vm='" + vmIdent + "', app='" + appName + "'");
 
         ClientData cd = client.getClientData();
-        
+
         synchronized (cd) {
             if (cd.getPid() == pid) {
                 cd.setVmIdentifier(vmIdent);
@@ -141,6 +152,7 @@
         for (i = 0; i < featureCount; i++) {
             int len = data.getInt();
             String feature = getString(data, len);
+            client.getClientData().addFeature(feature);
 
             Log.d("ddm-hello", "Feature: " + feature);
         }
@@ -160,6 +172,5 @@
         Log.d("ddm-heap", "Sending " + name(CHUNK_FEAT));
         client.sendAndConsume(packet, mInst);
     }
-
 }
 
diff --git a/tools/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java b/tools/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java
index 72cbb4a..35e071d 100644
--- a/tools/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java
+++ b/tools/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java
@@ -39,11 +39,15 @@
         "App description:",
         "VM version:",
         "Process ID:",
+        "Supports Profiling Control:",
+        "Supports HPROF Control:",
     };
-    private static final int ENT_DDM_AWARE = 0;
-    private static final int ENT_APP_DESCR = 1;
-    private static final int ENT_VM_VERSION = 2;
-    private static final int ENT_PROCESS_ID = 3;
+    private static final int ENT_DDM_AWARE          = 0;
+    private static final int ENT_APP_DESCR          = 1;
+    private static final int ENT_VM_VERSION         = 2;
+    private static final int ENT_PROCESS_ID         = 3;
+    private static final int ENT_SUPPORTS_PROFILING = 4;
+    private static final int ENT_SUPPORTS_HPROF     = 5;
 
     /**
      * Create our control(s).
@@ -71,7 +75,7 @@
 
         return mTable;
     }
-    
+
     /**
      * Sets the focus to the proper control inside the panel.
      */
@@ -160,6 +164,10 @@
             item.setText(1, isDdmAware);
             item = mTable.getItem(ENT_PROCESS_ID);
             item.setText(1, pid);
+            item = mTable.getItem(ENT_SUPPORTS_PROFILING);
+            item.setText(1, Boolean.toString(cd.hasFeature(ClientData.FEATURE_PROFILING)));
+            item = mTable.getItem(ENT_SUPPORTS_HPROF);
+            item.setText(1, Boolean.toString(cd.hasFeature(ClientData.FEATURE_HPROF)));
         }
 
         mCol2.pack();
diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/test.xml b/tools/eclipse/plugins/com.android.ide.eclipse.tests/test.xml
index 792ebc2..7fd3b0d 100644
--- a/tools/eclipse/plugins/com.android.ide.eclipse.tests/test.xml
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.tests/test.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- test launcher file for Android Eclipse functional tests -->
+<!-- test launcher file for Android Eclipse tests -->
 <project name="testsuite" default="run" basedir="."> 
     <!--The following properties should be passed into this script, set to some default value for now -->
     <property name="eclipse.home" value="/opt/eclipse" />
@@ -52,9 +52,9 @@
         <ant target="ui-test" antfile="${library-file}" dir="${eclipse.home}">
             <property name="data-dir" value="${test-folder}" />
             <property name="plugin-name" value="${plugin-name}" />
-            <property name="classname" value="com.android.ide.eclipse.tests.FuncTests" />
-            <!-- pass extra vm arg to set sdk_home env variable -->
-            <property name="extraVMargs" value="-Dsdk_home=${sdk_home}" />
+            <property name="classname" value="com.android.ide.eclipse.tests.AllTests" />
+            <!-- pass extra vm arg to set sdk_home env and test_data env variable -->
+            <property name="extraVMargs" value="-Dsdk_home=${sdk_home} -Dtest_data=${test_data}" />
         </ant>
     </target>