Hi all,
here’s the instructions on how to run a Fennec/GeckoView on a AOSP without SystemUI. It took me a while, but luckily the solution is luckily easier than expected.
First make sure you have a proper ASOP built from source. I used Nougat on the X86_64 emulator. You also need a to build Firefox for Android (Fennec) from source.
If you have both, apply the two patches below. This one for ASOP. It’s just removing SystemUI
, Home
, Launcher2
and Launcher3
from the build:
diff --git a/target/product/core.mk b/target/product/core.mk
index 75cf649..a342663 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -41,7 +41,6 @@ PRODUCT_PACKAGES += \
KeyChain \
Keyguard \
LatinIME \
- Launcher2 \
ManagedProvisioning \
MtpDocumentsProvider \
PicoTts \
diff --git a/target/product/core_base.mk b/target/product/core_base.mk
index 03d33e1..e4e3a7b 100644
--- a/target/product/core_base.mk
+++ b/target/product/core_base.mk
@@ -23,7 +23,6 @@ PRODUCT_PROPERTY_OVERRIDES := \
PRODUCT_PACKAGES += \
ContactsProvider \
DefaultContainerService \
- Home \
TelephonyProvider \
UserDictionaryProvider \
atrace \
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index 5c48358..3fe18e3 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -26,7 +26,6 @@ PRODUCT_PACKAGES := \
MusicFX \
OneTimeInitializer \
Provision \
- SystemUI \
EasterEgg \
WallpaperCropper
diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk
index fa257ae..62fa2de 100644
--- a/target/product/sdk_base.mk
+++ b/target/product/sdk_base.mk
@@ -26,7 +26,6 @@ PRODUCT_PACKAGES := \
Fallback \
Gallery \
GestureBuilder \
- Launcher3 \
LegacyCamera \
librs_jni \
libwnndict \
@@ -43,7 +42,6 @@ PRODUCT_PACKAGES := \
SmokeTestApp \
SoftKeyboard \
sqlite3 \
- SystemUI \
EasterEgg \
WidgetPreview
And that one for Fennec and GeckoView. It just makes them launchers:
diff --git a/mobile/android/base/AndroidManifest.xml.in b/mobile/android/base/AndroidManifest.xml.in
index 295f7f4..300dea8 100644
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -82,6 +82,7 @@
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
<category android:name="android.intent.category.APP_BROWSER" />
<category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.HOME" />
</intent-filter>
<intent-filter>
diff --git a/mobile/android/geckoview_example/src/main/AndroidManifest.xml b/mobile/android/geckoview_example/src/main/AndroidManifest.xml
index 551a4a7..548686c 100644
--- a/mobile/android/geckoview_example/src/main/AndroidManifest.xml
+++ b/mobile/android/geckoview_example/src/main/AndroidManifest.xml
@@ -8,9 +8,13 @@
<uses-library android:name="android.test.runner" />
<activity android:name="org.mozilla.geckoview_example.GeckoViewActivity"
- android:label="GeckoViewActivity">
+ android:label="GeckoViewActivity"
+ android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
+ android:launchMode="singleTask"
+ android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Now you need to rebuild them. For ASOP do:
make installclean
make
If you start the emulator via:
emulator -gpu swiftshader
you should get in the adb logcat
output something like
10-20 16:44:07.316 1987 1987 D FallbackHome: User unlocked but no home; let's hope someone enables one soon?
repeatedly. You can now install a launcher (homescreen). Either Fennec or Geckview.
For Fennec run from without your Gecko source directory:
./mach build
./mach package
./mach install
# to uninstall
adb uninstall org.mozilla.fennec_${USER}
If you want to install GeckoView, then go into mobile/android/geckoview_example
and run:
../../../gradlew build
../../../gradlew installWithGeckoBinaries
# to uninstall
../../../gradlew uninstallWithGeckoBinaries