Merge change 20717 into donut

* changes:
  Release the camera in surfaceDestroyed().
diff --git a/build/sdk.atree b/build/sdk.atree
index 4b7b4a9..9136e5e 100644
--- a/build/sdk.atree
+++ b/build/sdk.atree
@@ -78,6 +78,7 @@
 development/samples/Snake platforms/${PLATFORM_NAME}/samples/Snake
 development/samples/SoftKeyboard platforms/${PLATFORM_NAME}/samples/SoftKeyboard
 development/samples/JetBoy platforms/${PLATFORM_NAME}/samples/JetBoy
+development/samples/SearchableDictionary platforms/${PLATFORM_NAME}/samples/SearchableDictionary
 
 # dx
 bin/dx platforms/${PLATFORM_NAME}/tools/dx
diff --git a/cmds/monkey/README.NETWORK.txt b/cmds/monkey/README.NETWORK.txt
index ccf741b..3ec6298 100644
--- a/cmds/monkey/README.NETWORK.txt
+++ b/cmds/monkey/README.NETWORK.txt
@@ -1,13 +1,13 @@
-MONKEY NETWORK SCRIPT
+SIMPLE PROTOCOL FOR AUTOMATED NETWORK CONTROL
 
-The Monkey Network Script was designed to be a low-level way to
-programmability inject KeyEvents and MotionEvents into the input
-system.  The idea is that a process will run on a host computer that
-will support higher-level operations (like conditionals, etc.) and
-will talk (via TCP over ADB) to the device in Monkey Network Script.
-For security reasons, the Monkey only binds to localhost, so you will
-need to use adb to setup port forwarding to actually talk to the
-device.
+The Simple Protocol for Automated Network Control was designed to be a
+low-level way to programmability inject KeyEvents and MotionEvents
+into the input system.  The idea is that a process will run on a host
+computer that will support higher-level operations (like conditionals,
+etc.) and will talk (via TCP over ADB) to the device in Simple
+Protocol for Automated Network Control.  For security reasons, the
+Monkey only binds to localhost, so you will need to use adb to setup
+port forwarding to actually talk to the device.
 
 INITIAL SETUP
 
@@ -73,6 +73,10 @@
 
 This simulates the opening or closing the keyboard (like on dream).
 
+wake
+
+This command will wake the device up from sleep and allow user input.
+
 OTHER NOTES
 
 There are some convenience features added to allow running without
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeyEvent.java b/cmds/monkey/src/com/android/commands/monkey/MonkeyEvent.java
index d926be8..2783dde 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeyEvent.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeyEvent.java
@@ -22,7 +22,7 @@
 /**
  * abstract class for monkey event
  */
-public abstract class MonkeyEvent {    
+public abstract class MonkeyEvent {
     protected int eventType;
     public static final int EVENT_TYPE_KEY = 0;
     public static final int EVENT_TYPE_POINTER = 1;
@@ -30,41 +30,42 @@
     public static final int EVENT_TYPE_ACTIVITY = 3;
     public static final int EVENT_TYPE_FLIP = 4; // Keyboard flip
     public static final int EVENT_TYPE_THROTTLE = 5;
-        
+    public static final int EVENT_TYPE_NOOP = 6;
+
     public static final int INJECT_SUCCESS = 1;
     public static final int INJECT_FAIL = 0;
 
     // error code for remote exception during injection
-    public static final int INJECT_ERROR_REMOTE_EXCEPTION = -1;    
+    public static final int INJECT_ERROR_REMOTE_EXCEPTION = -1;
     // error code for security exception during injection
     public static final int INJECT_ERROR_SECURITY_EXCEPTION = -2;
-        
+
     public MonkeyEvent(int type) {
         eventType = type;
     }
-  
-    /** 
+
+    /**
      * @return event type
-     */    
+     */
     public int getEventType() {
         return eventType;
     }
-    
+
     /**
      * @return true if it is safe to throttle after this event, and false otherwise.
      */
     public boolean isThrottlable() {
         return true;
     }
-    
-    
+
+
     /**
      * a method for injecting event
      * @param iwm wires to current window manager
      * @param iam wires to current activity manager
-     * @param verbose a log switch 
+     * @param verbose a log switch
      * @return INJECT_SUCCESS if it goes through, and INJECT_FAIL if it fails
      *         in the case of exceptions, return its corresponding error code
      */
-    public abstract int injectEvent(IWindowManager iwm, IActivityManager iam, int verbose);    
+    public abstract int injectEvent(IWindowManager iwm, IActivityManager iam, int verbose);
 }
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeyNoopEvent.java b/cmds/monkey/src/com/android/commands/monkey/MonkeyNoopEvent.java
new file mode 100644
index 0000000..ea92735
--- /dev/null
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeyNoopEvent.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.commands.monkey;
+
+import java.util.List;
+
+import android.app.IActivityManager;
+import android.view.IWindowManager;
+
+
+/**
+ * monkey noop event (don't do anything).
+ */
+public class MonkeyNoopEvent extends MonkeyEvent {
+
+    public MonkeyNoopEvent() {
+        super(MonkeyEvent.EVENT_TYPE_NOOP);
+    }
+
+    @Override
+    public int injectEvent(IWindowManager iwm, IActivityManager iam, int verbose) {
+        // No real work to do
+        if (verbose > 1) {
+            System.out.println("NOOP");
+        }
+        return MonkeyEvent.INJECT_SUCCESS;
+    }
+}
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceNetwork.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceNetwork.java
index de784d0..b444dd3 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceNetwork.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceNetwork.java
@@ -15,6 +15,11 @@
  */
 package com.android.commands.monkey;
 
+import android.content.Context;
+import android.os.IPowerManager;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.SystemClock;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
@@ -203,6 +208,36 @@
         }
     }
 
+    /**
+     * Command to wake the device up
+     */
+    private static class WakeCommand implements MonkeyCommand {
+        // wake
+        public MonkeyEvent translateCommand(List<String> command) {
+            if (wake()) {
+                return null;
+            }
+            return new MonkeyNoopEvent();
+        }
+    }
+
+    /**
+     * Force the device to wake up.
+     *
+     * @return true if woken up OK.
+     */
+    private static final boolean wake() {
+        IPowerManager pm =
+                IPowerManager.Stub.asInterface(ServiceManager.getService(Context.POWER_SERVICE));
+        try {
+            pm.userActivityWithForce(SystemClock.uptimeMillis(), true, true);
+        } catch (RemoteException e) {
+            Log.e(TAG, "Got remote exception", e);
+            return false;
+        }
+        return true;
+    }
+
     // This maps from command names to command implementations.
     private static final Map<String, MonkeyCommand> COMMAND_MAP = new HashMap<String, MonkeyCommand>();
 
@@ -213,6 +248,7 @@
         COMMAND_MAP.put("trackball", new TrackballCommand());
         COMMAND_MAP.put("key", new KeyCommand());
         COMMAND_MAP.put("sleep", new SleepCommand());
+        COMMAND_MAP.put("wake", new WakeCommand());
     }
 
     // QUIT command
@@ -246,6 +282,10 @@
                                                0, // default backlog
                                                InetAddress.getLocalHost());
         Socket s = server.accept();
+        // At this point, we have a client connected.  Wake the device
+        // up in preparation for doing some commands.
+        wake();
+
         input = new BufferedReader(new InputStreamReader(s.getInputStream()));
         // auto-flush
         output = new PrintWriter(s.getOutputStream(), true);
diff --git a/host/windows/.gitignore b/host/windows/.gitignore
index dc7a154..434a0fa 100755
--- a/host/windows/.gitignore
+++ b/host/windows/.gitignore
@@ -1,9 +1,12 @@
 *.sln

 *.vcproj*

+*.aps

 usb/api.*

 usb/Debug

 usb/Release

 usb/api/obj*

 usb/api/*.log

 usb/adb_winapi_test/obj*

-usb/adb_winapi_test/*.log
\ No newline at end of file
+usb/adb_winapi_test/*.log

+usb/winusb/obj*

+usb/winusb/*.log
\ No newline at end of file
diff --git a/host/windows/prebuilt/usb/AdbWinApi.dll b/host/windows/prebuilt/usb/AdbWinApi.dll
index 1fcfaa9..b5586eb 100755
--- a/host/windows/prebuilt/usb/AdbWinApi.dll
+++ b/host/windows/prebuilt/usb/AdbWinApi.dll
Binary files differ
diff --git a/host/windows/prebuilt/usb/AdbWinUsbApi.dll b/host/windows/prebuilt/usb/AdbWinUsbApi.dll
new file mode 100755
index 0000000..0c9e00b
--- /dev/null
+++ b/host/windows/prebuilt/usb/AdbWinUsbApi.dll
Binary files differ
diff --git a/host/windows/usb/api/AdbWinApi.cpp b/host/windows/usb/api/AdbWinApi.cpp
index 4d18d37..507a2b5 100644
--- a/host/windows/usb/api/AdbWinApi.cpp
+++ b/host/windows/usb/api/AdbWinApi.cpp
@@ -17,6 +17,8 @@
 // AdbWinApi.cpp : Implementation of DLL Exports.

 

 #include "stdafx.h"

+#include "adb_api.h"

+#include "adb_winusb_api.h"

 

 extern "C" {

 int _forceCRTManifest;

@@ -24,8 +26,73 @@
 int _forceAtlDllManifest;

 };

 

+/// References InstantiateWinUsbInterface declared in adb_api.cpp

+extern PFN_INSTWINUSBINTERFACE InstantiateWinUsbInterface;

+

 class CAdbWinApiModule : public CAtlDllModuleT< CAdbWinApiModule > {

-public:

+ public:

+  CAdbWinApiModule()

+      : CAtlDllModuleT< CAdbWinApiModule >(),

+        adbwinusbapi_handle_(NULL),

+        is_initialized_(false) {

+  }

+

+  ~CAdbWinApiModule() {

+    // Unload AdbWinUsbApi.dll before we exit

+    if (NULL != adbwinusbapi_handle_) {

+      FreeLibrary(adbwinusbapi_handle_);

+    }

+  }

+

+  /** \brief Loads AdbWinUsbApi.dll and caches its InstantiateWinUsbInterface

+    export.

+

+    This method is called from DllMain on DLL_PROCESS_ATTACH event. In this

+    method we will check if WINUSB.DLL required by AdbWinUsbApi.dll is

+    installed, and if it is we will load AdbWinUsbApi.dll and cache address of

+    InstantiateWinUsbInterface routine exported from AdbWinUsbApi.dll

+  */

+  void AttachToAdbWinUsbApi() {

+    // We only need to run this only once.

+    if (is_initialized_) {

+      return;

+    }

+

+    // Just mark that we have ran initialization.

+    is_initialized_ = true;

+

+    // Before we can load AdbWinUsbApi.dll we must make sure that WINUSB.DLL

+    // has been installed. Build path to the file.

+    wchar_t path_to_winusb_dll[MAX_PATH+1];

+    if (!GetSystemDirectory(path_to_winusb_dll, MAX_PATH)) {

+      return;

+    }

+    wcscat(path_to_winusb_dll, L"\\WINUSB.DLL");

+

+    if (0xFFFFFFFF == GetFileAttributes(path_to_winusb_dll)) {

+      // WINUSB.DLL is not installed. We don't (in fact, can't) load

+      // AdbWinUsbApi.dll

+      return;

+    }

+

+    // WINUSB.DLL is installed. Lets load AdbWinUsbApi.dll and cache its

+    // InstantiateWinUsbInterface export.

+    // We require that AdbWinUsbApi.dll is located in the same folder

+    // where AdbWinApi.dll and adb.exe are located, so by Windows

+    // conventions we can pass just module name, and not the full path.

+    adbwinusbapi_handle_ = LoadLibrary(L"AdbWinUsbApi.dll");

+    if (NULL != adbwinusbapi_handle_) {

+      InstantiateWinUsbInterface = reinterpret_cast<PFN_INSTWINUSBINTERFACE>

+          (GetProcAddress(adbwinusbapi_handle_, "InstantiateWinUsbInterface"));

+    }

+  }

+

+ protected:

+  /// Handle to the loaded AdbWinUsbApi.dll

+  HINSTANCE adbwinusbapi_handle_;

+

+  /// Flags whether or not this module has been initialized.

+  bool      is_initialized_;

 };

 

 CAdbWinApiModule _AtlModule;

@@ -34,5 +101,12 @@
 extern "C" BOOL WINAPI DllMain(HINSTANCE instance,

                                DWORD reason,

                                LPVOID reserved) {

-    return _AtlModule.DllMain(reason, reserved); 

+  // Lets see if we need to initialize InstantiateWinUsbInterface

+  // variable. We do that only once, on condition that this DLL is

+  // being attached to the process and InstantiateWinUsbInterface

+  // address has not been calculated yet.

+  if (DLL_PROCESS_ATTACH == reason) {

+    _AtlModule.AttachToAdbWinUsbApi();

+  }

+  return _AtlModule.DllMain(reason, reserved);

 }

diff --git a/host/windows/usb/api/SOURCES b/host/windows/usb/api/SOURCES
index f6e6614..3569521 100755
--- a/host/windows/usb/api/SOURCES
+++ b/host/windows/usb/api/SOURCES
@@ -50,8 +50,7 @@
              $(SDK_LIB_PATH)\wbemuuid.lib \

              $(SDK_LIB_PATH)\uuid.lib     \

              $(SDK_LIB_PATH)\setupapi.lib \

-             $(SDK_LIB_PATH)\usbd.lib     \

-             $(SDK_LIB_PATH)\winusb.lib

+             $(SDK_LIB_PATH)\usbd.lib

            

 !IF "$(DDKBUILDENV)" == "fre"
 # Libraries for release (free) builds
@@ -87,15 +86,12 @@
 # Define source files for AdbWinApi.dll

 SOURCES = adb_api.cpp                     \

           adb_endpoint_object.cpp         \

-          adb_winusb_endpoint_object.cpp  \

           adb_legacy_endpoint_object.cpp  \

           adb_helper_routines.cpp         \

           adb_interface.cpp               \

-          adb_winusb_interface.cpp        \

           adb_legacy_interface.cpp        \

           adb_interface_enum.cpp          \

           adb_io_completion.cpp           \

-          adb_winusb_io_completion.cpp    \

           adb_legacy_io_completion.cpp    \

           adb_object_handle.cpp           \

           AdbWinApi.cpp                   \

diff --git a/host/windows/usb/api/adb_api.cpp b/host/windows/usb/api/adb_api.cpp
index f9bd94e..e58bcf1 100644
--- a/host/windows/usb/api/adb_api.cpp
+++ b/host/windows/usb/api/adb_api.cpp
@@ -24,11 +24,19 @@
 #include "adb_object_handle.h"

 #include "adb_interface_enum.h"

 #include "adb_interface.h"

-#include "adb_winusb_interface.h"

 #include "adb_legacy_interface.h"

 #include "adb_endpoint_object.h"

 #include "adb_io_completion.h"

 #include "adb_helper_routines.h"

+#include "adb_winusb_api.h"

+

+/** \brief Points to InstantiateWinUsbInterface exported from AdbWinUsbApi.dll.

+

+  This variable is initialized with the actual address in DllMain routine for

+  this DLL on DLL_PROCESS_ATTACH event.

+  @see PFN_INSTWINUSBINTERFACE for more information.

+*/

