OSDN Git Service

SDK Manager: correctly handle lack of AvdManager
authorRaphael <raphael@google.com>
Thu, 25 Mar 2010 22:15:53 +0000 (15:15 -0700)
committerRaphael <raphael@google.com>
Fri, 26 Mar 2010 21:07:27 +0000 (14:07 -0700)
commit31dcfe7ab21a0ca71c6c51dba6d41b1d767cf028
treee8a39e6036a305a57cfe1f1f60eaa45208a9bc61
parent874a96cd7d5e8f371f4495668c04e9a3dcce17ce
SDK Manager: correctly handle lack of AvdManager

Digit's issue in SDK Bug 2535112 was that AndroidLocation failed
to get the SDK home dir; consequently the SdkManager failed to
create an AvdManager and was using a null ptr everywhere.

This CL addresses the core issue here:
- The New AVD button should be grayed if there is AvdManager.

- UpdaterData.initSdk was catching the error and printing an
  error log that is not shown in the UI. There's now an explicit
  dialog box that explains the error and how to solve it.

- UpdaterWindow now aborts if the above dialog is shown. There's
  no need to keep the SDK Manager window around -- OK maybe that's
  a bit harsh since the SDK download/install part can stil lbe used
  by do we really want to deal with an half-functional window?
  No we don't really want that use-case. Let's force the user to
  fix it.

- Fixed the AndroidLocation error message to something more usable.
  Most people can set an environment variable, however few know
  how to "set up the user.home property" (I don't even know how
  to do that.)

- Display the AVD base folder in the AVD page.

Change-Id: I2b9dbc7180e4bb3ff696de257bb260e808301d2d
androidprefs/src/com/android/prefs/AndroidLocation.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java
sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/AvdManagerPage.java
sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java
sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterWindowImpl.java
sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java