Renamed the getenv and added one for user sources.
Added a (naive) check to prevent duplicate URLs.
Also fixed the repositoy.xml download error message, it was not displaying the reason of failure correctly.
java.util.Properties#setProperty() doesn't like it when the value is null
which was the case when a package had no license.
Made sure it won't happen on other properties than the license as well.
Also improved error display when an unexpected Throwable is thrown during
install (Stack Call is now display if the Throwable has no message).
BUG:2037085
When the SDK installer unarchives the zip files, it is important to keep
the permissions for executable (Linux/MacOS) or the tools required to
build applications (aapt, aidl, ...) won't work.
Since java.util.zip does not provide support for permissions, we now
use the Apache Commons Compress component that allows us to read the
permission from the archive.
Platform, add-on and doc packages used to use Api Level to figure out
upgrade logic. This is replaced by AndroidVersion to properly handle
codename versions.
ro.build.version.codename is a new property indicating whether a platform
is in its release form (value = REL) or in development (value = dev branch
name such as Donut). When the codename indicates a development/preview version
then the API level must be ignored and this codename is used as a unique
identifier of the platform.
IAndroidTarget has been changed to return an instance of a new class
AndroidVersion instead of the api level directly. This class helps deals with
the logic of comparing version from targets or devices.
This change impacts all of the sdk manager to deal with targets identified by
codename instead of api level. This in turn impacts everything that relies
on the sdkmanager: ADT (build, launch, project creation), the AVD manager,
the SDK updater.
When installing an archive, a "source.properties" file is saved
in the directory that contains all the information from the
source (Source URL, package attributes, archive attributes.)
When loading local packages, these properties are used to
recreate the local package attributes if present. This is
also used to indentify local extra packages.
- Always unzip the archives first and get their root zip dir.
- Try to reusing an existing addon folder first.
- Or the root zip dir.
- Or come up with a better name for the addon folder.
Note that the setting operates on every source by converting
the https:// links into http:// before fetching the sources
or the archives.
This also reorganize some things: the RepoSourceAdapter now
takes the UpdaterData as parameter (so both Adapters work the
same) and the label/contentProviders are nested classes instead
of static classes. Cleanup some stuff that was no longer useful
such as the RepoSources.TaskFactory (it's in UpdaterData already).
With this change I can install from the dl site over http at home!
There is not any longer any logic in the SettingsPage,
it is handled now by a "SettingsControllers" which is
available via UpdaterData. The page only takes care of
notifying the controller via a callback when settings
have changed in the UI.