diff --git a/android/.idea/android.iml b/android/.idea/android.iml index bede88d..08891e4 100644 --- a/android/.idea/android.iml +++ b/android/.idea/android.iml @@ -3,13 +3,16 @@ - @@ -20,7 +23,7 @@ - + \ No newline at end of file diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml index ef0c98a..187605a 100644 --- a/android/.idea/misc.xml +++ b/android/.idea/misc.xml @@ -1,5 +1,8 @@ + + + - + \ No newline at end of file diff --git a/android/.idea/workspace.xml b/android/.idea/workspace.xml index 7ed7a40..54b36f0 100644 --- a/android/.idea/workspace.xml +++ b/android/.idea/workspace.xml @@ -10,9 +10,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -36,91 +72,22 @@ - - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -139,18 +106,20 @@ @@ -186,46 +155,14 @@ @@ -233,7 +170,7 @@ - + @@ -256,15 +193,15 @@ + + + @@ -486,37 +426,54 @@ + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + + + @@ -525,19 +482,15 @@ - + - - - - - - + + - + @@ -545,22 +498,40 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + - - - - @@ -568,7 +539,6 @@ - @@ -576,9 +546,6 @@ - - - @@ -586,14 +553,182 @@ - + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -615,7 +750,7 @@ - Android + Android (android)|Android - 1.7 + Android API 23 Platform - + \ No newline at end of file diff --git a/android/Android.mk b/android/Android.mk index 2b75af4..0e62562 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -3,12 +3,15 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES = \ - jni/anbox_support.cpp + jni/anbox_support.cpp \ + jni/application_manager.cpp \ + jni/jni_helper.cpp LOCAL_C_INCLUDES := \ $(JNI_H_INCLUDE) \ libcore/include LOCAL_SHARED_LIBRARIES := \ - liblog + liblog \ + libnativehelper LOCAL_MODULE := libanbox_support include $(BUILD_SHARED_LIBRARY) @@ -16,19 +19,21 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional -LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java +LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/java LOCAL_SRC_FILES := $(call all-java-files-under, java) LOCAL_JAVA_LIBRARIES := telephony-common +LOCAL_JNI_SHARED_LIBRARIES := \ + libanbox_support # Block certain packages from being installed -LOCAL_OVERRIDES_PACKAGES := \ - SystemUI \ - Home \ - Launcher2 \ - Calculator \ - BasicDreams \ - Calendar \ - PrintSpooler \ - WallpaperCropper +# LOCAL_OVERRIDES_PACKAGES := \ +# SystemUI \ +# Home \ +# Launcher2 \ +# Calculator \ +# BasicDreams \ +# Calendar \ +# PrintSpooler \ +# WallpaperCropper LOCAL_PACKAGE_NAME := anboxd LOCAL_CERTIFICATE := platform LOCAL_PRIVILEGED_MODULE := true diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index 865222e..0775045 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -1,10 +1,4 @@ -set(ANBOX_SUPPORT_SOURCES - jni/anbox_support.cpp) +set(ANBOXD_SOURCES + service/main.cpp) -include_directories( - ${CMAKE_SOURCE_DIR}/external/jni) - -# We're not going to ship this, just building here to add proper -# unit tests we can run in a integration system without having -# the Android build system around. -add_library(anbox-support ${ANBOX_SUPPORT_SOURCES}) +add_executable(anboxd ${ANBOXD_SOURCES}) diff --git a/android/build/production/android/org/anbox/BuildConfig.class b/android/build/production/android/org/anbox/BuildConfig.class deleted file mode 100644 index d922628..0000000 Binary files a/android/build/production/android/org/anbox/BuildConfig.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$attr.class b/android/build/production/android/org/anbox/R$attr.class deleted file mode 100644 index 477921b..0000000 Binary files a/android/build/production/android/org/anbox/R$attr.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$color.class b/android/build/production/android/org/anbox/R$color.class deleted file mode 100644 index 4d9aba4..0000000 Binary files a/android/build/production/android/org/anbox/R$color.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$dimen.class b/android/build/production/android/org/anbox/R$dimen.class deleted file mode 100644 index 7286425..0000000 Binary files a/android/build/production/android/org/anbox/R$dimen.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$drawable.class b/android/build/production/android/org/anbox/R$drawable.class deleted file mode 100644 index e962fad..0000000 Binary files a/android/build/production/android/org/anbox/R$drawable.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$fraction.class b/android/build/production/android/org/anbox/R$fraction.class deleted file mode 100644 index 7b4a7ca..0000000 Binary files a/android/build/production/android/org/anbox/R$fraction.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$id.class b/android/build/production/android/org/anbox/R$id.class deleted file mode 100644 index f4bb230..0000000 Binary files a/android/build/production/android/org/anbox/R$id.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$integer.class b/android/build/production/android/org/anbox/R$integer.class deleted file mode 100644 index a336a18..0000000 Binary files a/android/build/production/android/org/anbox/R$integer.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$layout.class b/android/build/production/android/org/anbox/R$layout.class deleted file mode 100644 index 52ba784..0000000 Binary files a/android/build/production/android/org/anbox/R$layout.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$menu.class b/android/build/production/android/org/anbox/R$menu.class deleted file mode 100644 index 4beed44..0000000 Binary files a/android/build/production/android/org/anbox/R$menu.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$mipmap.class b/android/build/production/android/org/anbox/R$mipmap.class deleted file mode 100644 index 32c6ac7..0000000 Binary files a/android/build/production/android/org/anbox/R$mipmap.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$string.class b/android/build/production/android/org/anbox/R$string.class deleted file mode 100644 index 138d624..0000000 Binary files a/android/build/production/android/org/anbox/R$string.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$style.class b/android/build/production/android/org/anbox/R$style.class deleted file mode 100644 index 0e0bdfd..0000000 Binary files a/android/build/production/android/org/anbox/R$style.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R$styleable.class b/android/build/production/android/org/anbox/R$styleable.class deleted file mode 100644 index 1cdb39b..0000000 Binary files a/android/build/production/android/org/anbox/R$styleable.class and /dev/null differ diff --git a/android/build/production/android/org/anbox/R.class b/android/build/production/android/org/anbox/R.class deleted file mode 100644 index 87790d4..0000000 Binary files a/android/build/production/android/org/anbox/R.class and /dev/null differ diff --git a/android/jni/anbox_support.cpp b/android/java/org/anbox/ApplicationManager.java similarity index 70% rename from android/jni/anbox_support.cpp rename to android/java/org/anbox/ApplicationManager.java index f7b1156..b770557 100644 --- a/android/jni/anbox_support.cpp +++ b/android/java/org/anbox/ApplicationManager.java @@ -15,19 +15,15 @@ * */ -#include -#include +package org.anbox; -#define LOG_TAG "AnboxSupport" +import android.util.Log; +import java.lang.ref.WeakReference; -#ifdef ANDROID -#include -#else -#define ALOGI(...) -#endif +public class ApplicationManager { + static final String TAG = "AnboxApplicationManager"; -extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) { - ALOGI("Successfully loaded Anbox support library"); - - return JNI_VERSION_1_4; + public ApplicationManager() { + Log.i(TAG, "Starting up native part.."); + } } diff --git a/android/java/org/anbox/BootReceiver.java b/android/java/org/anbox/BootReceiver.java index a80c739..543336d 100644 --- a/android/java/org/anbox/BootReceiver.java +++ b/android/java/org/anbox/BootReceiver.java @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + package org.anbox; import android.content.BroadcastReceiver; diff --git a/android/java/org/anbox/MainActivity.java b/android/java/org/anbox/MainActivity.java index 9e1be1b..1aa1a6f 100644 --- a/android/java/org/anbox/MainActivity.java +++ b/android/java/org/anbox/MainActivity.java @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + package org.anbox; import android.app.Activity; diff --git a/android/java/org/anbox/MainApplication.java b/android/java/org/anbox/MainApplication.java index 3ee34dc..4735e5e 100644 --- a/android/java/org/anbox/MainApplication.java +++ b/android/java/org/anbox/MainApplication.java @@ -1,17 +1,33 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + package org.anbox; import android.app.Application; public class MainApplication extends Application { + private ApplicationManager mApplicationManager; private NavBar mNavBar; - static { - // Load our native support library on startup so we get - // access to several things from the Anbox host service. - System.loadLibrary("anbox_support"); + public MainApplication() { } public void startServices() { + mApplicationManager = new ApplicationManager(); mNavBar = new NavBar(this); } } diff --git a/android/java/org/anbox/NavBar.java b/android/java/org/anbox/NavBar.java index e10c34b..3777fc0 100644 --- a/android/java/org/anbox/NavBar.java +++ b/android/java/org/anbox/NavBar.java @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + package org.anbox; import android.app.ActivityManager; diff --git a/android/java/org/anbox/NavigationBarView.java b/android/java/org/anbox/NavigationBarView.java index 342ce8e..bc3f5f2 100644 --- a/android/java/org/anbox/NavigationBarView.java +++ b/android/java/org/anbox/NavigationBarView.java @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + package org.anbox; import android.content.Context; diff --git a/android/java/org/anbox/NotificationListener.java b/android/java/org/anbox/NotificationListener.java index cc55dfa..b12c7ef 100644 --- a/android/java/org/anbox/NotificationListener.java +++ b/android/java/org/anbox/NotificationListener.java @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + package org.anbox; import android.app.Service; diff --git a/android/service/main.cpp b/android/service/main.cpp new file mode 100644 index 0000000..ca60629 --- /dev/null +++ b/android/service/main.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + +int main(int, char**) { + return 0; +}