+PFN_INSTWINUSBINTERFACE InstantiateWinUsbInterface = NULL;

 

 ADBAPIHANDLE __cdecl AdbEnumInterfaces(GUID class_id,

                                bool exclude_not_present,

@@ -101,11 +109,22 @@
   ADBAPIHANDLE ret = NULL;

 

   try {

-    // Instantiate object

+    // Instantiate interface object, depending on the USB driver type.

     if (IsLegacyInterface(interface_name)) {

+      // We have legacy USB driver underneath us.

       obj = new AdbLegacyInterfaceObject(interface_name);

     } else {

-      obj = new AdbWinUsbInterfaceObject(interface_name);

+      // We have WinUsb driver underneath us. Make sure that AdbWinUsbApi.dll

+      // is loaded and its InstantiateWinUsbInterface routine address has

+      // been cached.

+      if (NULL != InstantiateWinUsbInterface) {

+        obj = InstantiateWinUsbInterface(interface_name);

+        if (NULL == obj) {

+          return NULL;

+        }

+      } else {

+        return NULL;

+      }

     }

 

     // Create handle for it

diff --git a/host/windows/usb/api/adb_api.h b/host/windows/usb/api/adb_api.h
index e2ad129..20f0cd6 100644
--- a/host/windows/usb/api/adb_api.h
+++ b/host/windows/usb/api/adb_api.h
@@ -119,8 +119,10 @@
 // as being exported.

 #ifdef ADBWIN_EXPORTS

 #define ADBWIN_API EXTERN_C __declspec(dllexport)

+#define ADBWIN_API_CLASS     __declspec(dllexport)

 #else

 #define ADBWIN_API EXTERN_C __declspec(dllimport)

+#define ADBWIN_API_CLASS     __declspec(dllimport)

 #endif

 

 /** \brief Handle to an API object.

diff --git a/host/windows/usb/api/adb_endpoint_object.h b/host/windows/usb/api/adb_endpoint_object.h
index 295eb46..d92aaad 100644
--- a/host/windows/usb/api/adb_endpoint_object.h
+++ b/host/windows/usb/api/adb_endpoint_object.h
@@ -29,7 +29,7 @@
   This class implement functionality that is common for both, WinUsb and

   legacy APIs.

 */

-class AdbEndpointObject : public AdbObjectHandle {

+class ADBWIN_API_CLASS AdbEndpointObject : public AdbObjectHandle {

  public:

   /** \brief Constructs the object

     

diff --git a/host/windows/usb/api/adb_interface.h b/host/windows/usb/api/adb_interface.h
index 4afb17d..0aa0d1d 100644
--- a/host/windows/usb/api/adb_interface.h
+++ b/host/windows/usb/api/adb_interface.h
@@ -23,12 +23,17 @@
 

 #include "adb_object_handle.h"

 

+// 'AdbInterfaceObject::interface_name_' : class 'std::basic_string<_E,_Tr,_A>'

+// needs to have dll-interface to be used by clients of class

+// 'AdbInterfaceObject' We're ok with that, since interface_name_ will not

+// be referenced by name from outside of this class.

+#pragma warning(disable: 4251)

 /** \brief Encapsulates an interface on our USB device.

 

   This is an abstract class that implements functionality common for both,

   legacy, and WinUsb based interfaces.

 */

-class AdbInterfaceObject : public AdbObjectHandle {

+class ADBWIN_API_CLASS AdbInterfaceObject : public AdbObjectHandle {

  public:

   /** \brief Constructs the object.

     

@@ -180,9 +185,6 @@
   }

 

  protected:

-  /// Name of the USB interface (device name) for this object

-  std::wstring                  interface_name_;

-

   /// Cached usb device descriptor

   USB_DEVICE_DESCRIPTOR         usb_device_descriptor_;

 

@@ -191,6 +193,11 @@
 

   /// Cached usb interface descriptor

   USB_INTERFACE_DESCRIPTOR      usb_interface_descriptor_;

+

+ private:

+  /// Name of the USB interface (device name) for this object

+  std::wstring                  interface_name_;

 };

+#pragma warning(default: 4251)

 

 #endif  // ANDROID_USB_API_ADB_INTERFACE_H__

diff --git a/host/windows/usb/api/adb_io_completion.h b/host/windows/usb/api/adb_io_completion.h
index 8a7c1d9..ea4b4fb 100644
--- a/host/windows/usb/api/adb_io_completion.h
+++ b/host/windows/usb/api/adb_io_completion.h
@@ -33,7 +33,7 @@
   like all other handles this handle must be closed after it's no longer

   needed.

 */

-class AdbIOCompletion : public AdbObjectHandle {

+class ADBWIN_API_CLASS AdbIOCompletion : public AdbObjectHandle {

  public:

   /** \brief Constructs the object

     

diff --git a/host/windows/usb/api/adb_object_handle.h b/host/windows/usb/api/adb_object_handle.h
index 29ac5e2..2fa4ad0 100644
--- a/host/windows/usb/api/adb_object_handle.h
+++ b/host/windows/usb/api/adb_object_handle.h
@@ -22,6 +22,7 @@
   of the API through a handle.

 */

 

+#include "adb_api.h"

 #include "adb_api_private_defines.h"

 

 /** \brief Defines types of internal API objects

@@ -71,7 +72,7 @@
   All API objects that have handles that are sent back to API client must be

   derived from this class.

 */

-class AdbObjectHandle {

+class ADBWIN_API_CLASS AdbObjectHandle {

  public:

   /** \brief Constructs the object

 

diff --git a/host/windows/usb/api/adb_winusb_api.h b/host/windows/usb/api/adb_winusb_api.h
new file mode 100755
index 0000000..268a998
--- /dev/null
+++ b/host/windows/usb/api/adb_winusb_api.h
@@ -0,0 +1,48 @@
+/*

+ * Copyright (C) 2006 The Android Open Source Project

+ *

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ *

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ */

+

+#ifndef ANDROID_USB_API_ADBWINUSBAPI_H__

+#define ANDROID_USB_API_ADBWINUSBAPI_H__

+

+/** \file

+  Contains declarations required to link AdbWinApi and AdbWinUsbApi DLLs.

+*/

+

+/** \brief Function prototype for InstantiateWinUsbInterface routine exported

+  from AdbWinUsbApi.dll

+

+  In order to provide backward compatibility with the systems that still run

+  legacy (custom) USB drivers, and have not installed WINUSB.DLL we need to

+  split functionality of our ADB API on Windows between two DLLs: AdbWinApi,

+  and AdbWinUsbApi. AdbWinApi is fully capable of working on top of the legacy

+  driver, but has no traces to WinUsb. AdbWinUsbApi is capable of working on

+  top of WinUsb API. We are forced to do this split, because we can have

+  dependency on WINUSB.DLL in the DLL that implements legacy API. The problem

+  is that customers may have a legacy driver that they don't want to upgrade

+  to WinUsb, so they may not have WINUSB.DLL installed on their machines, but

+  they still must be able to use ADB. So, the idea behind the split is as

+  such. When AdbWinApi.dll is loaded into a process, it will check WINUSB.DLL

+  installation (by checking existance of C:\Windows\System32\winusb.dll). If

+  WINUSB.DLL is installed, AdbWinApi will also load AdbWinUsbApi.dll (by

+  calling LoadLibrary), and will extract address of InstantiateWinUsbInterface

+  routine exported from AdbWinUsbApi.dll. Then this routine will be used to

+  instantiate AdbInterfaceObject instance on condition that it is confirmed

+  that USB driver underneath us is in deed WinUsb.

+*/

+typedef class AdbInterfaceObject* \

+    (__cdecl *PFN_INSTWINUSBINTERFACE)(const wchar_t*);

+

+#endif  // ANDROID_USB_API_ADBWINUSBAPI_H__

diff --git a/host/windows/usb/api/stdafx.h b/host/windows/usb/api/stdafx.h
index 92b2652..d57bec7 100644
--- a/host/windows/usb/api/stdafx.h
+++ b/host/windows/usb/api/stdafx.h
@@ -71,11 +71,8 @@
 #include <string>

 #pragma warning(default: 4201)

 #pragma warning(disable: 4200)

-extern "C" {

 #include <usbdi.h>

-#include <winusb.h>

 #include <usb100.h>

-}

 

 #include "resource.h"

 

diff --git a/host/windows/usb/winusb/AdbWinUsbApi.cpp b/host/windows/usb/winusb/AdbWinUsbApi.cpp
new file mode 100755
index 0000000..4916eeb
--- /dev/null
+++ b/host/windows/usb/winusb/AdbWinUsbApi.cpp
@@ -0,0 +1,62 @@
+/*

+ * Copyright (C) 2009 The Android Open Source Project

+ *

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ *

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ */

+

+// AdbWinUsbApi.cpp : Implementation of DLL Exports.

+

+#include "stdafx.h"

+#include "adb_winusb_interface.h"

+

+class CAdbWinApiModule : public CAtlDllModuleT< CAdbWinApiModule > {

+public:

+};

+

+CAdbWinApiModule _AtlModule;

+

+// DLL Entry Point

+extern "C" BOOL WINAPI DllMain(HINSTANCE instance,

+                               DWORD reason,

+                               LPVOID reserved) {

+    return _AtlModule.DllMain(reason, reserved);

+}

+

+/** \brief Instantiates interface instance that uses WinUsb API to communicate

+  with USB driver.

+

+  This is the only exported routine from this DLL. This routine instantiates an

+  object of AdbWinUsbInterfaceObject on request from AdbWinApi.dll when it is

+  detected that underlying USB driver is WinUsb.sys.

+  @param[in] interface_name Name of the interface.

+  @return AdbInterfaceObject - casted instance of AdbWinUsbInterfaceObject

+          object on success, or NULL on failure with GetLastError providing

+          information on an error that occurred.

+*/

+extern "C" __declspec(dllexport)

+AdbInterfaceObject* __cdecl InstantiateWinUsbInterface(

+    const wchar_t* interface_name) {

+    // Validate parameter.

+    if (NULL == interface_name) {

+        return NULL;

+    }

+

+    // Instantiate requested object.

+    try {

+        return new AdbWinUsbInterfaceObject(interface_name);

+    } catch (...) {

+        // We expect only OOM exceptions here.

+        SetLastError(ERROR_OUTOFMEMORY);

+        return NULL;

+    }

+}

diff --git a/host/windows/usb/winusb/AdbWinUsbApi.def b/host/windows/usb/winusb/AdbWinUsbApi.def
new file mode 100755
index 0000000..9e616e9
--- /dev/null
+++ b/host/windows/usb/winusb/AdbWinUsbApi.def
@@ -0,0 +1,5 @@
+; AdbWinUsbApi.def : Declares the module parameters.

+

+LIBRARY      "AdbWinUsbApi.DLL"

+

+EXPORTS

diff --git a/host/windows/usb/winusb/AdbWinUsbApi.rc b/host/windows/usb/winusb/AdbWinUsbApi.rc
new file mode 100755
index 0000000..44aa100
--- /dev/null
+++ b/host/windows/usb/winusb/AdbWinUsbApi.rc
@@ -0,0 +1,111 @@
+/*

+ * Copyright (C) 2009 The Android Open Source Project

+ *

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ *

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ */

+

+//Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+

+#define APSTUDIO_READONLY_SYMBOLS

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 2 resource.

+//

+#include "winres.h"

+

+/////////////////////////////////////////////////////////////////////////////

+#undef APSTUDIO_READONLY_SYMBOLS

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+LANGUAGE 9, 1

+#pragma code_page(1252)

+#ifdef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// TEXTINCLUDE

+//

+

+1 TEXTINCLUDE

+BEGIN

+    "resource.h\0"

+END

+

+2 TEXTINCLUDE

+BEGIN

+    "#include ""winres.h""\r\n"

+    "\0"

+END

+

+#endif    // APSTUDIO_INVOKED

+

+#ifndef _MAC

+/////////////////////////////////////////////////////////////////////////////

+//

+// Version

+//

+

+VS_VERSION_INFO VERSIONINFO

+ FILEVERSION 2,0,0,0

+ PRODUCTVERSION 2,0,0,0

+ FILEFLAGSMASK 0x3fL

+#ifdef _DEBUG

+ FILEFLAGS 0x1L

+#else

+ FILEFLAGS 0x0L

+#endif

+ FILEOS 0x4L

+ FILETYPE 0x2L

+ FILESUBTYPE 0x0L

+BEGIN

+    BLOCK "StringFileInfo"

+    BEGIN

+        BLOCK "040904e4"

+        BEGIN

+            VALUE "CompanyName", "Google, inc"

+            VALUE "FileDescription", "Android ADB API (WinUsb)"

+            VALUE "FileVersion", "2.0.0.0"

+            VALUE "LegalCopyright", "Copyright (C) 2006 The Android Open Source Project"

+            VALUE "InternalName", "AdbWinUsbApi.dll"

+            VALUE "OriginalFilename", "AdbWinUsbApi.dll"

+            VALUE "ProductName", "Android SDK"

+            VALUE "ProductVersion", "2.0.0.0"

+            VALUE "OLESelfRegister", ""

+        END

+    END

+    BLOCK "VarFileInfo"

+    BEGIN

+		VALUE "Translation", 0x0409, 1252

+    END

+END

+

+#endif    // !_MAC

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// String Table

+//

+

+STRINGTABLE

+BEGIN

+	IDS_PROJNAME					"AdbWinUsbApi"

+END

+

+////////////////////////////////////////////////////////////////////////////

+

+

+#endif

+

+#ifndef APSTUDIO_INVOKED

+#endif    // not APSTUDIO_INVOKED

diff --git a/host/windows/usb/winusb/BUILDME.TXT b/host/windows/usb/winusb/BUILDME.TXT
new file mode 100755
index 0000000..2a459ef
--- /dev/null
+++ b/host/windows/usb/winusb/BUILDME.TXT
@@ -0,0 +1,7 @@
+In order to build AdbWinUsbApi.dll you will need to install Windows Driver Kit,

+which can be obtained from Microsoft. Assuming that WDK is installed, you

+need to set one of the WDK's build environments, "cd" back into this directory,

+and execute "build -cbeEIFZ" to clean and rebuild this project, or you can

+execute "build -befEIF" to do a minimal build.

+Note that you need to build AdbWinApi.dll (..\api) before you build

+AdbWinUsbApi.dll, as it depends on AdbWinApi.lib library.

diff --git a/host/windows/usb/winusb/MAKEFILE b/host/windows/usb/winusb/MAKEFILE
new file mode 100755
index 0000000..fcd896d
--- /dev/null
+++ b/host/windows/usb/winusb/MAKEFILE
@@ -0,0 +1,22 @@
+#

+#  Copyright (C) 2009 The Android Open Source Project

+# 

+#  Licensed under the Apache License, Version 2.0 (the "License");

+#  you may not use this file except in compliance with the License.

+#  You may obtain a copy of the License at

+# 

+#       http://www.apache.org/licenses/LICENSE-2.0

+# 

+#  Unless required by applicable law or agreed to in writing, software

+#  distributed under the License is distributed on an "AS IS" BASIS,

+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+#  See the License for the specific language governing permissions and

+#  limitations under the License.

+#

+

+#

+# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source

+# file to this component.  This file merely indirects to the real make file

+# that is shared by all the components of NT OS/2

+#

+!INCLUDE $(NTMAKEENV)\makefile.def

diff --git a/host/windows/usb/winusb/Resource.h b/host/windows/usb/winusb/Resource.h
new file mode 100755
index 0000000..3ede761
--- /dev/null
+++ b/host/windows/usb/winusb/Resource.h
@@ -0,0 +1,34 @@
+/*

+ * Copyright (C) 2009 The Android Open Source Project

+ *

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ *

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ */

+

+//{{NO_DEPENDENCIES}}

+// Microsoft Visual C++ generated include file.

+// Used by AdbWinApi.rc

+//

+

+#define IDS_PROJNAME                    100

+#define IDR_ADBWINAPI	101

+

+// Next default values for new objects

+//

+#ifdef APSTUDIO_INVOKED

+#ifndef APSTUDIO_READONLY_SYMBOLS

+#define _APS_NEXT_RESOURCE_VALUE        201

+#define _APS_NEXT_COMMAND_VALUE         32768

+#define _APS_NEXT_CONTROL_VALUE         201

+#define _APS_NEXT_SYMED_VALUE           102

+#endif

+#endif

diff --git a/host/windows/usb/winusb/SOURCES b/host/windows/usb/winusb/SOURCES
new file mode 100755
index 0000000..80d17ae
--- /dev/null
+++ b/host/windows/usb/winusb/SOURCES
@@ -0,0 +1,93 @@
+#

+#  Copyright (C) 2009 The Android Open Source Project

+# 

+#  Licensed under the Apache License, Version 2.0 (the "License");

+#  you may not use this file except in compliance with the License.

+#  You may obtain a copy of the License at

+# 

+#       http://www.apache.org/licenses/LICENSE-2.0

+# 

+#  Unless required by applicable law or agreed to in writing, software

+#  distributed under the License is distributed on an "AS IS" BASIS,

+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+#  See the License for the specific language governing permissions and

+#  limitations under the License.

+#

+

+TARGETNAME = AdbWinUsbApi

+TARGETPATH = obj

+TARGETTYPE = DYNLINK

+

+UMTYPE = windows

+DLLDEF = AdbWinUsbApi.def

+

+# Use statically linked atl libraries:

+# - atls.lib for free build

+# - atlsd.lib for checked build

+USE_STATIC_ATL  = 1

+# Use ATL v. 7.1

+ATL_VER         = 71

+# Use STL v. 6.0

+USE_STL         = 1

+STL_VER         = 60

+# Use multithreaded libraries

+USE_LIBCMT      = 1

+

+# Include directories

+INCLUDES = $(DDK_INC_PATH);           \

+           $(SDK_INC_PATH);           \

+           $(CRT_INC_PATH);           \

+           $(SDK_INC_PATH)\crt;       \

+           $(CRT_INC_PATH)\atl71;     \

+           $(SDK_INC_PATH)\crt\stl60

+

+# Common target libraries

+TARGETLIBS = $(SDK_LIB_PATH)\ole32.lib    \

+             $(SDK_LIB_PATH)\Advapi32.lib \

+             $(SDK_LIB_PATH)\Kernel32.lib \

+             $(SDK_LIB_PATH)\User32.lib   \

+             $(SDK_LIB_PATH)\oleaut32.lib \

+             $(SDK_LIB_PATH)\wbemuuid.lib \

+             $(SDK_LIB_PATH)\uuid.lib     \

+             $(SDK_LIB_PATH)\setupapi.lib \

+             $(SDK_LIB_PATH)\usbd.lib     \

+             $(SDK_LIB_PATH)\winusb.lib   \

+             ..\api\obj$(BUILD_ALT_DIR)\i386\AdbWinApi.lib

+

+!IF "$(DDKBUILDENV)" == "fre"
+# Libraries for release (free) builds
+TARGETLIBS = $(TARGETLIBS) $(ATL_LIB_PATH)\atls.lib

+!ELSE

+# Libraries for debug (checked) builds
+TARGETLIBS = $(TARGETLIBS) $(ATL_LIB_PATH)\atlsd.lib

+!ENDIF

+

+# Common C defines

+C_DEFINES= $(C_DEFINES) -DADBWINUSB_EXPORTS -D_UNICODE \

+           -DUNICODE -DWIN32 -D_WINDOWS -D_USRDLL -D_WINDLL

+

+!IF "$(DDKBUILDENV)" == "fre"
+# C defines for release (free) builds
+C_DEFINES = $(C_DEFINES) -DNDEBUG

+!ELSE

+# C defines for debug (checked) builds
+C_DEFINES = $(C_DEFINES) -D_DEBUG

+!ENDIF

+

+# Turn on all warnings, and treat warnings as errors

+MSC_WARNING_LEVEL = /W4 /Wp64 /WX
+
+# Common C defines

+USER_C_FLAGS = $(USER_C_FLAGS) /FD /EHsc /wd4100 /wd4200 /wd4702 /nologo
+
+# Set precompiled header information
+PRECOMPILED_CXX = 1

+PRECOMPILED_INCLUDE = stdafx.h

+PRECOMPILED_SOURCEFILE = stdafx.cpp

+

+# Define source files for AdbWinUsbApi.dll

+SOURCES = adb_winusb_endpoint_object.cpp  \

+          adb_winusb_interface.cpp        \

+          adb_winusb_io_completion.cpp    \

+          AdbWinUsbApi.cpp                \

+		      AdbWinUsbApi.rc

diff --git a/host/windows/usb/api/adb_winusb_endpoint_object.cpp b/host/windows/usb/winusb/adb_winusb_endpoint_object.cpp
similarity index 95%
rename from host/windows/usb/api/adb_winusb_endpoint_object.cpp
rename to host/windows/usb/winusb/adb_winusb_endpoint_object.cpp
index 236de3b..16f7837 100755
--- a/host/windows/usb/api/adb_winusb_endpoint_object.cpp
+++ b/host/windows/usb/winusb/adb_winusb_endpoint_object.cpp
@@ -22,7 +22,6 @@
 #include "stdafx.h"

 #include "adb_winusb_endpoint_object.h"

 #include "adb_winusb_io_completion.h"

-#include "adb_helper_routines.h"

 

 AdbWinUsbEndpointObject::AdbWinUsbEndpointObject(

     AdbWinUsbInterfaceObject* parent_interf,

@@ -34,6 +33,17 @@
 AdbWinUsbEndpointObject::~AdbWinUsbEndpointObject() {

 }

 

+LONG AdbWinUsbEndpointObject::Release() {

+  ATLASSERT(ref_count_ > 0);

+  LONG ret = InterlockedDecrement(&ref_count_);

+  ATLASSERT(ret >= 0);

+  if (0 == ret) {

+    LastReferenceReleased();

+    delete this;

+  }

+  return ret;

+}

+

 ADBAPIHANDLE AdbWinUsbEndpointObject::CommonAsyncReadWrite(

     bool is_read,

     void* buffer,

diff --git a/host/windows/usb/api/adb_winusb_endpoint_object.h b/host/windows/usb/winusb/adb_winusb_endpoint_object.h
similarity index 83%
rename from host/windows/usb/api/adb_winusb_endpoint_object.h
rename to host/windows/usb/winusb/adb_winusb_endpoint_object.h
index 26ef53b..92b6e04 100755
--- a/host/windows/usb/api/adb_winusb_endpoint_object.h
+++ b/host/windows/usb/winusb/adb_winusb_endpoint_object.h
@@ -21,7 +21,7 @@
   encapsulates a handle opened to a WinUsb endpoint on our device.

 */

 

-#include "adb_endpoint_object.h"

+#include "..\api\adb_endpoint_object.h"

 #include "adb_winusb_interface.h"

 

 /** Class AdbWinUsbEndpointObject encapsulates a handle opened to an endpoint on

@@ -49,6 +49,30 @@
   virtual ~AdbWinUsbEndpointObject();

 

   //

+  // Virtual overrides

+  //

+

+ public:

+  /** \brief Releases the object.

+

+    If refcount drops to zero as the result of this release, the object is

+    destroyed in this method. As a general rule, objects must not be touched

+    after this method returns even if returned value is not zero. We override

+    this method in order to make sure that objects of this class are deleted

+    in contect of the DLL they were created in. The problem is that since

+    objects of this class were created in context of AdbWinUsbApi module, they

+    are allocated from the heap assigned to that module. Now, if these objects

+    are deleted outside of AdbWinUsbApi module, this will lead to the heap

+    corruption in the module that deleted these objects. Since all objects of

+    this class are deleted in the Release method only, by overriding it we make

+    sure that we free memory in the context of the module where it was

+    allocated.

+    @return Value of the reference counter after object is released in this

+            method.

+  */

+  virtual LONG Release();

+

+  //

   // Abstract overrides

   //

 

diff --git a/host/windows/usb/api/adb_winusb_interface.cpp b/host/windows/usb/winusb/adb_winusb_interface.cpp
similarity index 97%
rename from host/windows/usb/api/adb_winusb_interface.cpp
rename to host/windows/usb/winusb/adb_winusb_interface.cpp
index d09c1cb..9d0377a 100755
--- a/host/windows/usb/api/adb_winusb_interface.cpp
+++ b/host/windows/usb/winusb/adb_winusb_interface.cpp
@@ -40,6 +40,17 @@
   ATLASSERT(INVALID_HANDLE_VALUE == usb_device_handle_);

 }

 

+LONG AdbWinUsbInterfaceObject::Release() {

+  ATLASSERT(ref_count_ > 0);

+  LONG ret = InterlockedDecrement(&ref_count_);

+  ATLASSERT(ret >= 0);

+  if (0 == ret) {

+    LastReferenceReleased();

+    delete this;

+  }

+  return ret;

+}

+

 ADBAPIHANDLE AdbWinUsbInterfaceObject::CreateHandle() {

   // Open USB device for this inteface Note that WinUsb API

   // requires the handle to be opened for overlapped I/O.

diff --git a/host/windows/usb/api/adb_winusb_interface.h b/host/windows/usb/winusb/adb_winusb_interface.h
similarity index 86%
rename from host/windows/usb/api/adb_winusb_interface.h
rename to host/windows/usb/winusb/adb_winusb_interface.h
index 82f7f89..2311fd1 100755
--- a/host/windows/usb/api/adb_winusb_interface.h
+++ b/host/windows/usb/winusb/adb_winusb_interface.h
@@ -22,7 +22,7 @@
   via WinUsb API.

 */

 

-#include "adb_interface.h"

+#include "..\api\adb_interface.h"

 

 /** \brief Encapsulates an interface on our USB device that is accessible

   via WinUsb API.

@@ -48,6 +48,25 @@
   //

 

  public:

+  /** \brief Releases the object.

+

+    If refcount drops to zero as the result of this release, the object is

+    destroyed in this method. As a general rule, objects must not be touched

+    after this method returns even if returned value is not zero. We override

+    this method in order to make sure that objects of this class are deleted

+    in contect of the DLL they were created in. The problem is that since

+    objects of this class were created in context of AdbWinUsbApi module, they

+    are allocated from the heap assigned to that module. Now, if these objects

+    are deleted outside of AdbWinUsbApi module, this will lead to the heap

+    corruption in the module that deleted these objects. Since all objects of

+    this class are deleted in the Release method only, by overriding it we make

+    sure that we free memory in the context of the module where it was

+    allocated.

+    @return Value of the reference counter after object is released in this

+            method.

+  */

+  virtual LONG Release();

+

   /** \brief Creates handle to this object.

 

     In this call a handle for this object is generated and object is added

diff --git a/host/windows/usb/api/adb_winusb_io_completion.cpp b/host/windows/usb/winusb/adb_winusb_io_completion.cpp
similarity index 92%
rename from host/windows/usb/api/adb_winusb_io_completion.cpp
rename to host/windows/usb/winusb/adb_winusb_io_completion.cpp
index baeb7bb..d98f872 100755
--- a/host/windows/usb/api/adb_winusb_io_completion.cpp
+++ b/host/windows/usb/winusb/adb_winusb_io_completion.cpp
@@ -33,6 +33,17 @@
 AdbWinUsbIOCompletion::~AdbWinUsbIOCompletion() {

 }

 

+LONG AdbWinUsbIOCompletion::Release() {

+  ATLASSERT(ref_count_ > 0);

+  LONG ret = InterlockedDecrement(&ref_count_);

+  ATLASSERT(ret >= 0);

+  if (0 == ret) {

+    LastReferenceReleased();

+    delete this;

+  }

+  return ret;

+}

+

 bool AdbWinUsbIOCompletion::GetOvelappedIoResult(LPOVERLAPPED ovl_data,

                                                  ULONG* bytes_transferred,

                                                  bool wait) {

diff --git a/host/windows/usb/api/adb_winusb_io_completion.h b/host/windows/usb/winusb/adb_winusb_io_completion.h
similarity index 77%
rename from host/windows/usb/api/adb_winusb_io_completion.h
rename to host/windows/usb/winusb/adb_winusb_io_completion.h
index a97a3a8..93a4c07 100755
--- a/host/windows/usb/api/adb_winusb_io_completion.h
+++ b/host/windows/usb/winusb/adb_winusb_io_completion.h
@@ -22,7 +22,7 @@
   asynchronous I/O requests issued via WinUsb API.

 */

 

-#include "adb_io_completion.h"

+#include "..\api\adb_io_completion.h"

 #include "adb_winusb_endpoint_object.h"

 

 /** \brief Encapsulates encapsulates a wrapper around OVERLAPPED Win32

@@ -57,6 +57,30 @@
   virtual ~AdbWinUsbIOCompletion();

 

   //

+  // Virtual overrides

+  //

+

+ public:

+  /** \brief Releases the object.

+

+    If refcount drops to zero as the result of this release, the object is

+    destroyed in this method. As a general rule, objects must not be touched

+    after this method returns even if returned value is not zero. We override

+    this method in order to make sure that objects of this class are deleted

+    in contect of the DLL they were created in. The problem is that since

+    objects of this class were created in context of AdbWinUsbApi module, they

+    are allocated from the heap assigned to that module. Now, if these objects

+    are deleted outside of AdbWinUsbApi module, this will lead to the heap

+    corruption in the module that deleted these objects. Since all objects of

+    this class are deleted in the Release method only, by overriding it we make

+    sure that we free memory in the context of the module where it was

+    allocated.

+    @return Value of the reference counter after object is released in this

+            method.

+  */

+  virtual LONG Release();

+

+  //

   // Abstract overrides

   //

 

diff --git a/host/windows/usb/winusb/stdafx.cpp b/host/windows/usb/winusb/stdafx.cpp
new file mode 100755
index 0000000..562765b
--- /dev/null
+++ b/host/windows/usb/winusb/stdafx.cpp
@@ -0,0 +1,21 @@
+/*

+ * Copyright (C) 2009 The Android Open Source Project

+ *

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ *

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ */

+

+// stdafx.cpp : source file that includes just the standard includes

+// AdbWinUsbApi.pch will be the pre-compiled header

+// stdafx.obj will contain the pre-compiled type information

+

+#include "stdafx.h"

diff --git a/host/windows/usb/winusb/stdafx.h b/host/windows/usb/winusb/stdafx.h
new file mode 100755
index 0000000..c2aa8de
--- /dev/null
+++ b/host/windows/usb/winusb/stdafx.h
@@ -0,0 +1,78 @@
+/*

+ * Copyright (C) 2009 The Android Open Source Project

+ *

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ *

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ */

+

+/** \file

+  Visual Studio generated include file for standard system include files, or

+  project specific include files that are used frequently, but are changed

+  infrequently.

+*/

+

+#pragma once

+

+#ifndef STRICT

+#define STRICT

+#endif

+

+// Modify the following defines if you have to target a platform prior to the ones specified below.

+// Refer to MSDN for the latest info on corresponding values for different platforms.

+#ifndef WINVER				// Allow use of features specific to Windows 95 and Windows NT 4 or later.

+#define WINVER 0x0500		// Change this to the appropriate value to target Windows 98 and Windows 2000 or later.

+#endif

+

+#ifndef _WIN32_WINNT		// Allow use of features specific to Windows NT 4 or later.

+#define _WIN32_WINNT 0x0500	// Change this to the appropriate value to target Windows 2000 or later.

+#endif

+

+#ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.

+#define _WIN32_WINDOWS 0x0500 // Change this to the appropriate value to target Windows Me or later.

+#endif

+

+#ifndef _WIN32_IE			// Allow use of features specific to IE 4.0 or later.

+#define _WIN32_IE 0x0501	// Change this to the appropriate value to target IE 5.0 or later.

+#endif

+

+// These defines prevent the MS header files from ejecting #pragma comment

+// statements with the manifest information of the used ATL, STL, and CRT

+#define _ATL_NOFORCE_MANIFEST

+#define _STL_NOFORCE_MANIFEST

+#define _CRT_NOFORCE_MANIFEST

+

+#define _ATL_APARTMENT_THREADED

+#define _ATL_NO_AUTOMATIC_NAMESPACE

+

+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit

+

+// turns off ATL's hiding of some common and often safely ignored warning messages

+#define _ATL_ALL_WARNINGS

+

+// #define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers

+

+#include <windows.h>

+#pragma warning(disable: 4702)

+#pragma warning(disable: 4201)

+#include <atlbase.h>

+#include <winioctl.h>

+#include <setupapi.h>

+#include <vector>

+#include <map>

+#include <string>

+#pragma warning(default: 4201)

+#pragma warning(disable: 4200)

+#include <winusb.h>

+

+#include "resource.h"

+

+using namespace ATL;

diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml
index fb34afa..032f5c2 100644
--- a/samples/ApiDemos/AndroidManifest.xml
+++ b/samples/ApiDemos/AndroidManifest.xml
@@ -1627,6 +1627,13 @@
             </intent-filter>
         </activity-alias>
 
+        <activity android:name=".graphics.DensityActivity" android:label="Graphics/Density">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <!-- ************************************* -->
         <!--             MEDIA SAMPLES             -->
         <!-- ************************************* -->
diff --git a/samples/ApiDemos/res/drawable-hdpi/logo240dpi.png b/samples/ApiDemos/res/drawable-hdpi/logo240dpi.png
new file mode 100644
index 0000000..4d717a8
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-hdpi/logo240dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-hdpi/npatch240dpi.9.png b/samples/ApiDemos/res/drawable-hdpi/npatch240dpi.9.png
new file mode 100644
index 0000000..a362b0f
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-hdpi/npatch240dpi.9.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-hdpi/reslogo240dpi.png b/samples/ApiDemos/res/drawable-hdpi/reslogo240dpi.png
new file mode 100644
index 0000000..4d717a8
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-hdpi/reslogo240dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-hdpi/smlnpatch240dpi.9.png b/samples/ApiDemos/res/drawable-hdpi/smlnpatch240dpi.9.png
new file mode 100644
index 0000000..84bdcb0
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-hdpi/smlnpatch240dpi.9.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-hdpi/stylogo240dpi.png b/samples/ApiDemos/res/drawable-hdpi/stylogo240dpi.png
new file mode 100644
index 0000000..4d717a8
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-hdpi/stylogo240dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-ldpi/logo120dpi.png b/samples/ApiDemos/res/drawable-ldpi/logo120dpi.png
new file mode 100644
index 0000000..46bbd5b
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-ldpi/logo120dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-ldpi/npatch120dpi.9.png b/samples/ApiDemos/res/drawable-ldpi/npatch120dpi.9.png
new file mode 100644
index 0000000..0d8115b
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-ldpi/npatch120dpi.9.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-ldpi/reslogo120dpi.png b/samples/ApiDemos/res/drawable-ldpi/reslogo120dpi.png
new file mode 100644
index 0000000..46bbd5b
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-ldpi/reslogo120dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-ldpi/smlnpatch120dpi.9.png b/samples/ApiDemos/res/drawable-ldpi/smlnpatch120dpi.9.png
new file mode 100644
index 0000000..de8d607
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-ldpi/smlnpatch120dpi.9.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-ldpi/stylogo120dpi.png b/samples/ApiDemos/res/drawable-ldpi/stylogo120dpi.png
new file mode 100644
index 0000000..46bbd5b
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-ldpi/stylogo120dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/logonodpi120.png b/samples/ApiDemos/res/drawable-nodpi/logonodpi120.png
new file mode 100644
index 0000000..46bbd5b
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/logonodpi120.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/logonodpi160.png b/samples/ApiDemos/res/drawable-nodpi/logonodpi160.png
new file mode 100644
index 0000000..c23b2ce
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/logonodpi160.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/logonodpi240.png b/samples/ApiDemos/res/drawable-nodpi/logonodpi240.png
new file mode 100644
index 0000000..4d717a8
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/logonodpi240.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable/logo160dpi.png b/samples/ApiDemos/res/drawable/logo160dpi.png
new file mode 100644
index 0000000..c23b2ce
--- /dev/null
+++ b/samples/ApiDemos/res/drawable/logo160dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable/npatch160dpi.9.png b/samples/ApiDemos/res/drawable/npatch160dpi.9.png
new file mode 100644
index 0000000..44d89a9
--- /dev/null
+++ b/samples/ApiDemos/res/drawable/npatch160dpi.9.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable/reslogo160dpi.png b/samples/ApiDemos/res/drawable/reslogo160dpi.png
new file mode 100644
index 0000000..c23b2ce
--- /dev/null
+++ b/samples/ApiDemos/res/drawable/reslogo160dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable/smlnpatch160dpi.9.png b/samples/ApiDemos/res/drawable/smlnpatch160dpi.9.png
new file mode 100644
index 0000000..76c4ae8
--- /dev/null
+++ b/samples/ApiDemos/res/drawable/smlnpatch160dpi.9.png
Binary files differ
diff --git a/samples/ApiDemos/res/drawable/stylogo160dpi.png b/samples/ApiDemos/res/drawable/stylogo160dpi.png
new file mode 100644
index 0000000..c23b2ce
--- /dev/null
+++ b/samples/ApiDemos/res/drawable/stylogo160dpi.png
Binary files differ
diff --git a/samples/ApiDemos/res/layout/density_image_views.xml b/samples/ApiDemos/res/layout/density_image_views.xml
new file mode 100644
index 0000000..6a91497
--- /dev/null
+++ b/samples/ApiDemos/res/layout/density_image_views.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="horizontal"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:src="@drawable/reslogo120dpi" />
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:src="@drawable/reslogo160dpi" />
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:src="@drawable/reslogo240dpi" />
+
+</LinearLayout>
diff --git a/samples/ApiDemos/res/layout/density_styled_image_views.xml b/samples/ApiDemos/res/layout/density_styled_image_views.xml
new file mode 100644
index 0000000..86c63bf
--- /dev/null
+++ b/samples/ApiDemos/res/layout/density_styled_image_views.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="horizontal"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+
+    <ImageView style="@style/ImageView120dpi" />
+    <ImageView style="@style/ImageView160dpi" />
+    <ImageView style="@style/ImageView240dpi" />
+
+</LinearLayout>
diff --git a/samples/ApiDemos/res/values-large-long/strings.xml b/samples/ApiDemos/res/values-large-long/strings.xml
new file mode 100644
index 0000000..7c392d8
--- /dev/null
+++ b/samples/ApiDemos/res/values-large-long/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Large Long</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-large-notlong/strings.xml b/samples/ApiDemos/res/values-large-notlong/strings.xml
new file mode 100644
index 0000000..40328ea
--- /dev/null
+++ b/samples/ApiDemos/res/values-large-notlong/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Large NotLong</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-large/strings.xml b/samples/ApiDemos/res/values-large/strings.xml
new file mode 100644
index 0000000..c9fb189
--- /dev/null
+++ b/samples/ApiDemos/res/values-large/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Large</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-long/strings.xml b/samples/ApiDemos/res/values-long/strings.xml
new file mode 100644
index 0000000..5d15048
--- /dev/null
+++ b/samples/ApiDemos/res/values-long/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Long</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-normal-long/strings.xml b/samples/ApiDemos/res/values-normal-long/strings.xml
new file mode 100644
index 0000000..01a0487
--- /dev/null
+++ b/samples/ApiDemos/res/values-normal-long/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Normal Long</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-normal-notlong/strings.xml b/samples/ApiDemos/res/values-normal-notlong/strings.xml
new file mode 100644
index 0000000..bea3f8d
--- /dev/null
+++ b/samples/ApiDemos/res/values-normal-notlong/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Normal NotLong</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-normal/strings.xml b/samples/ApiDemos/res/values-normal/strings.xml
new file mode 100644
index 0000000..16ff46f
--- /dev/null
+++ b/samples/ApiDemos/res/values-normal/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Normal</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-notlong/strings.xml b/samples/ApiDemos/res/values-notlong/strings.xml
new file mode 100644
index 0000000..a3e78db
--- /dev/null
+++ b/samples/ApiDemos/res/values-notlong/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: NotLong</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-small-long/strings.xml b/samples/ApiDemos/res/values-small-long/strings.xml
new file mode 100644
index 0000000..8526f61
--- /dev/null
+++ b/samples/ApiDemos/res/values-small-long/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Small Long</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-small-notlong/strings.xml b/samples/ApiDemos/res/values-small-notlong/strings.xml
new file mode 100644
index 0000000..bc8a676
--- /dev/null
+++ b/samples/ApiDemos/res/values-small-notlong/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Small NotLong</string>
+</resources>
diff --git a/samples/ApiDemos/res/values-small/strings.xml b/samples/ApiDemos/res/values-small/strings.xml
new file mode 100644
index 0000000..56db730
--- /dev/null
+++ b/samples/ApiDemos/res/values-small/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="density_title">Density: Small</string>
+</resources>
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index 29bbcec..c2c9829 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -423,6 +423,8 @@
 
     <string name="hide_me">Hide Me!</string>
 
+    <string name="density_title">Density: Unknown Screen</string>
+    
     <!-- ============================ -->
     <!--  media examples strings  -->
     <!-- ============================ -->
diff --git a/samples/ApiDemos/res/values/styles.xml b/samples/ApiDemos/res/values/styles.xml
index 40e934e..3c9c681 100644
--- a/samples/ApiDemos/res/values/styles.xml
+++ b/samples/ApiDemos/res/values/styles.xml
@@ -63,4 +63,21 @@
         <item name="android:textStyle">normal</item>
     </style>
 
+    <style name="ImageView120dpi">
+        <item name="android:src">@drawable/stylogo120dpi</item>
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
+
+    <style name="ImageView160dpi">
+        <item name="android:src">@drawable/stylogo160dpi</item>
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
+
+    <style name="ImageView240dpi">
+        <item name="android:src">@drawable/stylogo240dpi</item>
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
 </resources>
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.java b/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.java
new file mode 100644
index 0000000..10c42a7
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.graphics;
+
+//Need the following import to get access to the app resources, since this
+//class is in a sub-package.
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.app.Application;
+import android.os.Bundle;
+import android.graphics.BitmapFactory;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.ScrollView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.util.DisplayMetrics;
+import android.util.Log;
+
+/**
+ * This activity demonstrates various ways density can cause the scaling of
+ * bitmaps and drawables.
+ */
+public class DensityActivity extends Activity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        final LayoutInflater li = (LayoutInflater)getSystemService(
+                LAYOUT_INFLATER_SERVICE);
+        
+        this.setTitle(R.string.density_title);
+        LinearLayout root = new LinearLayout(this);
+        root.setOrientation(LinearLayout.VERTICAL);
+
+        LinearLayout layout = new LinearLayout(this);
+        addBitmapDrawable(layout, R.drawable.logo120dpi, true);
+        addBitmapDrawable(layout, R.drawable.logo160dpi, true);
+        addBitmapDrawable(layout, R.drawable.logo240dpi, true);
+        addLabelToRoot(root, "Prescaled bitmap in drawable");
+        addChildToRoot(root, layout);
+
+        layout = new LinearLayout(this);
+        addBitmapDrawable(layout, R.drawable.logo120dpi, false);
+        addBitmapDrawable(layout, R.drawable.logo160dpi, false);
+        addBitmapDrawable(layout, R.drawable.logo240dpi, false);
+        addLabelToRoot(root, "Autoscaled bitmap in drawable");
+        addChildToRoot(root, layout);
+
+        layout = new LinearLayout(this);
+        addResourceDrawable(layout, R.drawable.logo120dpi);
+        addResourceDrawable(layout, R.drawable.logo160dpi);
+        addResourceDrawable(layout, R.drawable.logo240dpi);
+        addLabelToRoot(root, "Prescaled resource drawable");
+        addChildToRoot(root, layout);
+
+        layout = (LinearLayout)li.inflate(R.layout.density_image_views, null);
+        addLabelToRoot(root, "Inflated layout");
+        addChildToRoot(root, layout);
+        
+        layout = (LinearLayout)li.inflate(R.layout.density_styled_image_views, null);
+        addLabelToRoot(root, "Inflated styled layout");
+        addChildToRoot(root, layout);
+        
+        layout = new LinearLayout(this);
+        addCanvasBitmap(layout, R.drawable.logo120dpi, true);
+        addCanvasBitmap(layout, R.drawable.logo160dpi, true);
+        addCanvasBitmap(layout, R.drawable.logo240dpi, true);
+        addLabelToRoot(root, "Prescaled bitmap");
+        addChildToRoot(root, layout);
+
+        layout = new LinearLayout(this);
+        addCanvasBitmap(layout, R.drawable.logo120dpi, false);
+        addCanvasBitmap(layout, R.drawable.logo160dpi, false);
+        addCanvasBitmap(layout, R.drawable.logo240dpi, false);
+        addLabelToRoot(root, "Autoscaled bitmap");
+        addChildToRoot(root, layout);
+
+        layout = new LinearLayout(this);
+        addResourceDrawable(layout, R.drawable.logonodpi120);
+        addResourceDrawable(layout, R.drawable.logonodpi160);
+        addResourceDrawable(layout, R.drawable.logonodpi240);
+        addLabelToRoot(root, "No-dpi resource drawable");
+        addChildToRoot(root, layout);
+
+        layout = new LinearLayout(this);
+        addNinePatchResourceDrawable(layout, R.drawable.smlnpatch120dpi);
+        addNinePatchResourceDrawable(layout, R.drawable.smlnpatch160dpi);
+        addNinePatchResourceDrawable(layout, R.drawable.smlnpatch240dpi);
+        addLabelToRoot(root, "Prescaled 9-patch resource drawable");
+        addChildToRoot(root, layout);
+
+        setContentView(scrollWrap(root));
+    }
+
+    private View scrollWrap(View view) {
+        ScrollView scroller = new ScrollView(this);
+        scroller.addView(view, new ScrollView.LayoutParams(ScrollView.LayoutParams.FILL_PARENT,
+                ScrollView.LayoutParams.FILL_PARENT));
+        return scroller;
+    }
+
+    private void addLabelToRoot(LinearLayout root, String text) {
+        TextView label = new TextView(this);
+        label.setText(text);
+        root.addView(label, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
+                LinearLayout.LayoutParams.WRAP_CONTENT));
+    }
+
+    private void addChildToRoot(LinearLayout root, LinearLayout layout) {
+        root.addView(layout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
+                LinearLayout.LayoutParams.WRAP_CONTENT));
+    }
+
+    private void addBitmapDrawable(LinearLayout layout, int resource, boolean scale) {
+        Bitmap bitmap;
+        bitmap = loadAndPrintDpi(resource, scale);
+
+        View view = new View(this);
+
+        final BitmapDrawable d = new BitmapDrawable(getResources(), bitmap);
+        if (!scale) d.setTargetDensity(getResources().getDisplayMetrics());
+        view.setBackgroundDrawable(d);
+
+        view.setLayoutParams(new LinearLayout.LayoutParams(d.getIntrinsicWidth(),
+                d.getIntrinsicHeight()));
+        layout.addView(view);
+    }
+
+    private void addResourceDrawable(LinearLayout layout, int resource) {
+        View view = new View(this);
+
+        final Drawable d = getResources().getDrawable(resource);
+        view.setBackgroundDrawable(d);
+
+        view.setLayoutParams(new LinearLayout.LayoutParams(d.getIntrinsicWidth(),
+                d.getIntrinsicHeight()));
+        layout.addView(view);
+    }
+
+    private void addCanvasBitmap(LinearLayout layout, int resource, boolean scale) {
+        Bitmap bitmap;
+        bitmap = loadAndPrintDpi(resource, scale);
+
+        ScaledBitmapView view = new ScaledBitmapView(this, bitmap);
+
+        view.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
+                LinearLayout.LayoutParams.WRAP_CONTENT));
+        layout.addView(view);
+    }
+
+    private void addNinePatchResourceDrawable(LinearLayout layout, int resource) {
+        View view = new View(this);
+
+        final Drawable d = getResources().getDrawable(resource);
+        view.setBackgroundDrawable(d);
+
+        Log.i("foo", "9-patch #" + Integer.toHexString(resource)
+                + " w=" + d.getIntrinsicWidth() + " h=" + d.getIntrinsicHeight());
+        view.setLayoutParams(new LinearLayout.LayoutParams(
+                d.getIntrinsicWidth()*2, d.getIntrinsicHeight()*2));
+        layout.addView(view);
+    }
+
+    private Bitmap loadAndPrintDpi(int id, boolean scale) {
+        Bitmap bitmap;
+        if (scale) {
+            bitmap = BitmapFactory.decodeResource(getResources(), id);
+        } else {
+            BitmapFactory.Options opts = new BitmapFactory.Options();
+            opts.inScaled = false;
+            bitmap = BitmapFactory.decodeResource(getResources(), id, opts);
+        }
+        return bitmap;
+    }
+
+    private class ScaledBitmapView extends View {
+        private Bitmap mBitmap;
+
+        public ScaledBitmapView(Context context, Bitmap bitmap) {
+            super(context);
+            mBitmap = bitmap;
+        }
+
+        @Override
+        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+            final DisplayMetrics metrics = getResources().getDisplayMetrics();
+            setMeasuredDimension(
+                    mBitmap.getScaledWidth(metrics),
+                    mBitmap.getScaledHeight(metrics));
+        }
+
+        @Override
+        protected void onDraw(Canvas canvas) {
+            super.onDraw(canvas);
+
+            canvas.drawBitmap(mBitmap, 0.0f, 0.0f, null);
+        }
+    }
+}
diff --git a/samples/SearchableDictionary/Android.mk b/samples/SearchableDictionary/Android.mk
new file mode 100755
index 0000000..8c5fdf4
--- /dev/null
+++ b/samples/SearchableDictionary/Android.mk
@@ -0,0 +1,12 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_SDK_VERSION := current
+
+LOCAL_PACKAGE_NAME := SearchableDictionary
+
+include $(BUILD_PACKAGE)
diff --git a/samples/SearchableDictionary/AndroidManifest.xml b/samples/SearchableDictionary/AndroidManifest.xml
new file mode 100644
index 0000000..93cd47b
--- /dev/null
+++ b/samples/SearchableDictionary/AndroidManifest.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+        package="com.example.android.searchabledict">
+
+    <uses-sdk android:minSdkVersion="4" />
+
+    <application android:label="@string/app_name"
+            android:icon="@drawable/ic_dictionary">
+
+        <!-- The default activity of the app.  Can also display search results. -->
+        <activity android:name=".SearchableDictionary"
+                android:label="@string/app_name"
+                android:theme="@android:style/Theme.NoTitleBar">
+
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+
+            <!-- Receives the search request. -->
+            <intent-filter>
+                <action android:name="android.intent.action.SEARCH" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+
+            <!-- Points to searchable meta data. -->
+            <meta-data android:name="android.app.searchable"
+                    android:resource="@xml/searchable"/>
+        </activity>
+
+        <!-- Displays the definition of a word. -->
+        <activity android:name=".WordActivity"
+                android:theme="@android:style/Theme.NoTitleBar"/>
+
+        <!-- Provides search suggestions for words and their definitions. -->
+        <provider android:name="DictionaryProvider"
+                android:authorities="dictionary"
+                android:syncable="false" />
+
+    </application>
+</manifest>
diff --git a/samples/SearchableDictionary/res/drawable/ic_dictionary.gif b/samples/SearchableDictionary/res/drawable/ic_dictionary.gif
new file mode 100644
index 0000000..47cdfc2
--- /dev/null
+++ b/samples/SearchableDictionary/res/drawable/ic_dictionary.gif
Binary files differ
diff --git a/samples/SearchableDictionary/res/layout/main.xml b/samples/SearchableDictionary/res/layout/main.xml
new file mode 100644
index 0000000..d0dd522
--- /dev/null
+++ b/samples/SearchableDictionary/res/layout/main.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:orientation="vertical"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+    <TextView
+            android:id="@+id/textField"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/search_instructions"/>
+
+    <ListView
+            android:id="@+id/list"
+            android:layout_width="fill_parent"
+            android:layout_height="0dip"
+            android:layout_weight="1"/>
+</LinearLayout>
+
+
diff --git a/samples/SearchableDictionary/res/layout/word.xml b/samples/SearchableDictionary/res/layout/word.xml
new file mode 100644
index 0000000..ba1a3da
--- /dev/null
+++ b/samples/SearchableDictionary/res/layout/word.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:orientation="vertical"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+    <TextView
+            android:id="@+id/word"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+            android:textSize="30sp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/search_instructions"
+            android:layout_marginLeft="10dip"
+            android:layout_marginTop="5dip" />
+    <TextView
+            android:id="@+id/definition"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/search_instructions"
+            android:layout_marginLeft="10dip" />
+</LinearLayout>
diff --git a/samples/SearchableDictionary/res/raw/definitions.txt b/samples/SearchableDictionary/res/raw/definitions.txt
new file mode 100644
index 0000000..e4e1cbd
--- /dev/null
+++ b/samples/SearchableDictionary/res/raw/definitions.txt
@@ -0,0 +1,997 @@
+abbey - n. a monastery ruled by an abbot
+abide - v. dwell; inhabit or live in
+abound - v. be abundant or plentiful; exist in large quantities
+absence - n. the state of being absent
+absorb - v. assimilate or take in
+abstinence - n. practice of refraining from indulging an appetite especially alcohol
+absurd - j. inconsistent with reason or logic or common sense
+abundant - j. present in great quantity
+abusive - j. characterized by physical or psychological maltreatment
+academic - j. associated with school or learning
+academy - n. a school for special training
+accept - v. consider or hold as true
+access - v. reach or gain access to
+accessible - j. easily obtained
+acclaim - n. enthusiastic approval
+accommodate - v. provide with something desired or needed
+accompany - v. go or travel along with
+accomplish - v. to gain with effort
+account - v. furnish a justifying analysis or explanation
+accurate - j. conforming exactly or almost exactly to fact or to a standard or performing with total accuracy
+accusation - n. an assertion that someone is guilty of a fault or offence
+accuse - v. blame for, make a claim of wrongdoing or misbehavior against
+acid - j. biting, sarcastic, or scornful
+acknowledge - v. declare to be true or admit the existence or reality or truth of
+acquire - v. come into the possession of something concrete or abstract
+acquisition - n. something acquired or received
+adamant - j. impervious to pleas, persuasion, requests, reason
+adjacent - j. having a common boundary or edge; abutting; touching
+administrator - n. someone who manages a government agency or department
+advent - n. arrival that has been awaited (especially of something momentous)
+adverse - j. contrary to your interests or welfare
+advisory - n. an announcement that usually advises or warns the public of some threat
+advocacy - n. active support of an idea or cause etc.; especially the act of pleading or arguing for something
+advocate - v. speak, plead, or argue in favor of
+affect - n. the conscious subjective aspect of feeling or emotion
+affirmative - j. affirming or giving assent
+aggression - n. violent action that is hostile and usually unprovoked
+airy - j. not practical or realizable; speculative
+album - n. a book of blank pages with pockets or envelopes; for organizing photographs or stamp collections etc
+alcohol - n. a liquor or brew containing alcohol as the active agent
+alien - j. being or from or characteristic of another place or part of the world
+allegiance - n. the loyalty that citizens owe to their country (or subjects to their sovereign)
+alley - n. a narrow street with walls on both sides
+alliance - n. a formal agreement establishing an association or alliance between nations or other groups to achieve a particular aim
+ally - n. an associate who provides cooperation or assistance
+altar - n. a raised structure on which gifts or sacrifices to a god are made
+alter - v. cause to change; make different; cause a transformation
+alternate - j. serving or used in place of another
+alternative - j. serving or used in place of another
+altitude - n. elevation especially above sea level or above the earth's surface
+amateur - j. lacking professional skill or expertise
+ambiguous - j. having more than one possible meaning
+ambitious - j. having a strong desire for success or achievement
+ambivalent - j. uncertain or unable to decide about what course to follow
+analogy - n. drawing a comparison in order to show a similarity in some respect
+analyst - n. someone who is skilled at analyzing data
+analyze - v. break down into components or essential features
+anchor - v. fix firmly and stably
+annual - j. occurring or payable every year
+anonymous - j. having no known name or identity or known source
+antichrist - n. the adversary of Christ (or Christianity) mentioned in the New Testament
+antique - j. made in or typical of earlier times and valued for its age
+anxious - j. causing or fraught with or showing anxiety
+apartheid - n. a social policy or racial segregation involving political and economic and legal discrimination against people who are not Whites
+apocalyptic - j. prophetic of devastation or ultimate doom
+apology - n. an expression of regret at having caused trouble for someone
+apparel - n. clothing in general
+apparent - j. clearly revealed to the mind or the senses or judgment
+appease - v. make peace with
+appropriate - j. suitable for a particular person or place or condition etc
+apt - j. being of striking appropriateness and pertinence
+arbitrary - j. based on or subject to individual discretion or preference or sometimes impulse or caprice
+arcade - n. a covered passageway with shops and stalls on either side
+arrange - v. put into a proper or systematic order
+arrangement - n. an orderly grouping (of things or persons) considered as a unit; the result of arranging
+arrival - n. the act of arriving at a certain place
+arrogance - n. overbearing pride evidenced by a superior manner toward inferiors
+arrogant - j. having or showing feelings of unwarranted importance out of overbearing pride
+articulate - j. expressing yourself easily or characterized by clear expressive language
+assassination - n. murder of a public figure by surprise attack
+assess - v. set or determine the amount of (a payment such as a fine)
+assets - n. anything of material value or usefulness that is owned by a person or company
+asylum - n. a shelter from danger or hardship
+auburn - j. (of hair) colored a moderate reddish-brown
+august - j. profoundly honored
+aura - n. a distinctive but intangible quality surrounding a person or thing
+austere - j. of a stern or strict bearing or demeanor; forbidding in aspect
+authentic - j. not counterfeit or copied
+authenticity - n. undisputed credibility
+authoritarian - n. a person who behaves in a tyrannical manner
+autobiography - n. a biography of yourself
+autonomous - j. existing as an independent entity
+autonomy - n. immunity from arbitrary exercise of authority: political independence
+avid - j. marked by active interest and enthusiasm
+banal - j. repeated too often; over familiar through overuse
+barring - n. the act of excluding someone by a negative vote or veto
+bass - n. the lowest adult male singing voice
+batter - n. a liquid or semiliquid mixture, as of flour, eggs, and milk, used in cooking
+belle - n. a young woman who is the most charming and beautiful of several rivals
+beneficial - j. promoting or enhancing well-being
+benefit - n. something that aids or promotes well-being
+benign - j. not dangerous to health; not recurrent or progressive (especially of a tumor)
+bid - n. a formal proposal to buy at a specified price
+biography - n. an account of the series of events making up a person's life
+biology - n. the science that studies living organisms
+blaze - n. a strong flame that burns brightly
+bleak - j. unpleasantly cold and damp
+bogus - j. fraudulent; having a misleading appearance
+bolster - v. support and strengthen
+bomb - n. an explosive device fused to explode under specific conditions
+bore - n. a person who evokes boredom
+botanical - j. of or relating to plants or botany
+boycott - n. a group's refusal to have commercial dealings with some organization in protest against its policies
+brass - n. an alloy of copper and zinc
+breach - n. an opening (especially a gap in a dike or fortification)
+broadcast - n. message that is transmitted by radio or television
+brokerage - n. the business of a broker; charges a fee to arrange a contract between two parties
+buffet - n. a meal set out on a buffet at which guests help themselves
+bumper - n. a mechanical device consisting of bars at either end of a vehicle to absorb shock and prevent serious damage
+bureau - n. an administrative unit of government
+bureaucracy - n. non elected government officials
+butt - v. to strike, thrust or shove against
+cabinet - n. persons appointed by a head of state to head executive departments of government and act as official advisers
+caliber - n. a degree or grade of excellence or worth
+campaign - n. a series of actions advancing a principle or tending toward a particular end
+canon - n. a rule or especially body of rules or principles generally established as valid and fundamental in a field or art or philosophy
+cardinal - j. serving as an essential component
+caricature - n. a representation of a person that is exaggerated for comic effect
+casual - j. without or seeming to be without plan or method; offhand
+catastrophe - n. an event resulting in great loss and misfortune
+caucus - n. a closed political meeting
+causal - j. involving or constituting a cause; causing
+censure - n. harsh criticism or disapproval
+census - n. a periodic count of the population
+cereal - n. grass whose starchy grains are used as food: wheat; rice; rye; oats; maize; buckwheat; millet
+ceremonial - j. marked by pomp or ceremony or formality
+chaos - n. a state of extreme confusion and disorder
+characteristic - n. a distinguishing quality
+chronic - j. being long-lasting and recurrent or characterized by long suffering
+citadel - n. a stronghold into which people could go for shelter during a battle
+cite - v. refer to for illustration or proof
+clumsy - j. not elegant or graceful in expression
+coalition - n. an organization of people (or countries) involved in a pact or treaty
+coherent - j. marked by an orderly, logical, and aesthetically consistent relation of parts
+coincidence - n. the temporal property of two things happening at the same time
+collapse - v. break down, literally or metaphorically
+colleague - n. an associate that one works with
+collective - j. set up on the principle of collectivism or ownership and production by the workers involved usually under the supervision of a government
+collector - n. a person who collects things
+collision - n. an accident resulting from violent impact of a moving object
+commemorate - v. mark by some ceremony or observation
+commentary - n. a written explanation or criticism or illustration that is added to a book or other textual material
+commission - n. a special group delegated to consider some matter
+commitment - n. the act of binding yourself (intellectually or emotionally) to a course of action
+commodity - n. articles of commerce
+commute - n. a regular journey of some distance to and from your place of work
+comparable - j. able to be compared or worthy of comparison
+comparison - n. the act of examining resemblances
+compassionate - j. showing or having compassion
+compensate - v. make payment to; compensate
+competence - n. the quality of being adequately or well qualified physically and intellectually
+competent - j. properly or sufficiently qualified or capable or efficient
+competitive - j. involving competition or competitiveness
+competitor - n. the contestant you hope to defeat
+complex - j. complicated in structure; consisting of interconnected parts
+component - n. an artifact that is one of the individual parts of which a composite entity is made up; especially a part that can be separated from or attached to a system
+composer - n. someone who composes music as a profession
+comprehensive - j. broad in scope
+concede - v. admit (to a wrongdoing)
+conceive - v. have the idea for
+concession - n. a point conceded or yielded
+confederate - j. united in a group or league
+confidence - n. a state of confident hopefulness that events will be favorable
+confident - j. having or marked by confidence or assurance
+confront - v. oppose, as in hostility or a competition
+conscience - n. a feeling of shame when you do something immoral
+conscious - j. knowing and perceiving; having awareness of surroundings and sensations and thoughts
+consecutive - j. one after the other
+consensus - n. agreement in the judgment or opinion reached by a group as a whole
+conservatism - n. a political or theological orientation advocating the preservation of the best in society and opposing radical changes
+conservative - j. avoiding excess
+consistency - n. a harmonious uniformity or agreement among things or parts
+conspicuous - j. obvious to the eye or mind
+conspiracy - n. a plot to carry out some harmful or illegal act (especially a political plot)
+constituency - n. the body of voters who elect a representative for their area
+consume - v. use up (resources or materials)
+consumer - n. a person who uses goods or services
+consumption - n. the process of taking food into the body through the mouth
+contemplate - v. look at thoughtfully; observe deep in thought
+contemporary - j. belonging to the present time
+contender - n. the contestant you hope to defeat
+contentious - j. inclined or showing an inclination to dispute or disagree, even to engage in law suits
+contingent - j. possible but not certain to occur
+continuous - j. continuing in time or space without interruption
+contradiction - n. opposition between two conflicting forces or ideas
+contradictory - j. unable for both to be true at the same time
+contribution - n. a voluntary gift (as of money or service or ideas) made to some worthwhile cause
+contributor - n. someone who contributes (or promises to contribute) a sum of money
+convenience - n. the quality of being useful and convenient
+conversion - n. the act of changing from one use or function or purpose to another
+convertible - j. designed to be changed from one use or form to another
+conviction - n. an unshakable belief in something without need for proof or evidence
+corporate - j. of or belonging to a corporation
+corps - n. a body of people associated together
+corruption - n. destroying someone's (or some group's) honesty or loyalty; undermining moral integrity
+cosmetic - j. serving an esthetic rather than a useful purpose
+cosmopolitan - j. of worldwide scope or applicability
+counsel - n. something that provides direction or advice as to a decision or course of action
+counterpart - n. a person or thing having the same function or characteristics as another
+courageous - j. able to face and deal with danger or fear without flinching
+course - n. a connected series of events or actions or developments
+courtesy - n. a courteous or respectful or considerate act
+credible - j. appearing to merit belief or acceptance
+critique - n. a serious examination and judgment of something
+crusade - v. exert oneself continuously, vigorously, or obtrusively to gain an end or engage in a crusade for a certain cause or person; be an advocate for
+crush - v. to compress with violence, out of natural shape or condition
+curator - n. the custodian of a collection (as a museum or library)
+curriculum - n. an integrated course of academic studies
+cynical - j. believing the worst of human nature and motives; having a sneering disbelief in e.g. selflessness of others
+cynicism - n. a cynical feeling of distrust
+daring - n. the trait of being willing to undertake things that involve risk or danger
+debacle - n. a sudden and violent collapse
+debut - v. appear for the first time in public
+decay - n. the organic phenomenon of rotting
+decency - n. the quality of conforming to standards of propriety and morality
+decent - j. socially or conventionally correct; refined or virtuous
+decisive - j. characterized by decision and firmness
+decree - n. a legally binding command or decision entered on the court record (as if issued by a court or judge)
+dedication - n. complete and wholehearted fidelity
+default - n. loss due to not showing up
+defendant - n. a person or institution against whom an action is brought in a court of law; the person being sued or accused
+defensive - j. attempting to justify or defend in speech or writing
+defiance - n. a hostile challenge
+definite - j. known for certain
+delicacy - n. something considered choice to eat
+demise - v. transfer by a lease or by a will
+demonstrate - v. establish the validity of something, as by an example, explanation or experiment
+denominator - n. the divisor of a fraction
+deposition - n. (law) a pretrial interrogation of a witness; usually conducted in a lawyer's office
+depression - n. a long-term economic state characterized by unemployment and low prices and low levels of trade and investment
+depth - n. the attribute or quality of being deep, strong, or intense
+derive - v. come from
+descent - n. properties attributable to your ancestry
+desert - n. arid land with little or no vegetation
+designate - v. give an assignment to (a person) to a post, or assign a task to (a person)
+despair - n. a state in which all hope is lost or absent
+desperate - j. showing extreme urgency or intensity especially because of great need or desire
+detect - v. discover or determine the existence, presence, or fact of
+deter - v. try to prevent; show opposition to
+determination - n. the quality of being determined to do or achieve something; firmness of purpose
+deterrent - j. tending to deter
+diagnosis - n. identifying the nature or cause of some phenomenon
+dialogue - n. a discussion intended to produce an agreement
+difference - n. the quality of being unlike or dissimilar
+dignity - n. the quality of being worthy of esteem or respect
+dilemma - n. state of uncertainty or perplexity especially as requiring a choice between equally unfavorable options
+diplomacy - n. subtly skillful handling of a situation
+diplomat - n. a person who deals tactfully with others
+diplomatic - j. using or marked by tact in dealing with sensitive matters or people
+disagree - v. be of different opinions
+disappear - v. become invisible or unnoticeable
+discern - v. detect with the senses
+discipline - n. a system of rules of conduct or method of practice
+discomfort - n. the state of being tense and feeling pain
+discourse - n. extended verbal expression in speech or writing
+discover - v. see for the first time; make a discovery
+discriminate - v. treat differently on the basis of sex or race
+discussion - n. an exchange of views on some topic
+disdain - n. lack of respect accompanied by a feeling of intense dislike
+dishonest - j. deceptive or fraudulent; disposed to cheat or defraud or deceive
+dismal - j. causing dejection
+dismay - v. fill with apprehension or alarm; cause to be unpleasantly surprised
+dismissal - n. the termination of someone's employment (leaving them free to depart)
+disparity - n. inequality or difference in some respect
+disregard - n. willful lack of care and attention
+dissent - n. a difference of opinion
+distant - j. separated in space or coming from or going to a distance
+distinction - n. a distinguishing difference
+distress - n. extreme physical pain
+distrust - v. regard as untrustworthy; regard with suspicion; have no faith or confidence in
+diverse - j. many and different
+diversion - n. an activity that diverts or amuses or stimulates
+diversity - n. noticeable heterogeneity
+divert - v. turn aside; turn away from
+document - n. writing that provides information (especially information of an official nature)
+doe - n. mature female of mammals of which the male is called 'buck'
+domain - n. territory over which rule or control is exercised
+dominance - n. the state that exists when one person or group has power over another
+dominant - j. exercising influence or control
+dominate - v. be in control
+domination - n. social control by dominating
+donate - v. give to a charity or good cause
+donor - n. person who makes a gift of property
+drastic - j. forceful and extreme and rigorous
+drought - n. a shortage of rainfall
+dubious - j. open to doubt or suspicion
+dynamics - n. the branch of mechanics concerned with the forces that cause motions of bodies
+earnest - j. characterized by a firm and humorless belief in the validity of your opinions
+eccentric - n. a person with an unusual or odd personality
+eclectic - j. selecting what seems best of various styles or ideas
+editorial - n. an article giving opinions or perspectives
+effect - n. a phenomenon that follows and is caused by some previous phenomenon
+effective - j. works well as a means or remedy
+efficiency - n. skillfulness in avoiding wasted time and effort
+efficient - j. able to accomplish a purpose; functioning effectively
+elaborate - v. add details, as to an account or idea; clarify the meaning of and discourse in a learned way, usually in writing
+element - n. any of the more than 100 known substances (of which 92 occur naturally) that cannot be separated into simpler substances and that singly or in combination constitute all matter
+eligible - j. qualified for or allowed or worthy of being chosen
+eliminate - v. terminate, end, or take out
+embargo - n. a government order imposing a trade barrier
+emblem - n. a visible symbol representing an abstract idea
+embrace - n. the act of clasping another person in the arms (as in greeting or affection)
+emerge - v. come out into view, as from concealment
+emergence - n. the gradual beginning or coming forth
+eminent - j. of imposing height; especially standing out above others
+emphasis - n. intensity or forcefulness of expression
+emphasize - v. to stress, single out as important
+employee - n. a worker who is hired to perform a job
+employer - n. a person or firm that employs workers
+emulate - v. imitate the function of (another system), as by modifying the hardware or the software
+enact - v. order by virtue of superior authority; decree
+encourage - v. inspire with confidence; give hope or courage to
+encyclopedia - n. a reference work (often in several volumes) containing articles on various topics
+endorse - v. be behind; approve of
+enduring - j. patiently bearing continual wrongs or trouble
+energetic - j. possessing or exerting or displaying energy
+enhance - v. make better or more attractive
+enormous - j. extraordinarily large in size or extent or amount or power or degree
+enthusiastic - j. having or showing great excitement and interest
+entity - n. that which is perceived or known or inferred to have its own distinct existence (living or nonliving)
+epic - j. very imposing or impressive; surpassing the ordinary (especially in size or scale)
+epidemic - n. a widespread outbreak of an infectious disease; many people are infected at the same time
+episode - n. a brief section of a literary or dramatic work that forms part of a connected series
+equilibrium - n. a stable situation in which forces cancel one another
+equity - n. the difference between the market value of a property and the claims held against it
+equivalent - j. being essentially equal to something
+error - n. a wrong action attributable to bad judgment or ignorance or inattention
+esquire - n. a title of respect for a member of the English gentry ranking just below a knight; placed after the name
+essence - n. the central meaning or theme of a speech or literary work
+evangelical - j. relating to or being a Christian church believing in personal conversion and the inerrancy of the Bible especially the 4 Gospels
+evoke - v. call to mind
+evolution - n. a process in which something passes by degrees to a different stage (especially a more advanced or mature stage)
+exceed - v. be greater in scope or size than some standard
+excellent - j. very good; of the highest quality
+excerpt - n. a passage selected from a larger work
+excess - j. more than is needed, desired, or required
+exclude - v. prevent from being included or considered or accepted
+excursion - n. a journey taken for pleasure
+exempt - v. grant relief or an exemption from a rule or requirement to
+existence - n. everything that exists anywhere
+exit - v. move out of or depart from
+exotic - j. strikingly strange or unusual
+expand - v. become larger in size or volume or quantity
+expansion - n. the act of increasing (something) in size or volume or quantity or scope
+expect - v. regard something as probable or likely
+expectancy - n. something expected (as on the basis of a norm)
+expense - n. money spent to perform work and usually reimbursed by an employer
+expertise - n. skillfulness by virtue of possessing special knowledge
+explicit - j. precisely and clearly expressed or readily observable; leaving nothing to implication
+explode - v. drive from the stage by noisy disapproval
+exploit - v. use or manipulate to one's advantage
+explosion - n. the act of exploding or bursting
+explosive - n. a chemical substance that undergoes a rapid chemical change (with the production of gas) on being heated or struck
+exposure - n. vulnerability to the elements; to the action of heat or cold or wind or rain
+expressive - j. characterized by expression
+extension - n. an addition to the length of something
+extensive - j. large in spatial extent or range or scope or quantity
+exterior - n. the outer side or surface of something
+external - j. happening or arising or located outside or beyond some limits or especially surface
+extradition - n. the surrender of an accused or convicted person by one state or country to another (usually under the provisions of a statute or treaty)
+extraordinary - j. beyond what is ordinary or usual; highly unusual or exceptional or remarkable
+extravagant - j. unrestrained, especially with regard to feelings
+exuberant - j. joyously unrestrained
+fabulous - j. extremely pleasing
+facial - j. of or concerning the face
+facility - n. something designed and created to serve a particular function and to afford a particular convenience or service
+faction - n. a dissenting clique
+faulty - j. characterized by errors; not agreeing with a model or not following established rules
+feasible - j. capable of being done with means at hand and circumstances as they are
+felony - n. a serious crime (such as murder or arson)
+feminine - j. associated with women and not with men
+fervor - n. the state of being emotionally aroused and worked up
+fetus - n. an unborn or unhatched vertebrate in the later stages of development showing the main recognizable features of the mature animal
+feud - n. a bitter quarrel between two parties
+feudal - j. of or relating to or characteristic of feudalism
+fidelity - n. the quality of being faithful
+finale - n. the concluding part of any performance
+finite - j. bounded or limited in magnitude or spatial or temporal extent
+fiscal - j. involving financial matters
+flag - n. emblem usually consisting of a rectangular piece of cloth of distinctive design
+flamboyant - j. marked by ostentation but often tasteless
+fleet - n. a group of warships organized as a tactical unit
+flexible - j. able to flex; able to bend easily
+flop - n. a complete failure
+flourish - n. a showy gesture
+foil - n. anything that serves by contrast to call attention to another thing's good qualities
+ford - v. cross a river where it's shallow
+forecast - n. a prediction about how something (as the weather) will develop
+foreign - j. relating to or originating in or characteristic of another place or part of the world
+foresee - v. act in advance of; deal with ahead of time
+formation - n. an arrangement of people or things acting as a unit
+formidable - j. extremely impressive in strength or excellence
+formula - n. directions for making something
+forte - n. an asset of special worth or utility
+forth - a. forward in time or order or degree
+foster - v. promote the growth of
+fragile - j. easily broken or damaged or destroyed
+frantic - j. excessively agitated; distraught with fear or other violent emotion
+fray - v. wear away by rubbing
+frequency - n. the number of occurrences within a given time period
+fringe - n. a social group holding marginal or extreme views
+frivolous - j. not serious in content or attitude or behavior
+frontier - n. a wilderness at the edge of a settled area of a country
+fundamental - j. being or involving basic facts or principles
+further - v. promote the growth of
+futile - j. producing no result or effect
+galaxy - n. (astronomy) a collection of star systems; any of the billions of systems each having many stars and nebulae and dust
+gamble - v. take a risk in the hope of a favorable outcome
+gauge - n. a measuring instrument for measuring and indicating a quantity such as the thickness of wire or the amount of rain etc.
+generate - v. bring into existence
+generic - j. applicable to an entire class or group
+generosity - n. the trait of being willing to give your money or time
+genesis - n. the first book of the Old Testament: tells of Creation; Adam and Eve; Cain and Abel
+gesture - n. motion of hands or body to emphasize or help to express a thought or feeling
+gigantic - j. so exceedingly large or extensive as to suggest a giant or mammoth
+gist - n. the choicest or most essential or most vital part of some idea or experience
+glimpse - n. a brief or incomplete view
+glorious - j. having great beauty and splendor
+grandeur - n. the quality of being magnificent or splendid or grand
+grandiose - j. impressive because of unnecessary largeness or grandeur; used to show disapproval
+grave - j. of great gravity or crucial import; requiring serious thought
+gravity - n. a manner that is serious and solemn
+grief - n. something that causes great unhappiness
+grotesque - j. distorted and unnatural in shape or size; abnormal and hideous
+grove - n. a small growth of trees without underbrush
+guise - n. an artful or simulated semblance
+hack - n. a mediocre and disdained writer
+hale - j. exhibiting or restored to vigorous good health
+handwriting - n. something written by hand
+harbor - v. hold back a thought or feeling about
+hazard - n. a source of danger; a possibility of incurring loss or misfortune
+heir - n. a person who is entitled by law or by the terms of a will to inherit the estate of another
+heritage - n. practices that are handed down from the past by tradition
+hilarious - j. marked by or causing boisterous merriment or convulsive laughter
+hollow - j. not solid; having a space or gap or cavity
+homage - n. respectful deference
+hostility - n. violent action that is hostile and usually unprovoked
+humane - j. marked or motivated by concern with the alleviation of suffering
+humanitarian - n. someone devoted to the promotion of human welfare and to social reforms
+hush - v. become quiet or still; fall silent
+hybrid - n. (genetics) an organism that is the offspring of genetically dissimilar parents or stock; especially offspring produced by breeding plants or animals of different varieties or breeds or species
+hypocrisy - n. insincerity by virtue of pretending to have qualities or beliefs that you do not really have
+hypothesis - n. a tentative insight into the natural world; a concept that is not yet verified but that if true would explain certain facts or phenomena
+hysteria - n. excessive or uncontrollable fear
+icon - n. a conventional religious painting in oil on a small wooden panel; venerated in the Eastern Church
+ideology - n. an orientation that characterizes the thinking of a group or nation
+illusion - n. an erroneous mental representation
+imaginary - j. not based on fact; unreal
+imitation - n. something copied or derived from an original
+immense - j. unusually great in size or amount or degree or especially extent or scope
+immigrant - n. a person who comes to a country where they were not born in order to settle there
+imminent - j. close in time; about to occur
+immoral - j. not adhering to ethical or moral principles
+immune - j. (usually followed by 'to') not affected by a given influence
+impending - j. close in time; about to occur
+implausible - j. having a quality that provokes disbelief
+implicit - j. implied though not directly expressed; inherent in the nature of something
+imply - v. express or state indirectly
+impose - v. compel to behave in a certain way
+improper - j. not suitable or right or appropriate
+impulse - n. a sudden desire
+inadequate - j. not sufficient to meet a need
+incentive - n. a positive motivational influence
+incidence - n. the relative frequency of occurrence of something
+incident - n. a public disturbance
+incidentally - a. of a minor or subordinate nature
+inclined - j. at an angle to the horizontal or vertical position
+incompetence - n. lack of physical or intellectual ability or qualifications
+inconsistent - j. displaying a lack of consistency
+inconvenient - j. not suited to your comfort, purpose or needs
+indefinitely - a. to an indefinite extent; for an indefinite time
+indicator - n. a device for showing the operating condition of some system
+indifferent - j. showing no care or concern in attitude or action
+indigenous - j. originating where it is found
+indulge - v. enjoy to excess
+inefficient - j. not producing desired results; wasteful
+inept - j. generally incompetent and ineffectual
+inevitable - j. incapable of being avoided or prevented
+inexpensive - j. relatively low in price or charging low prices
+infamous - j. known widely and usually unfavorably
+infinite - j. having no limits or boundaries in time or space or extent or magnitude
+influence - n. a power to affect persons or events especially power based on prestige etc
+influential - j. having or exercising influence or power
+influx - n. the process of flowing in
+ingenious - j. showing inventiveness and skill
+inherent - j. in the nature of something though not readily apparent
+injunction - n. (law) a judicial remedy issued in order to prohibit a party from doing or continuing to do a certain activity
+inland - a. towards or into the interior of a region
+insight - n. the clear (and often sudden) understanding of a complex situation
+insistence - n. the state of demanding notice or attention
+inspector - n. a high ranking police officer
+instance - n. an occurrence of something
+instant - n. a very short time
+insufficient - j. of a quantity not able to fulfill a need or requirement
+integral - j. essential to completeness; lacking nothing
+integrity - n. moral soundness
+intellectual - j. appealing to or using the intellect
+intelligence - n. the ability to comprehend; to understand and profit from experience
+intensive - j. characterized by a high degree or intensity; often used as a combining form
+intention - n. an act of intending; a volition that you intend to carry out
+interact - v. act together or towards others or with others
+interim - n. the time between one event, process, or period and another
+intermediate - j. lying between two extremes in time or space or state
+intervene - v. get involved, so as to alter or hinder an action, or through force or threat of force
+intervention - n. the act of intervening (as to mediate a dispute, etc.)
+intimacy - n. close or warm friendship
+intricate - j. having many complexly arranged elements; elaborate
+invasion - n. any entry into an area not previously occupied
+inventive - j. (used of persons or artifacts) marked by independence and creativity in thought or action
+investigator - n. a police officer who investigates crimes
+investor - n. someone who commits capital in order to gain financial returns
+invincible - j. incapable of being overcome or subdued
+invoke - v. cite as an authority; resort to
+involuntary - j. not subject to the control of the will
+involve - v. engage as a participant
+irony - n. incongruity between what might be expected and what actually occurs
+irrational - j. not consistent with or using reason
+irrelevant - j. having no bearing on or connection with the subject at issue
+irresistible - j. impossible to resist; overpowering
+irresponsible - j. showing lack of care for consequences
+judgment - n. the capacity to assess situations or circumstances shrewdly and to draw sound conclusions
+judicial - j. belonging or appropriate to the office of a judge
+juicy - j. lucrative
+junction - n. something that joins or connects
+jurisdiction - n. (law) the right and power to interpret and apply the law
+juror - n. someone who serves (or waits to be called to serve) on a jury
+justification - n. something (such as a fact or circumstance) that shows an action to be reasonable or necessary
+juvenile - j. of or relating to or characteristic of or appropriate for children or young people
+ken - n. range of what one can know or understand
+knight - n. originally a person of noble birth trained to arms and chivalry; today in Great Britain a person honored by the sovereign for personal merit
+knit - n. needlework created by interlacing yarn in a series of connected loops using straight eyeless needles or by machine
+lament - v. regret strongly
+landmark - n. the position of a prominent or well-known object in a particular landscape
+landscape - n. an expanse of scenery that can be seen in a single view
+lapse - n. a break or intermission in the occurrence of something
+laureate - n. someone honored for great achievements; figuratively someone crowned with a laurel wreath
+lavish - j. very generous
+lax - j. lacking in rigor or strictness
+legacy - n. (law) a gift of personal property by will
+legislative - j. relating to a legislature or composed of members of a legislature
+legitimacy - n. lawfulness by virtue of being authorized or in accordance with law
+legitimate - j. in accordance with recognized or accepted standards or principles
+leisure - n. time available for ease and relaxation
+lenient - j. not strict
+levy - v. impose and collect
+liable - j. held legally responsible
+liberalism - n. a political orientation that favors social progress by reform and by changing laws rather than by revolution
+lifelong - j. continuing through life
+lifetime - n. the period during which something is functional (as between birth and death)
+likelihood - n. the probability of a specified outcome
+liking - n. a feeling of pleasure and enjoyment
+liquor - n. an alcoholic beverage that is distilled rather than fermented
+literacy - n. the ability to read and write
+literal - j. avoiding embellishment or exaggeration (used for emphasis)
+literature - n. creative writing of recognized artistic value
+logic - n. the principles that guide reasoning within a given field or situation
+logical - j. capable of thinking and expressing yourself in a clear and consistent manner
+lovable - j. having characteristics that attract love or affection
+lucrative - j. producing a sizeable profit
+ludicrous - j. broadly or extravagantly humorous; resembling farce
+lying - n. the deliberate act of deviating from the truth
+machinery - n. machines or machine systems collectively
+magnet - n. (physics) a device that attracts iron and produces a magnetic field
+magnificent - j. characterized by grandeur
+magnitude - n. the property of relative size or extent (whether large or small)
+maintain - v. state or assert
+maintenance - n. activity involved in maintaining something in good working order
+makeup - n. the way in which someone or something is composed
+mandate - n. an authorization to act given to a representative
+mandatory - j. required by rule
+maneuver - v. act in order to achieve a certain goal
+manifesto - n. a public declaration of intentions (as issued by a political party or government)
+marine - j. native to or inhabiting the sea
+maritime - j. relating to or involving ships or shipping or navigation or seamen
+martial - j. suggesting war or military life
+marvel - v. be amazed at
+massacre - n. the savage and excessive killing of many people
+massive - j. imposing in size or bulk or solidity
+masterpiece - n. the most outstanding work of a creative artist or craftsman
+material - j. concerned with worldly rather than spiritual interests
+maternal - j. relating to or derived from one's mother
+maze - n. complex system of paths or tunnels in which it is easy to get lost
+mechanics - n. the technical aspects of doing something
+medicine - n. something that treats or prevents or alleviates the symptoms of disease
+medieval - j. as if belonging to the Middle Ages; old-fashioned and unenlightened
+mediocre - j. moderate to inferior in quality
+meditation - n. continuous and profound contemplation or musing on a subject or series of subjects of a deep or abstruse nature
+melodrama - n. an extravagant comedy in which action is more salient than characterization
+memorable - j. worth remembering
+menace - v. act in a threatening manner
+mentality - n. a habitual or characteristic mental attitude that determines how you will interpret and respond to situations
+mentor - v. serve as a teacher or trusted counselor
+metal - n. any of several chemical elements that are usually shiny solids
+metaphor - n. a figure of speech in which an expression is used to refer to something that it does not literally denote in order to suggest a similarity
+metric - j. based on the meter as a standard of measurement
+metropolis - n. a large and densely populated urban area; may include several independent administrative districts
+metropolitan - j. relating to or characteristic of a densely populated urban area
+mileage - n. the ratio of the number of miles traveled to the number of gallons of gasoline burned; miles per gallon
+militant - j. disposed to warfare or hard-line policies
+militia - n. civilians trained as soldiers but not part of the regular army
+miniature - j. being on a very small scale
+minimize - v. make small or insignificant
+ministry - n. a government department under the direction of a minister
+minority - n. being or relating to the smaller in number of two parts
+minute - j. infinitely or immeasurably small
+misdemeanor - n. a crime less serious than a felony
+missile - n. a rocket carrying a warhead of conventional or nuclear explosives
+momentum - n. an impelling force or strength
+monarchy - n. an autocracy governed by a monarch who usually inherits the authority
+monastery - n. the residence of a religious community
+monetary - j. relating to or involving money
+monopoly - n. (economics) a market in which there are many buyers but only one seller
+morale - n. the spirit of a group that makes the members want the group to succeed
+morality - n. concern with the distinction between good and evil or right and wrong; right or good conduct
+motto - n. a favorite saying of a sect or political group
+mundane - j. concerned with the world or worldly matters; ordinary
+municipal - j. relating to city government
+muster - v. gather or bring together
+myriad - n. a large indefinite number
+myth - n. a traditional story accepted as history; serves to explain the world view of a people
+mythology - n. myths collectively; the body of stories associated with a culture or institution or person
+narrative - n. a message that tells the particulars of an act or occurrence or course of events; presented in writing or drama or cinema or as a radio or television program
+narrator - n. someone who tells a story
+naturally - a. according to nature; by natural means; without artificial help
+naval - j. connected with or belonging to or used in a navy
+necessary - j. absolutely essential
+necessity - n. anything indispensable
+network - n. an interconnected system of things or people
+neutral - j. having no personal preference
+nevertheless - a. despite anything to the contrary (usually following a concession)
+noisy - j. full of or characterized by loud and nonmusical sounds
+nomination - n. the condition of having been proposed as a suitable candidate for appointment or election
+nominee - n. a politician who is running for public office
+norm - n. a standard or model or pattern regarded as typical
+notorious - j. known widely and usually unfavorably
+nude - n. without clothing (especially in the phrase 'in the nude')
+obesity - n. more than average fatness
+objective - j. undistorted by emotion or personal bias; based on observable phenomena
+observatory - n. a building designed and equipped to observe astronomical phenomena
+obsolete - j. no longer in use
+obstruction - n. something that stands in the way and must be circumvented or surmounted
+obtain - v. come into possession of
+occasion - n. a vaguely specified social event
+odor - n. the sensation that results when olfactory receptors in the nose are stimulated by particular chemicals in gaseous form
+ominous - j. threatening or foreshadowing evil or tragic developments
+operate - v. handle and cause to function
+operator - n. an agent that operates some apparatus or machine
+opinion - n. a personal belief or judgment that is not founded on proof or certainty
+opponent - n. a contestant that you are matched against
+opportunity - n. a possibility due to a favorable combination of circumstances
+optimism - n. a general disposition to expect the best in all things
+option - n. one of a number of things from which only one can be chosen
+oral - j. of or relating to or affecting or for use in the mouth
+ordeal - n. a severe or trying experience
+ornate - j. marked by elaborate rhetoric and elaborated with decorative details
+orthodox - j. adhering to what is commonly accepted
+outbreak - n. a sudden violent spontaneous occurrence (usually of some undesirable condition)
+outcry - n. a loud utterance; often in protest or opposition
+outrage - n. a feeling of righteous anger
+outrageous - j. grossly offensive to decency or morality; causing horror
+outright - a. without reservation or concealment
+overhaul - v. make repairs, renovations, revisions or adjustments to
+oversee - v. watch and direct
+overthrow - n. the termination of a ruler or institution (especially by force)
+overweight - n. the property of excessive fatness
+pact - n. a written agreement between two states or sovereigns
+pageant - n. a rich and spectacular ceremony
+panic - n. an overwhelming feeling of fear and anxiety
+pantheon - n. all the gods of a religion
+paradox - n. (logic) a statement that contradicts itself
+parallel - j. being everywhere equidistant and not intersecting
+parish - n. a local church community
+parliament - n. a legislative assembly in certain countries
+parody - v. make a spoof of or make fun of
+participant - n. someone who takes part in an activity
+participate - v. become a participant; be involved in
+partisan - n. an ardent and enthusiastic supporter of some person or activity
+partition - v. divide into parts, pieces, or sections
+passive - j. lacking in energy or will
+patriotism - n. love of country and willingness to sacrifice for it
+patron - n. someone who supports or champions something
+pavilion - n. large and often sumptuous tent
+peaceful - j. not disturbed by strife or turmoil or war
+pedestrian - j. lacking wit or imagination
+penalty - n. a punishment for a crime or offense
+penchant - n. a strong liking
+pennant - n. a long flag; often tapering
+pension - n. a regular payment to a person that is intended to allow them to subsist without working
+pentagon - n. a five-sided polygon
+perceive - v. to become aware of or conscious of
+perception - n. becoming aware of something via the senses
+perennial - j. lasting an indefinitely long time; suggesting self-renewal
+perform - v. carry out or perform an action
+perjury - n. criminal offense of making false statements under oath
+permanent - j. continuing or enduring without marked change in status or condition or place
+perpetual - j. continuing forever or indefinitely
+persist - v. be persistent, refuse to stop
+personal - j. concerning or affecting a particular person or his or her private life and personality
+personality - n. the complex of all the attributes--behavioral, temperamental, emotional and mental--that characterize a unique individual
+personnel - n. persons collectively in the employ of a business
+perspective - n. the appearance of things relative to one another as determined by their distance from the viewer
+persuade - v. cause somebody to adopt a certain position, belief, or course of action; twist somebody's arm
+pervasive - j. spreading or spread throughout
+petty - j. contemptibly narrow in outlook
+phenomenal - j. exceedingly or unbelievably great
+phenomenon - n. any state or process known through the senses rather than by intuition or reasoning
+philharmonic - j. composing or characteristic of an orchestral group
+philosophy - n. any personal belief about how to live or how to deal with a situation
+physicist - n. a scientist trained in physics
+physics - n. the science of matter and energy and their interactions
+pinch - n. a squeeze with the fingers
+pine - n. straight-grained white to yellowish tree
+pioneer - v. open up and explore a new area
+pivotal - j. being of crucial importance
+plausible - j. apparently reasonable and valid, and truthful
+playful - j. full of fun and high spirits
+playwright - n. someone who writes plays
+plea - n. a humble request for help from someone in authority
+plead - v. appeal or request earnestly
+pleasant - j. affording pleasure; being in harmony with your taste or likings
+plunge - v. fall abruptly
+poetic - j. of or relating to poetry
+poignant - j. arousing emotions; touching
+poised - j. in full control of your faculties
+portfolio - n. a set of pieces of creative work collected to be shown to potential customers or employers
+positive - j. characterized by or displaying affirmation or acceptance or certainty etc.
+possess - v. have as an attribute, knowledge, or skill
+possession - n. the act of having and controlling property
+potent - j. having a strong physiological or chemical effect
+potential - j. existing in possibility
+precedent - n. an example that is used to justify similar occurrences at a later time
+precise - j. sharply exact or accurate or delimited
+precision - n. the quality of being reproducible in amount or performance
+predecessor - n. one who precedes you in time (as in holding a position or office)
+predict - v. make a prediction about; tell in advance
+prediction - n. a statement made about the future
+prefer - v. like better; value more highly
+preference - n. a strong liking
+prejudice - n. a partiality that prevents objective consideration of an issue or situation
+premature - j. too soon or too hasty
+premier - v. be performed for the first time
+premise - v. set forth beforehand, often as an explanation
+preparation - n. the activity of putting or setting in order in advance of some act or purpose
+preposterous - j. incongruous; inviting ridicule
+prescription - n. written instructions from a physician or dentist to a druggist concerning the form and dosage of a drug to be issued to a given patient
+preservation - n. the activity of protecting something from loss or danger
+pretentious - j. making claim to or creating an appearance of (often undeserved) importance or distinction
+prevalent - j. most frequent or common
+prevention - n. the act of preventing
+primer - n. an introductory textbook
+primitive - j. belonging to an early stage of technical development; characterized by simplicity and (often) crudeness
+principal - n. the educator who has executive authority for a school
+principle - n. a basic truth or law or assumption
+principled - j. based on or manifesting objectively defined standards of rightness or morality
+pristine - j. completely free from dirt or contamination
+privilege - n. a special advantage or immunity or benefit not enjoyed by all
+probation - n. (law) a way of dealing with offenders without imprisoning them; a defendant found guilty of a crime is released by the court without imprisonment subject to conditions imposed by the court
+probe - v. question or examine thoroughly and closely
+procedure - n. a process or series of acts especially of a practical or mechanical nature involved in a particular form of work
+proceed - v. move ahead; travel onward in time or space
+productive - j. producing or capable of producing (especially abundantly)
+profession - n. an occupation requiring special education (especially in the liberal arts or sciences)
+professor - n. someone who is a member of the faculty at a college or university
+profile - n. an outline of something (especially a human face as seen from one side)
+progressive - j. favoring or promoting progress
+prohibition - n. the action of prohibiting or inhibiting or forbidding (or an instance thereof)
+prolific - j. bearing in abundance especially offspring
+promenade - n. a public area set aside as a pedestrian walk
+prominence - n. relative importance
+prominent - j. having a quality that thrusts itself into attention
+promoter - n. someone who is an active supporter and advocate
+prone - j. having a tendency (to); often used in combination
+propaganda - n. information that is spread for the purpose of promoting some cause
+prophet - n. someone who speaks by divine inspiration; someone who is an interpreter of the will of God
+protagonist - n. the principal character in a work of fiction
+protection - n. the activity of protecting someone or something
+protective - j. intended or adapted to afford protection of some kind
+protestant - j. of or relating to Protestants or Protestantism
+provincial - j. characteristic of the provinces or their people
+provoke - v. evoke or provoke to appear or occur
+proxy - n. a person authorized to act for another
+prudence - n. knowing how to avoid embarrassment or distress
+psychic - j. outside the sphere of physical science
+pundit - n. someone who has been admitted to membership in a scholarly field
+quake - v. shake with fast, tremulous movements
+qualify - v. make fit or prepared
+quarterly - a. in three month intervals
+radical - j. markedly new or introducing extreme change
+rampant - j. unrestrained and violent
+rapid - j. characterized by speed; moving with or capable of moving with high speed
+rave - v. praise enthusiastically
+reaction - n. a response that reveals a person's feelings or attitude
+readily - a. without much difficulty
+realism - n. the attribute of accepting the facts of life and favoring practicality and literal truth
+recipient - n. a person who receives something
+reckless - j. characterized by careless unconcern
+recognize - v. detect with the senses
+reconcile - v. come to terms
+reconsider - v. consider again; give new consideration to; usually with a view to changing
+recover - v. get or find back; recover the use of
+recruit - v. cause to assemble or enlist in the military
+redemption - n. (theology) the act of delivering from sin or saving from evil
+refer - v. send or direct for treatment, information, or a decision
+reflection - n. the image of something as reflected by a mirror (or other reflective material)
+reform - v. make changes for improvement in order to remove abuse and injustices
+refuge - n. a shelter from danger or hardship
+refusal - n. the act of not accepting something that is offered
+regime - n. the government or governing authority of a political unit
+regional - j. related or limited to a particular region
+reign - v. have sovereign power
+relevant - j. having a bearing on or connection with the subject at issue
+reliant - j. depending on another for support
+reluctance - n. a certain degree of unwillingness
+reluctant - j. not eager
+reminiscent - j. serving to bring to mind
+renaissance - n. the period of European history at the close of the Middle Ages and the rise of the modern world; a cultural rebirth from the 14th through the middle of the 17th centuries
+render - v. give or supply
+renowned - j. widely known and esteemed
+repeal - n. cancel officially
+reproduction - n. the act of making copies
+requisite - n. anything indispensable
+resemblance - n. similarity in appearance or external or superficial details
+resent - v. feel bitter or indignant about
+resist - v. withstand the force of something
+resistance - n. the action of opposing something that you disapprove or disagree with
+resistant - j. impervious to being affected
+resort - v. have recourse to
+resource - n. a source of aid or support that may be drawn upon when needed
+restore - v. bring back into original existence, use, function, or position
+resurrection - n. (New Testament) the rising of Christ on the third day after the Crucifixion
+retrospect - n. contemplation of things past
+retrospective - j. concerned with or related to the past
+revelation - n. communication of knowledge to man by a divine or supernatural agency
+revive - v. be brought back to life, consciousness, or strength
+rhetoric - n. using language effectively to please or persuade
+ridiculous - j. incongruous; absurd; nonsensical
+rigorous - j. demanding strict attention to rules and procedures
+robust - j. sturdy and strong in form, constitution, or construction
+rue - n. sadness associated with some wrong done or some disappointment
+rural - j. living in or characteristic of farming or country life
+rustic - j. characteristic of the fields or country
+sacrifice - v. kill or destroy
+savage - v. criticize harshly or violently
+scholarly - j. characteristic of learning or studying
+scope - n. an area in which something acts or operates or has power or control
+script - n. a written version of a play or other dramatic composition; used in preparing for a performance
+secession - n. formal separation from an alliance or federation
+secondary - j. not of major importance
+secrecy - n. the trait of keeping things secret
+secular - j. not concerned with or devoted to religion
+seize - v. take hold of; grab
+selective - j. characterized by very careful or fastidious choices
+seminar - n. any meeting for an exchange of ideas
+sensation - n. a perception associated with stimulation of a sensory organ
+sensibility - n. refined sensitivity to pleasurable or painful impressions
+sensitive - j. responsive to physical stimuli
+sentence - n. the period of time a prisoner is imprisoned
+sentinel - n. a person employed to keep watch for some anticipated event
+sequel - n. a part added to a book or play that continues and extends it
+sequence - n. serial arrangement in which things follow in logical order or a recurrent pattern
+sergeant - n. any of several noncommissioned officer ranks in the Army or Air Force or Marines ranking above a corporal
+servitude - n. state of subjection to an owner or master or forced labor imposed as punishment
+severely - a. with sternness; in a severe manner
+shallow - j. lacking depth of intellect or knowledge; concerned only with what is obvious
+sheer - j. complete and without restriction or qualification
+shrewd - j. marked by practical hardheaded intelligence
+siege - n. the action of an armed force that surrounds a fortified place and isolates it while continuing to attack
+significance - n. the quality of being important in effect or meaning
+significant - j. important in effect or meaning
+similar - j. having close to the same characteristics
+sinister - j. stemming from evil characteristics or forces; wicked or dishonorable
+skepticism - n. the disbelief in any claims of ultimate knowledge
+slack - j. not tense or taut
+slight - n. a deliberate discourteous act (usually as an expression of anger or disapproval)
+sober - v. become more realistic
+socialism - n. a political theory advocating state ownership of industry
+socialist - j. advocating or following the socialist principles of state ownership
+sociology - n. the study and classification of human societies
+solar - j. relating to or derived from the sun or utilizing the energies of the sun
+soldier - n. an enlisted man or woman who serves in an army
+somber - j. grave or even gloomy in character
+sophisticated - j. having or appealing to those having worldly knowledge and refinement
+souvenir - n. a reminder of past events
+specialty - n. an asset of special worth or utility
+species - n. (biology) taxonomic group whose members can interbreed
+spectator - n. a close observer; someone who looks at something (such as an exhibition of some kind)
+specter - n. a ghostly appearing figure
+spectrum - n. a broad range of related objects or ideas or activities
+speculate - v. consider in an idle or casual way and with an element of doubt or without sufficient reason to reach a conclusion
+spontaneous - j. said or done without having been planned or written in advance
+static - j. showing little if any change
+stature - n. high level of respect gained by impressive development or achievement
+statute - n. an act passed by a legislative body
+stealth - n. avoiding detection by moving carefully
+stimulate - v. cause to be alert and energetic
+stringent - j. demanding strict attention to rules and procedures
+submission - n. something (manuscripts or architectural plans and models or estimates or works of art of all genres etc.) submitted for the judgment of others (as in a competition)
+subsequent - j. following in time or order
+subsidiary - j. functioning in a supporting capacity
+substantive - j. having a firm basis in reality and being therefore important, meaningful, or considerable
+subtle - j.  difficult to detect or grasp by the mind or analyze
+successor - n. a person who follows next in order
+summary - n. a brief statement that presents the main points in a concise form
+superb - j. of surpassing excellence
+superficial - j. concerned with or comprehending only what is apparent or obvious; not deep or penetrating emotionally or intellectually
+suppress - v. reduce the incidence or severity of or stop
+surround - v. extend on all sides of simultaneously; encircle
+suspense - n. excited anticipation of an approaching climax
+suspension - n. an interruption in the intensity or amount of something
+suspicious - j. openly distrustful and unwilling to confide
+sympathetic - j. expressing or feeling or resulting from sympathy or compassion or friendly fellow feelings; disposed toward
+symphony - n. a large orchestra; can perform symphonies
+systematic - j. characterized by order and planning
+tactics - n. the branch of military science dealing with detailed maneuvers to achieve objectives set by strategy
+tangible - j. perceptible by the senses especially the sense of touch
+taxation - n. the imposition of taxes; the practice of the government in levying taxes on the subjects of a state
+technique - n. skillfulness in the command of fundamentals deriving from practice and familiarity
+technology - n. the practical application of science to commerce or industry
+telescope - n. a magnifier of images of distant objects
+temporary - j. not permanent; not lasting
+tendency - n. a characteristic likelihood of or natural disposition toward a certain condition or character or effect
+tense - j. taut or rigid; stretched tight
+tentative - j. unsettled in mind or opinion
+tenure - v. give life-time employment to
+terminal - j. being or situated at an end
+territorial - j. displaying territoriality; defending an area from intruders
+testament - n. a profession of belief
+theological - j. of or relating to or concerning the study of religion
+theology - n. the rational and systematic study of religion and its influences and of the nature of religious truth
+theoretical - j. concerned with theories rather than their practical applications
+theorist - n. someone who theorizes (especially in science or art)
+thesis - n. a formal paper advancing a new point of view resulting from research; usually a requirement for an advanced academic degree
+titanic - j. of great force or power
+tolerance - n. willingness to recognize and respect the beliefs or practices of others
+tolerant - j. showing respect for the rights or opinions or practices of others
+tolerate - v. recognize and respect (rights and beliefs of others)
+transcript - n. something that has been transcribed; a written record (usually typewritten) of dictated or recorded speech
+transfer - v. move from one place to another
+transition - v. make or undergo a transition (from one state or system to another)
+translate - v. restate (words) from one language into another language
+transmission - n. the act of sending a message; causing a message to be transmitted
+transparent - j. transmitting light; able to be seen through with clarity
+transplant - n. the act of removing something from one location and introducing it in another location
+tremendous - j. extraordinarily large in size or extent or amount or power or degree
+tribune - n. a protector of the people
+trinity - n. the union of the Father and Son and Holy Ghost in one Godhead
+triple - v. increase threefold
+trivial - j. of little substance or significance
+truthful - j. expressing or given to expressing the truth
+turmoil - n. a violent disturbance
+typical - j. exhibiting the qualities or characteristics that identify a group or kind or category
+ubiquitous - j. being present everywhere at once
+ultimate - j. furthest or highest in degree or order; utmost or extreme
+unanimous - j. acting together as a single undiversified whole
+uncommon - j. not common or ordinarily encountered; unusually great in amount or remarkable in character or kind
+unconscious - j. not conscious; lacking awareness and the capacity for sensory perception as if asleep or dead
+undermine - v. destroy property or hinder normal operations
+unique - j. the single one of its kind
+unlimited - j. having no limits in range or scope
+unprecedented - j. having no previous example; novel
+urban - j. located in or characteristic of a city or city life
+urgency - n. an urgent situation calling for prompt action
+usage - n. the act of using
+utility - n. the quality of being of practical use
+vacuum - n. a region that is devoid of matter
+valid - j. well grounded in logic or truth or having legal force
+variation - n. an artifact that deviates from a norm or standard
+vegetarian - n. eater of fruits and grains and nuts; someone who eats no meat or fish or (often) any animal products
+vegetation - n. all the plant life in a particular region or period
+venerable - j. impressive by reason of age
+verify - v. confirm the truth of
+version - n. something a little different from others of the same type
+vertical - j. at right angles to the plane of the horizon or a base line
+veto - n. the power or right to prohibit or reject a proposed or intended act (especially the power of a chief executive to reject a bill passed by the legislature)
+vigorous - j. strong and active physically or mentally
+violation - n. an act that disregards an agreement or a right
+vista - n. the visual percept of a region
+visual - j. relating to or using sight
+vitality - n. an energetic style
+vogue - n. the popular taste at a given time
+volatile - j. liable to lead to sudden change or violence
+vulnerable - j. capable of being wounded or hurt
+warrant - v. stand behind and guarantee the quality, accuracy, or condition of
+wherever - a. where in the world
+wholly - a. to a complete degree or to the full or entire extent ('whole' is often used informally for 'wholly')
+woo - v. seek someone's favor
+zeal - n. excessive fervor to do something or accomplish some end
diff --git a/samples/SearchableDictionary/res/values/strings.xml b/samples/SearchableDictionary/res/values/strings.xml
new file mode 100644
index 0000000..a39ba75
--- /dev/null
+++ b/samples/SearchableDictionary/res/values/strings.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+    <!-- The name of the application. -->
+    <string name="app_name">Searchable Dictionary</string>
+
+    <!-- The label for the search results for this app (see searchable.xml for more details). -->
+    <string name="search_label">Dictionary</string>
+
+    <!-- The menu entry that invokes search. -->
+    <string name="menu_search">Search</string>
+
+    <!-- The description that will show up in the search settings for this source.  -->
+    <string name="settings_description">Definitions of words</string>
+
+    <!-- General instructions in the main activity. -->
+    <string name="search_instructions">Press the search key to look up a word</string>
+
+    <!-- Shown above search results when we receive a search request. -->
+    <string name="search_results">Search results for \'<xliff:g id="string">%s</xliff:g>\': </string>
+</resources>
diff --git a/samples/SearchableDictionary/res/xml/searchable.xml b/samples/SearchableDictionary/res/xml/searchable.xml
new file mode 100644
index 0000000..1edb57c
--- /dev/null
+++ b/samples/SearchableDictionary/res/xml/searchable.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- The attributes below configure how the search results will work:
+ - the 'label' points to a short description used when searching within the application if
+   'badge mode' is used as specified with android:searchMode="useLabelAsBadge" (which it is not for
+    this application).
+ - the 'searchSettingsDescription' points to a string that will be displayed underneath the
+   name of this application in the search settings to describe what content will be searched.
+ - 'includeInGlobalSearch' will include this app's search suggestions in Quick Search Box.
+ - 'searchSuggestAuthority' specifies the authority matching the authority of the
+   "DictionaryProvider" specified in the manifest.  This means the DictionaryProvider will be
+   queried for search suggestions.
+ - 'searchSuggestIntentAction' the default intent action used in the intent that is launched based
+   on a user cilcking on a search suggestion.  This saves us from manually having to fill in the
+   SUGGEST_COLUMN_INTENT_ACTION column for each suggestion returned by the provider.
+ -->
+<searchable xmlns:android="http://schemas.android.com/apk/res/android"
+        android:label="@string/search_label"
+        android:searchSettingsDescription="@string/settings_description"
+        android:includeInGlobalSearch="true"
+        android:searchSuggestAuthority="dictionary"
+        android:searchSuggestIntentAction="android.intent.action.VIEW">
+</searchable>
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/Dictionary.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/Dictionary.java
new file mode 100644
index 0000000..59e735b
--- /dev/null
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/Dictionary.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.searchabledict;
+
+import android.content.res.Resources;
+import android.text.TextUtils;
+import android.util.Log;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Contains logic to load the word of words and definitions and find a list of matching words
+ * given a query.  Everything is held in memory; this is not a robust way to serve lots of
+ * words and is only for demo purposes.
+ *
+ * You may want to consider using an SQLite database. In practice, you'll want to make sure your
+ * suggestion provider is as efficient as possible, as the system will be taxed while performing
+ * searches across many sources for each keystroke the user enters into Quick Search Box.
+ */
+public class Dictionary {
+
+    public static class Word {
+        public final String word;
+        public final String definition;
+
+        public Word(String word, String definition) {
+            this.word = word;
+            this.definition = definition;
+        }
+    }
+
+    private static final Dictionary sInstance = new Dictionary();
+
+    public static Dictionary getInstance() {
+        return sInstance;
+    }
+
+    private final Map<String, List<Word>> mDict = new ConcurrentHashMap<String, List<Word>>();
+
+    private Dictionary() {
+    }
+
+    private boolean mLoaded = false;
+
+    /**
+     * Loads the words and definitions if they haven't been loaded already.
+     *
+     * @param resources Used to load the file containing the words and definitions.
+     */
+    public synchronized void ensureLoaded(final Resources resources) {
+        if (mLoaded) return;
+
+        new Thread(new Runnable() {
+            public void run() {
+                try {
+                    loadWords(resources);
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }).start();
+    }
+
+    private synchronized void loadWords(Resources resources) throws IOException {
+        if (mLoaded) return;
+
+        Log.d("dict", "loading words");
+        InputStream inputStream = resources.openRawResource(R.raw.definitions);
+        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+
+        try {
+            String line;
+            while((line = reader.readLine()) != null) {
+                String[] strings = TextUtils.split(line, "-");
+                if (strings.length < 2) continue;
+                addWord(strings[0].trim(), strings[1].trim());
+            }
+        } finally {
+            reader.close();
+        }
+        mLoaded = true;
+    }
+
+
+    public List<Word> getMatches(String query) {
+        List<Word> list = mDict.get(query);
+        return list == null ? Collections.EMPTY_LIST : list;
+    }
+
+    private void addWord(String word, String definition) {
+        final Word theWord = new Word(word, definition);
+
+        final int len = word.length();
+        for (int i = 0; i < len; i++) {
+            final String prefix = word.substring(0, len - i);
+            addMatch(prefix, theWord);
+        }
+    }
+
+    private void addMatch(String query, Word word) {
+        List<Word> matches = mDict.get(query);
+        if (matches == null) {
+            matches = new ArrayList<Word>();
+            mDict.put(query, matches);
+        }
+        matches.add(word);
+    }
+}
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/DictionaryProvider.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/DictionaryProvider.java
new file mode 100644
index 0000000..db626e8
--- /dev/null
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/DictionaryProvider.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.searchabledict;
+
+import android.app.SearchManager;
+import android.content.ContentProvider;
+import android.content.ContentValues;
+import android.content.UriMatcher;
+import android.content.res.Resources;
+import android.database.Cursor;
+import android.database.MatrixCursor;
+import android.net.Uri;
+import android.text.TextUtils;
+
+import java.util.List;
+
+/**
+ * Provides search suggestions for a list of words and their definitions.
+ */
+public class DictionaryProvider extends ContentProvider {
+
+    public static String AUTHORITY = "dictionary";
+
+    private static final int SEARCH_SUGGEST = 0;
+    private static final int SHORTCUT_REFRESH = 1;
+    private static final UriMatcher sURIMatcher = buildUriMatcher();
+
+    /**
+     * The columns we'll include in our search suggestions.  There are others that could be used
+     * to further customize the suggestions, see the docs in {@link SearchManager} for the details
+     * on additional columns that are supported.
+     */
+    private static final String[] COLUMNS = {
+            "_id",  // must include this column
+            SearchManager.SUGGEST_COLUMN_TEXT_1,
+            SearchManager.SUGGEST_COLUMN_TEXT_2,
+            SearchManager.SUGGEST_COLUMN_INTENT_DATA,
+            };
+
+
+    /**
+     * Sets up a uri matcher for search suggestion and shortcut refresh queries.
+     */
+    private static UriMatcher buildUriMatcher() {
+        UriMatcher matcher =  new UriMatcher(UriMatcher.NO_MATCH);
+        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY, SEARCH_SUGGEST);
+        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY + "/*", SEARCH_SUGGEST);
+        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_SHORTCUT, SHORTCUT_REFRESH);
+        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_SHORTCUT + "/*", SHORTCUT_REFRESH);
+        return matcher;
+    }
+
+    @Override
+    public boolean onCreate() {
+        Resources resources = getContext().getResources();
+        Dictionary.getInstance().ensureLoaded(resources);
+        return true;
+    }
+
+    @Override
+    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
+            String sortOrder) {
+        if (!TextUtils.isEmpty(selection)) {
+            throw new IllegalArgumentException("selection not allowed for " + uri);
+        }
+        if (selectionArgs != null && selectionArgs.length != 0) {
+            throw new IllegalArgumentException("selectionArgs not allowed for " + uri);
+        }
+        if (!TextUtils.isEmpty(sortOrder)) {
+            throw new IllegalArgumentException("sortOrder not allowed for " + uri);
+        }
+        switch (sURIMatcher.match(uri)) {
+            case SEARCH_SUGGEST:
+                String query = null;
+                if (uri.getPathSegments().size() > 1) {
+                    query = uri.getLastPathSegment().toLowerCase();
+                }
+                return getSuggestions(query, projection);
+            case SHORTCUT_REFRESH:
+                String shortcutId = null;
+                if (uri.getPathSegments().size() > 1) {
+                    shortcutId = uri.getLastPathSegment();
+                }
+                return refreshShortcut(shortcutId, projection);
+            default:
+                throw new IllegalArgumentException("Unknown URL " + uri);
+        }
+    }
+
+    private Cursor getSuggestions(String query, String[] projection) {
+        String processedQuery = query == null ? "" : query.toLowerCase();
+        List<Dictionary.Word> words = Dictionary.getInstance().getMatches(processedQuery);
+
+        MatrixCursor cursor = new MatrixCursor(COLUMNS);
+        for (Dictionary.Word word : words) {
+            cursor.addRow(columnValuesOfWord(word));
+        }
+
+        return cursor;
+    }
+
+    private Object[] columnValuesOfWord(Dictionary.Word word) {
+        return new String[] {
+                word.word,           // _id
+                word.word,           // text1
+                word.definition,     // text2
+                word.word,           // intent_data (included when clicking on item)
+        };
+    }
+
+    /**
+     * Note: this is unused as is, but if we included
+     * {@link SearchManager#SUGGEST_COLUMN_SHORTCUT_ID} as a column in our results, we
+     * could expect to receive refresh queries on this uri for the id provided, in which case we
+     * would return a cursor with a single item representing the refreshed suggestion data.
+     */
+    private Cursor refreshShortcut(String shortcutId, String[] projection) {
+        return null;
+    }
+
+    /**
+     * All queries for this provider are for the search suggestion and shortcut refresh mime type.
+     */
+    public String getType(Uri uri) {
+        switch (sURIMatcher.match(uri)) {
+            case SEARCH_SUGGEST:
+                return SearchManager.SUGGEST_MIME_TYPE;
+            case SHORTCUT_REFRESH:
+                return SearchManager.SHORTCUT_MIME_TYPE;
+            default:
+                throw new IllegalArgumentException("Unknown URL " + uri);
+        }
+    }
+
+    public Uri insert(Uri uri, ContentValues values) {
+        throw new UnsupportedOperationException();
+    }
+
+    public int delete(Uri uri, String selection, String[] selectionArgs) {
+        throw new UnsupportedOperationException();
+    }
+
+    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
+        throw new UnsupportedOperationException();
+    }
+}
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java
new file mode 100644
index 0000000..4d27470
--- /dev/null
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.searchabledict;
+
+import android.app.Activity;
+import android.app.SearchManager;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.AdapterView;
+import android.widget.BaseAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.TwoLineListItem;
+
+import java.util.List;
+
+/**
+ * The main activity for the dictionary.  Also displays search results triggered by the search
+ * dialog.
+ */
+public class SearchableDictionary extends Activity {
+
+    private static final int MENU_SEARCH = 1;
+
+    private TextView mTextView;
+    private ListView mList;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        Intent intent = getIntent();
+
+        setContentView(R.layout.main);
+        mTextView = (TextView) findViewById(R.id.textField);
+        mList = (ListView) findViewById(R.id.list);
+
+        if (Intent.ACTION_VIEW.equals(intent.getAction())) {
+            // from click on search results
+            Dictionary.getInstance().ensureLoaded(getResources());
+            String word = intent.getDataString();
+            Dictionary.Word theWord = Dictionary.getInstance().getMatches(word).get(0);
+            launchWord(theWord);
+            finish();
+        } else if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
+            String query = intent.getStringExtra(SearchManager.QUERY);
+            mTextView.setText(getString(R.string.search_results, query));
+            WordAdapter wordAdapter = new WordAdapter(Dictionary.getInstance().getMatches(query));
+            mList.setAdapter(wordAdapter);
+            mList.setOnItemClickListener(wordAdapter);
+        }
+
+        Log.d("dict", intent.toString());
+        if (intent.getExtras() != null) {
+            Log.d("dict", intent.getExtras().keySet().toString());
+        }
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        menu.add(0, MENU_SEARCH, 0, R.string.menu_search)
+                .setIcon(android.R.drawable.ic_search_category_default)
+                .setAlphabeticShortcut(SearchManager.MENU_KEY);
+
+        return super.onCreateOptionsMenu(menu);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case MENU_SEARCH:
+                onSearchRequested();
+                return true;
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void launchWord(Dictionary.Word theWord) {
+        Intent next = new Intent();
+        next.setClass(this, WordActivity.class);
+        next.putExtra("word", theWord.word);
+        next.putExtra("definition", theWord.definition);
+        startActivity(next);
+    }
+
+    class WordAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
+
+        private final List<Dictionary.Word> mWords;
+        private final LayoutInflater mInflater;
+
+        public WordAdapter(List<Dictionary.Word> words) {
+            mWords = words;
+            mInflater = (LayoutInflater) SearchableDictionary.this.getSystemService(
+                    Context.LAYOUT_INFLATER_SERVICE);
+        }
+
+        public int getCount() {
+            return mWords.size();
+        }
+
+        public Object getItem(int position) {
+            return position;
+        }
+
+        public long getItemId(int position) {
+            return position;
+        }
+
+        public View getView(int position, View convertView, ViewGroup parent) {
+            TwoLineListItem view = (convertView != null) ? (TwoLineListItem) convertView :
+                    createView(parent);
+            bindView(view, mWords.get(position));
+            return view;
+        }
+
+        private TwoLineListItem createView(ViewGroup parent) {
+            TwoLineListItem item = (TwoLineListItem) mInflater.inflate(
+                    android.R.layout.simple_list_item_2, parent, false);
+            item.getText2().setSingleLine();
+            item.getText2().setEllipsize(TextUtils.TruncateAt.END);
+            return item;
+        }
+
+        private void bindView(TwoLineListItem view, Dictionary.Word word) {
+            view.getText1().setText(word.word);
+            view.getText2().setText(word.definition);
+        }
+
+        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+            launchWord(mWords.get(position));
+        }
+    }
+}
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java
new file mode 100644
index 0000000..1c4b8b4
--- /dev/null
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.searchabledict;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.TextView;
+import android.content.Intent;
+
+/**
+ * Displays a word and its definition.
+ */
+public class WordActivity extends Activity {
+
+    private TextView mWord;
+    private TextView mDefinition;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.word);
+
+        mWord = (TextView) findViewById(R.id.word);
+        mDefinition = (TextView) findViewById(R.id.definition);
+
+        Intent intent = getIntent();
+
+        String word = intent.getStringExtra("word");
+        String definition = intent.getStringExtra("definition");
+
+        mWord.setText(word);
+        mDefinition.setText(definition);
+    }
+}
diff --git a/testrunner/test_defs.xml b/testrunner/test_defs.xml
index 9d03558..44db464 100644
--- a/testrunner/test_defs.xml
+++ b/testrunner/test_defs.xml
@@ -72,7 +72,7 @@
 <test name="launchperf"
     build_path="development/apps/launchperf"
     package="com.android.launchperf"
