summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk4
-rw-r--r--applypatch/Android.mk4
-rw-r--r--mtdutils/Android.mk4
-rw-r--r--tools/ota/Android.mk4
-rw-r--r--ui.c9
5 files changed, 5 insertions, 20 deletions
diff --git a/Android.mk b/Android.mk
index 508eb4c64..282862fc9 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,5 +1,3 @@
-ifneq ($(TARGET_SIMULATOR),true)
-
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -74,5 +72,3 @@ include $(commands_recovery_local_path)/edify/Android.mk
include $(commands_recovery_local_path)/updater/Android.mk
include $(commands_recovery_local_path)/applypatch/Android.mk
commands_recovery_local_path :=
-
-endif # !TARGET_SIMULATOR
diff --git a/applypatch/Android.mk b/applypatch/Android.mk
index 2848b517e..0e529d4cb 100644
--- a/applypatch/Android.mk
+++ b/applypatch/Android.mk
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-ifneq ($(TARGET_SIMULATOR),true)
-
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -57,5 +55,3 @@ LOCAL_C_INCLUDES += external/zlib external/bzip2
LOCAL_STATIC_LIBRARIES += libz libbz
include $(BUILD_HOST_EXECUTABLE)
-
-endif # !TARGET_SIMULATOR
diff --git a/mtdutils/Android.mk b/mtdutils/Android.mk
index 416653698..ef417fa19 100644
--- a/mtdutils/Android.mk
+++ b/mtdutils/Android.mk
@@ -1,5 +1,3 @@
-ifneq ($(TARGET_SIMULATOR),true)
-
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -18,5 +16,3 @@ LOCAL_MODULE_TAGS := eng
LOCAL_STATIC_LIBRARIES := libmtdutils
LOCAL_SHARED_LIBRARIES := libcutils libc
include $(BUILD_EXECUTABLE)
-
-endif # !TARGET_SIMULATOR
diff --git a/tools/ota/Android.mk b/tools/ota/Android.mk
index 0bde7ee72..142c3b257 100644
--- a/tools/ota/Android.mk
+++ b/tools/ota/Android.mk
@@ -14,8 +14,6 @@
LOCAL_PATH := $(call my-dir)
-ifneq ($(TARGET_SIMULATOR),true)
-
include $(CLEAR_VARS)
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE := add-property-tag
@@ -33,5 +31,3 @@ LOCAL_MODULE_TAGS := debug
LOCAL_SRC_FILES := check-lost+found.c
LOCAL_STATIC_LIBRARIES := libcutils libc
include $(BUILD_EXECUTABLE)
-
-endif # !TARGET_SIMULATOR
diff --git a/ui.c b/ui.c
index 0744da4d9..173631926 100644
--- a/ui.c
+++ b/ui.c
@@ -592,17 +592,18 @@ void ui_show_text(int visible)
// Return true if USB is connected.
static int usb_connected() {
- int fd = open("/sys/class/switch/usb_connected/state", O_RDONLY);
+ int fd = open("/sys/class/android_usb/android0/state", O_RDONLY);
if (fd < 0) {
- printf("failed to open /sys/class/switch/usb_connected/state: %s\n",
+ printf("failed to open /sys/class/android_usb/android0/state: %s\n",
strerror(errno));
return 0;
}
char buf;
- int connected = (read(fd, &buf, 1) == 1) && (buf == '1');
+ /* USB is connected if android_usb state is CONNECTED or CONFIGURED */
+ int connected = (read(fd, &buf, 1) == 1) && (buf == 'C');
if (close(fd) < 0) {
- printf("failed to close /sys/class/switch/usb_connected/state: %s\n",
+ printf("failed to close /sys/class/android_usb/android0/state: %s\n",
strerror(errno));
}
return connected;