aboutsummaryrefslogtreecommitdiffstats
path: root/androidprefs
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 18:28:16 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 18:28:16 -0800
commit82ea7a177797b844b252effea5c7c7c5d63ea4ac (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /androidprefs
parentc9432be76d50a527da232d518f633add2f76242b (diff)
downloadsdk-82ea7a177797b844b252effea5c7c7c5d63ea4ac.zip
sdk-82ea7a177797b844b252effea5c7c7c5d63ea4ac.tar.gz
sdk-82ea7a177797b844b252effea5c7c7c5d63ea4ac.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'androidprefs')
-rw-r--r--androidprefs/.classpath6
-rw-r--r--androidprefs/.project17
-rw-r--r--androidprefs/Android.mk17
-rw-r--r--androidprefs/src/Android.mk24
-rw-r--r--androidprefs/src/com/android/prefs/AndroidLocation.java98
5 files changed, 0 insertions, 162 deletions
diff --git a/androidprefs/.classpath b/androidprefs/.classpath
deleted file mode 100644
index fb50116..0000000
--- a/androidprefs/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/androidprefs/.project b/androidprefs/.project
deleted file mode 100644
index 6633bba..0000000
--- a/androidprefs/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>AndroidPrefs</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/androidprefs/Android.mk b/androidprefs/Android.mk
deleted file mode 100644
index 363b085..0000000
--- a/androidprefs/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# 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.
-#
-JARUTILS_LOCAL_DIR := $(call my-dir)
-include $(JARUTILS_LOCAL_DIR)/src/Android.mk
diff --git a/androidprefs/src/Android.mk b/androidprefs/src/Android.mk
deleted file mode 100644
index ddc0aa6..0000000
--- a/androidprefs/src/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_MODULE := androidprefs
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
diff --git a/androidprefs/src/com/android/prefs/AndroidLocation.java b/androidprefs/src/com/android/prefs/AndroidLocation.java
deleted file mode 100644
index cfd9f53..0000000
--- a/androidprefs/src/com/android/prefs/AndroidLocation.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.android.prefs;
-
-import java.io.File;
-
-/**
- * Manages the location of the android files (including emulator files, ddms config, debug keystore)
- */
-public final class AndroidLocation {
- /**
- * Virtual Device folder inside the path returned by {@link #getFolder()}
- */
- public static final String FOLDER_AVD = "avd";
-
- /**
- * Throw when the location of the android folder couldn't be found.
- */
- public static final class AndroidLocationException extends Exception {
- private static final long serialVersionUID = 1L;
-
- public AndroidLocationException(String string) {
- super(string);
- }
- }
-
- private static String sPrefsLocation = null;
-
- /**
- * Returns the folder used to store android related files.
- * @return an OS specific path, terminated by a separator.
- * @throws AndroidLocationException
- */
- public final static String getFolder() throws AndroidLocationException {
- if (sPrefsLocation == null) {
- String home = findValidPath("ANDROID_SDK_HOME", "user.home", "HOME");
-
- // if the above failed, we throw an exception.
- if (home == null) {
- throw new AndroidLocationException(
- "Unable to get the home directory. Make sure the user.home property is set up");
- } else {
- sPrefsLocation = home + File.separator + ".android" + File.separator;
-
- // make sure the folder exists!
- File f = new File(sPrefsLocation);
- if (f.exists() == false) {
- f.mkdir();
- } else if (f.isFile()) {
- throw new AndroidLocationException(sPrefsLocation +
- " is not a directory! This is required to run Android tools.");
- }
- }
- }
-
- return sPrefsLocation;
- }
-
- /**
- * Checks a list of system properties and/or system environment variables for validity, and
- * existing director, and returns the first one.
- * @param names
- * @return the content of the first property/variable.
- */
- private static String findValidPath(String... names) {
- for (String name : names) {
- String path;
- if (name.indexOf('.') != -1) {
- path = System.getProperty(name);
- } else {
- path = System.getenv(name);
- }
-
- if (path != null) {
- File f = new File(path);
- if (f.isDirectory()) {
- return path;
- }
- }
- }
-
- return null;
- }
-}