-    class="com.android.launchperf.SimpleActivityLaunchPerformance"
+    runner=".SimpleActivityLaunchPerformance"
     coverage_target="framework" />
 
 <!--  targeted framework tests -->
diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java
index 293d66a..d72cd94 100644
--- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java
+++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java
@@ -218,15 +218,32 @@
             return true;
         }
 
-        // if the receiver has optional libraries, then the target is only compatible if the
-        // vendor and name are the same
-        if (mLibraries.length != 0 &&
-                (mVendor.equals(target.getVendor()) == false ||
-                        mName.equals(target.getName()) == false)) {
-            return false;
+        /*
+         * The method javadoc indicates:
+         * Returns whether the given target is compatible with the receiver.
+         * <p/>A target is considered compatible if applications developed for the receiver can
+         * run on the given target.
+         */
+
+        // The receiver is an add-on. There are 2 big use cases: The add-on has libraries
+        // or the add-on doesn't (in which case we consider it a platform).
+        if (mLibraries.length == 0) {
+            return mBasePlatform.isCompatibleBaseFor(target);
+        } else {
+            // the only targets that can run the receiver are the same add-on in the same or later
+            // versions.
+            // first check: vendor/name
+            if (mVendor.equals(target.getVendor()) == false ||
+                            mName.equals(target.getName()) == false) {
+                return false;
+            }
+
+            // now check the version. At this point since we checked the add-on part,
+            // we can revert to the basic check on version/codename which are done by the
+            // base platform already.
+            return mBasePlatform.isCompatibleBaseFor(target);
         }
 
-        return mBasePlatform.equals(target);
     }
 
     public String hashString() {
diff --git a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java
index 96d1b65..ba1bb4c 100644
--- a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java
+++ b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java
@@ -81,7 +81,7 @@
     private Button mNewButton;
     private Button mRefreshButton;
     private Button mManagerButton;
-    private Button mUpdateButton;
+    private Button mRepairButton;
     private Button mStartButton;
 
     private SelectionListener mSelectionListener;
@@ -256,14 +256,14 @@
                 }
             });
 
-            mUpdateButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-            mUpdateButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-            mUpdateButton.setText("Update...");
-            mUpdateButton.setToolTipText("Updates the path of the selected AVD.");
-            mUpdateButton.addSelectionListener(new SelectionAdapter() {
+            mRepairButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
+            mRepairButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+            mRepairButton.setText("Repair...");
+            mRepairButton.setToolTipText("Repairs the selected AVD.");
+            mRepairButton.addSelectionListener(new SelectionAdapter() {
                 @Override
                 public void widgetSelected(SelectionEvent arg0) {
-                    onUpdate();
+                    onRepair();
                 }
             });
 
@@ -775,8 +775,8 @@
             if (mDeleteButton != null) {
                 mDeleteButton.setEnabled(false);
             }
-            if (mUpdateButton != null) {
-                mUpdateButton.setEnabled(false);
+            if (mRepairButton != null) {
+                mRepairButton.setEnabled(false);
             }
         } else {
             AvdInfo selection = getTableSelection();
@@ -790,8 +790,8 @@
             if (mDeleteButton != null) {
                 mDeleteButton.setEnabled(hasSelection);
             }
-            if (mUpdateButton != null) {
-                mUpdateButton.setEnabled(hasSelection &&
+            if (mRepairButton != null) {
+                mRepairButton.setEnabled(hasSelection &&
                         selection.getStatus() == AvdStatus.ERROR_IMAGE_DIR);
             }
         }
@@ -851,7 +851,12 @@
         }
     }
 
-    private void onUpdate() {
+    /**
+     * Repairs the selected AVD.
+     * <p/>
+     * For now this only supports fixing the wrong value in image.sysdir.*
+     */
+    private void onRepair() {
         final AvdInfo avdInfo = getTableSelection();
 
         // get the current Display