diff --git a/Android.bp b/Android.bp
index 18f8fdd69f0cc25fab8d7ee469b0ccd0d4e0ea8e..9ab0c299b3e7fc680fb8d6c9d9b07b03bf639580 100644
--- a/Android.bp
+++ b/Android.bp
@@ -26,6 +26,7 @@ android_app {
"setupdesign",
"SystemUISharedLib",
"org.lineageos.platform.internal",
+ "androidx.browser_browser",
],
libs: ["telephony-common"],
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index f9fdd4a694b5b5944993448187eaf23f5e5c0131..63cc5fb55c8be13a4bacf65ea7d12a75a743d5ea 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -25,6 +25,7 @@
+
@@ -256,6 +257,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable/ic_account_manager_screen.xml b/res/drawable/ic_account_manager_screen.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5a7778b902875e9f25f3520a6a19259ab44a1b87
--- /dev/null
+++ b/res/drawable/ic_account_manager_screen.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
diff --git a/res/drawable/ic_find_my_device.xml b/res/drawable/ic_find_my_device.xml
new file mode 100644
index 0000000000000000000000000000000000000000..dd15df1d22c664768b6ea89a994618f91341b434
--- /dev/null
+++ b/res/drawable/ic_find_my_device.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/drawable/logo.xml b/res/drawable/logo.xml
index 1828e873ada7a9d68b7dc4f0b69acc30925f6144..942971bd0bc7ffda5d3ca0eb0fb2dab262995451 100644
--- a/res/drawable/logo.xml
+++ b/res/drawable/logo.xml
@@ -1,17 +1,25 @@
-
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="1024.0"
+ android:viewportHeight="1024.0">
+ android:fillColor="#FFFFFF"
+ android:pathData="M511.9,578.8c-65.6,0 -119,-53.4 -119,-119c0,-65.6 53.4,-119 119,-119s119,53.4 119,119c0,12.4 -10.1,22.5 -22.5,22.5h-96.5c-12.4,0 -22.5,-10.1 -22.5,-22.5c0,-12.4 10.1,-22.5 22.5,-22.5h70.5c-9.5,-29.8 -37.6,-51.5 -70.5,-51.5c-40.8,0 -74,33.2 -74,74c0,40.8 33.2,74 74,74c12.4,0 22.5,10.1 22.5,22.5C534.4,568.7 524.3,578.8 511.9,578.8z" />
diff --git a/res/layout/setup_e_account_manager.xml b/res/layout/setup_e_account_manager.xml
new file mode 100644
index 0000000000000000000000000000000000000000..e9abf98c4b895aceb6713a9721891cb1c9c01904
--- /dev/null
+++ b/res/layout/setup_e_account_manager.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/setup_find_my_device.xml b/res/layout/setup_find_my_device.xml
new file mode 100644
index 0000000000000000000000000000000000000000..6532057271480f792c053cce6e3f82ec4b037886
--- /dev/null
+++ b/res/layout/setup_find_my_device.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/setup_parental_control.xml b/res/layout/setup_parental_control.xml
new file mode 100644
index 0000000000000000000000000000000000000000..6d36ee0f85a93c182c3a10e8240caed8a98519c5
--- /dev/null
+++ b/res/layout/setup_parental_control.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/update_recovery_page.xml b/res/layout/update_recovery_page.xml
index 6ecc3667fc41803c88462d614adb2f2d061b3e6b..220413de9b3f8a747460163579321f5ed4b0d2a7 100644
--- a/res/layout/update_recovery_page.xml
+++ b/res/layout/update_recovery_page.xml
@@ -53,7 +53,7 @@
diff --git a/res/raw/lineage_wizard_script.xml b/res/raw/lineage_wizard_script.xml
index 7c87abd6344333d5ce0af067c8b6c838aa3ddbe5..fe7f1ed699a5815ada609940bb04d549a9f63e9e 100644
--- a/res/raw/lineage_wizard_script.xml
+++ b/res/raw/lineage_wizard_script.xml
@@ -2,6 +2,7 @@
-
+
+
+
+
+
+
-
+
+
+
+
+
+
+
@@ -95,6 +114,12 @@
+
+
+
+
diff --git a/res/values-de/e_strings.xml b/res/values-de/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..16c492e39b91be0d25cee22985d6c4081c83dd8e
--- /dev/null
+++ b/res/values-de/e_strings.xml
@@ -0,0 +1,34 @@
+
+
+ Aktualisiert das Recovery mit dem OS
+ Aktualisiert das Recovery beim ersten Booten nach jeder Aktualisierung.
+ Recovery aktualisieren
+ Willkommen bei
+\n/e/OS
+ Anmelden
+ Konto erstellen
+ Anmelden
+ Melde dich mit deiner e.email oder murena.io ID an, um dein persönliches Konto mit diesem Telefon zu verknüpfen. Dies wird die Synchronisation von E-Mails, Kontakten, Kalenderereignissen, Bilder, Videos, Notizen und Aufgaben zwischen diesem Telefon und deiner persönlichen Cloud ermöglichen.
+ Synchronisiere dein Cloud-Konto
+ Elternaufsicht aktivieren
+ Elternaufsicht einstellen
+ Diese App bietet einen Schutz gegen unangemessene Inhalte für Ihre Kinder und Jugendliche. Sie können diese Funktion aktivieren, wenn Sie Ihr Gerät den Kindern leihen oder wenn das Gerät für sie bestimmt ist. Für mehr Informationen besuchen Sie bitte
+ Find my Device aktivieren
+ Find my Device einrichten
+ Find my Device hilft Ihnen, den Standort dieses Telefons zu ermitteln, falls Sie es verlegt haben.
+ Erstellen Sie einen Geheimcode und senden Sie ihn einfach per SMS an dieses Gerät. Es antwortet automatisch mit den Koordinaten Ihres Telefons.
+
\ No newline at end of file
diff --git a/res/values-es/e_strings.xml b/res/values-es/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c0061f0b3d7c6108baba62505d542860e46b6705
--- /dev/null
+++ b/res/values-es/e_strings.xml
@@ -0,0 +1,31 @@
+
+
+ Bienvenido a
+\n/e/OS
+ Iniciar sesión
+ Crear Cuenta
+ Actualizar Recovery junto con el sistema operativo
+ Actualiza Recovery en el primer arranque posterior a cada actualización.
+ Actualizar Recovery
+ Iniciar sesión
+ Inicia sesión con tu ID de e.email o murena.io para conectar tu cuenta personal con este teléfono. Esto te permitirá sincronizar tus correos electrónicos, contactos, calendario, imágenes, vídeos, notas y tareas entre este teléfono y tu nube personal.
+ Sincroniza tu cuenta en la nube
+ Activar Find my Device
+ Configurar Find my Device
+ Find my Device le ayudará a localizar este teléfono en caso de pérdida.
+ Genere un código secreto y envíelo simplemente por SMS a este dispositivo; responderá automáticamente con las coordenadas de su teléfono.
+
\ No newline at end of file
diff --git a/res/values-fr/e_strings.xml b/res/values-fr/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..2361efdab86a059418291f374f5b489b8f201504
--- /dev/null
+++ b/res/values-fr/e_strings.xml
@@ -0,0 +1,34 @@
+
+
+ Bienvenue sur
+\n/e/OS
+ Se connecter
+ Créer un compte
+ Se connecter
+ Identifiez-vous avec votre identifiant e.email ou murena.io pour connecter votre compte personnel avec ce téléphone. Cela activera la synchronisation de vos e-mails, contacts, événements de calendriers, images, vidéos, notes et tâches entre ce téléphone et votre cloud personnel.
+ Synchronisez votre compte cloud
+ Mettre à jour le Recovery en même temps que l\'OS
+ Met à jour le Recovery lors du premier démarrage suivant chaque mise à jour.
+ Mettre à jour le Recovery
+ Cette application propose une protection contre les contenus inappropriés pour vos enfants et adolescents. Vous pouvez activer cette fonctionnalité quand vous prêtez votre téléphone à votre enfant ou si cela est leur appareil. Pour en savoir plus à ce sujet, veuillez aller sur
+ Activez le Contrôle Parental
+ Paramétrez le Contrôle Parental
+ Activer Find my Device
+ Configurer Find my Device
+ Find my Device vous aidera à retrouver l\'emplacement de ce téléphone en cas de perte.
+ Générez un code secret, envoyez-le simplement à cet appareil par SMS, et il répondra automatiquement avec les coordonnées de votre téléphone.
+
\ No newline at end of file
diff --git a/res/values-is/e_strings.xml b/res/values-is/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ee7d4a80ea76eaf7cf8947bf13558590fe52ad8b
--- /dev/null
+++ b/res/values-is/e_strings.xml
@@ -0,0 +1,30 @@
+
+
+ Samstilltu skýjaaðganginn þinn
+ Skráðu inn með e.email eða murena.io auðkenni til að tengjast persónulegum aðgangi þínum á þessum síma. Þetta mun samstilla tölvupóstana þína, tengiliði, dagatalsatburði, myndir, myndskeið, glósur og verkefni á milli símans og persónulega tölvuskýsins þíns.
+ Skrá inn
+ Búa til aðgang
+ Skrá inn
+ Velkomin í
+\n/e/OS
+ Uppfæra endurheimtingu
+ Uppfærir endurheimtingardiskmynd í fyrstu ræsingu á eftir hverri uppfærslu.
+ Uppfæra endurheimtingu samhliða uppfærslum stýrikerfis
+ Virkja barnalæsingu
+ Setja upp barnalæsingu
+ Þetta forrit veitir vörn gegn óviðeigandi efni fyrir börnin þín og unglinga. Þú getur virkjað þessa eiginleika þegar þú lánar símann þinn til barns eða haft þetta virkt á tækjunum þeirra. Til að sjá meira um þetta, skaltu fara á
+
\ No newline at end of file
diff --git a/res/values-it/e_strings.xml b/res/values-it/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..869444cd54857bdf80951aa8bde70739d776d020
--- /dev/null
+++ b/res/values-it/e_strings.xml
@@ -0,0 +1,31 @@
+
+
+ Accedi
+ Accedi con il tuo ID e.email o murena.io per collegare l\'account a questo telefono. In questo modo sarà possibile sincronizzare email, contatti, eventi del calendario, immagini, video, note e attività tra questo telefono e il proprio cloud.
+ Sincronizza l\'account cloud
+ Aggiorna la Recovery insieme al SO
+ Aggiorna la Recovery al primo riavvio sucessivo ad ogni aggiornamento.
+ Aggiorna Recovery
+ Benvenuto a
+\n/e/OS
+ Accedi
+ Crea Account
+ Attiva Find my Device
+ Configura Find my Device
+ Find my Device ti aiuterà a individuare la posizione di questo telefono in caso di smarrimento.
+ Genera un codice segreto e invialo semplicemente tramite SMS a questo dispositivo; risponderà automaticamente al messaggio con le coordinate del tuo telefono.
+
\ No newline at end of file
diff --git a/res/values-ja/e_strings.xml b/res/values-ja/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b029acefd6cb6179273667666360aae93ea3cea8
--- /dev/null
+++ b/res/values-ja/e_strings.xml
@@ -0,0 +1,13 @@
+
+
+ クラウドのアカウントと同期
+ ログイン
+ アカウントを作成
+ サインイン
+ /e/OS
+\nにようこそ
+ リカバリーのアップデート
+ e.emailまたはmurena.ioのIDでログインして、この電話とあなたのアカウントを接続すると、あなたの電子メール、連絡先、カレンダーのイベント、画像、動画、メモ、タスクを、この電話とあなたの個人用クラウドの間で同期できます。
+ 各アップデートの直後の最初の起動時にリカバリーをアップデート。
+ OSとリカバリーを同時にアップデート
+
\ No newline at end of file
diff --git a/res/values-nl/e_strings.xml b/res/values-nl/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b1f2bfad39369075a65432c192e24d11f92d2c61
--- /dev/null
+++ b/res/values-nl/e_strings.xml
@@ -0,0 +1,27 @@
+
+
+ Inloggen
+ Werk Herstel bij samen met het OS
+ Werkt Herstel bij tijdens de eerste opstart na elke update.
+ Herstel bijwerken
+ Welkom bij
+\n/e/OS
+ Account aanmaken
+ Inloggen
+ Log in met je e.email of murena.io ID om jouw persoonlijk account te verbinden met deze telefoon. Dit zal synchronisatie inschakelen voor e-mails, contacten, agenda items, afbeeldingen, video\'s, notities en taken tussen deze telefoon en je persoonlijke cloud.
+ Synchroniseer jouw cloud account
+
\ No newline at end of file
diff --git a/res/values-ru/e_strings.xml b/res/values-ru/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1c341355c56ab45a8503bfda4f5478a2bebd4cfe
--- /dev/null
+++ b/res/values-ru/e_strings.xml
@@ -0,0 +1,28 @@
+
+
+
+ Обновление Recovery наряду с ОС
+ Обновляет Recovery при первой загрузке после каждого обновления.
+ Обновление Recovery
+ Добро пожаловать
+\nв /e/OS
+ Войти
+ Войти
+ Войдите в систему с помощью e.email или murena.io ID , чтобы подключить свою личную учётную запись к этому телефону. Это позволит синхронизировать электронную почту, контакты, события календаря, изображения, видео, заметки и задачи между этим телефоном и вашим личным облаком.
+ Синхронизируйте свою облачную учётную запись
+ Создать учётную запись
+
\ No newline at end of file
diff --git a/res/values-sv/e_strings.xml b/res/values-sv/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f15d47658a25c6f0f1c94067e9c183436a00de7b
--- /dev/null
+++ b/res/values-sv/e_strings.xml
@@ -0,0 +1,30 @@
+
+
+ Skapa konto
+ Logga in
+ Välkommen till
+\n/e/OS
+ Uppdatera återställningsdata
+ Uppdaterar återställningsdata vid första start efter varje uppdatering.
+ Uppdatera återställningsdata tillsammans med operativsystemet
+ Synka ditt molnkonto
+ Logga in med ditt e.email- eller murena.io-konto för att ansluta ditt personliga konto med denna telefon. Detta kommer tillåta dig att synkronisera dina e-post, kalenderhändelser, bilder, videor, anteckningar och uppgifter mellan denna telefon och ditt personliga moln.
+ Logga in
+ Aktivera Föräldrakontroll
+ Ställ in föräldrakontroll
+ Denna app erbjuder skydd mot olämpligt innehåll för barn och tonåringar. Du kan aktivera funktionen när du lånar ut din telefon till ditt barn eller om det är deras enhet. För att ta reda på mer, gå till
+
\ No newline at end of file
diff --git a/res/values-uk/e_strings.xml b/res/values-uk/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f5144ce712aff2b30704b03e544a5212f465200b
--- /dev/null
+++ b/res/values-uk/e_strings.xml
@@ -0,0 +1,13 @@
+
+
+ Оновлення Recovery разом з системою
+ Вхід
+ Оновлення Recovery
+ Створити обліковий запис
+ Синхронізуйте свій обліковий запис
+ Оновлення Recovery при першому завантаженні після кожного оновлення.
+ Ласкаво просимо до
+\n/e/OS
+ Увійдіть за допомогою e.email або ідентифікатора murena.io, щоб зв\'язати ваш особистий акаунт з цим телефоном. Це дозволить синхронізувати ваші електронні листи, контакти, події календаря, фотографії, відео, нотатки та завдання на цьому телефоні та у вашій особистій хмарі.
+ Зареєструватися
+
\ No newline at end of file
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0363e102b0c87c6510fe7d95c1a8d748b43e8229
--- /dev/null
+++ b/res/values/arrays.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ google:redfin
+
+
diff --git a/res/values/e_strings.xml b/res/values/e_strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9cfc996a7c7e0eba8f13b5603afd7c16fb6f2aa3
--- /dev/null
+++ b/res/values/e_strings.xml
@@ -0,0 +1,41 @@
+
+
+
+
+ Sync your cloud account
+ Log in with your e.email or murena.io ID to connect your personal account with this phone. This will enable to synchronize your emails, contacts, calendar events, pictures, videos, notes and tasks across this phone and your personal cloud.
+ Log in
+
+ Create Account
+ Sign in
+
+ Welcome to \n/e/OS
+
+ Update Recovery
+ Updates Recovery on first boot subsequent to every update.
+ Update Recovery alongside the OS
+ Activate Parental Control
+ Set up Parental Control
+ This app offers protection against inappropriate content for your children and teenagers. You can activate this feature when lending your phone to your kid or if this is their device. To know more about it please go to
+ https://doc.e.foundation/support-topics/parental-control
+
+
+ Activate Find my Device
+ Set up Find my Device
+ Find my device will help you reveal this phone\'s location in case you can\'t find it.
+ Generate a secret code and simply send it to this device via SMS and it will automatically reply to your message with your phone\'s coordinates.
+
diff --git a/src/org/lineageos/setupwizard/EAccountManagerActivity.java b/src/org/lineageos/setupwizard/EAccountManagerActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..e6d6685c0a1b9587dd733523dbd463fc2bcb0960
--- /dev/null
+++ b/src/org/lineageos/setupwizard/EAccountManagerActivity.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2018-2021 E FOUNDATION
+ *
+ * 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 org.lineageos.setupwizard;
+
+import static org.lineageos.setupwizard.SetupWizardApp.ACCOUNT_TYPE_E;
+
+import androidx.activity.result.ActivityResult;
+
+import android.accounts.Account;
+import android.accounts.AccountManager;
+import android.content.Intent;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.View;
+
+import org.lineageos.setupwizard.util.SetupWizardUtils;
+
+public class EAccountManagerActivity extends SubBaseActivity {
+
+ public static final String TAG = EAccountManagerActivity.class.getSimpleName();
+
+ @Override
+ protected void onStartSubactivity() {
+ setNextAllowed(true);
+ findViewById(R.id.sign_in).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ launchAccountManagerSetup();
+ }
+ });
+ findViewById(R.id.create_account).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(SetupWizardApp.ACTION_CREATE_E_ACCOUNT);
+ startSubactivity(intent);
+ }
+ });
+ }
+
+ @Override
+ protected void onSubactivityResult(ActivityResult activityResult) {
+ Intent data = activityResult.getData();
+ if (data != null && data.getBooleanExtra("onBackPressed", false)) {
+ onStartSubactivity();
+ return;
+ // Check for back press from AccountManager activity
+ } else if (isEAccountAvailable()) {
+ Log.v(TAG, "An E account is already set up; skipping EAccountManagerActivity");
+ nextAction(RESULT_OK);
+ }
+ }
+
+ @Override
+ protected int getLayoutResId() {
+ return R.layout.setup_e_account_manager;
+ }
+
+ @Override
+ protected int getTitleResId() {
+ return R.string.e_account_manager_setup_title;
+ }
+
+ @Override
+ protected int getIconResId() {
+ return R.drawable.ic_account_manager_screen;
+ }
+
+ private void launchAccountManagerSetup() {
+ Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT)
+ .putExtra(Settings.EXTRA_ACCOUNT_TYPES, new String[]{ACCOUNT_TYPE_E});
+ startSubactivity(intent);
+ }
+
+ private boolean isEAccountAvailable() {
+ Account[] allAccounts = getSystemService(AccountManager.class).getAccounts();
+ for (Account account : allAccounts) {
+ if (account.type.equals(ACCOUNT_TYPE_E)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/src/org/lineageos/setupwizard/FindMyDeviceActivity.java b/src/org/lineageos/setupwizard/FindMyDeviceActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..544e432005ba667a6702a448e25febce821c1444
--- /dev/null
+++ b/src/org/lineageos/setupwizard/FindMyDeviceActivity.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2024 MURENA SAS
+ *
+ * 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 org.lineageos.setupwizard;
+
+import androidx.activity.result.ActivityResult;
+
+import android.content.ComponentName;
+import android.content.Intent;
+import android.net.Uri;
+import android.view.View;
+import android.os.Bundle;
+
+import android.util.Log;
+
+import org.lineageos.setupwizard.util.SetupWizardUtils;
+
+public class FindMyDeviceActivity extends SubBaseActivity {
+
+ public static final String TAG = FindMyDeviceActivity.class.getSimpleName();
+
+ private static boolean hasTelephonySupport = true;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ if (!SetupWizardUtils.hasTelephony(this)) {
+ Log.v(TAG, "Has no telephony support");
+ hasTelephonySupport = false;
+ onNavigateNext();
+ return;
+ }
+
+ setNextText(R.string.skip);
+ }
+
+ @Override
+ public void onRestart() {
+ super.onRestart();
+
+ if (!hasTelephonySupport) {
+ onNavigateNext();
+ return;
+ }
+ }
+
+
+ @Override
+ protected void onStartSubactivity() {
+ setNextAllowed(true);
+ findViewById(R.id.activate_find_my_device).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Log.v(TAG, "lauch find my device");
+ launchFindMyDevice();
+ }
+ });
+ }
+
+ @Override
+ protected void onSubactivityResult(ActivityResult activityResult) {
+ Intent data = activityResult.getData();
+ if (data != null && data.getBooleanExtra("onBackPressed", false)) {
+ onStartSubactivity();
+ return;
+ // Check for back press
+ } else if(activityResult.getResultCode() == RESULT_OK) {
+ onNavigateNext();
+ }
+ }
+
+ @Override
+ protected int getLayoutResId() {
+ return R.layout.setup_find_my_device;
+ }
+
+ @Override
+ protected int getTitleResId() {
+ return R.string.find_my_device_setup_title;
+ }
+
+ @Override
+ protected int getIconResId() {
+ return R.drawable.ic_find_my_device;
+ }
+
+ private void launchFindMyDevice() {
+ Intent intent = new Intent();
+ intent.setComponent(
+ new ComponentName("foundation.e.findmydevice",
+ "foundation.e.findmydevice.activity.FindMyDeviceActivity"));
+ startSubactivity(intent);
+ }
+}
diff --git a/src/org/lineageos/setupwizard/LocationSettingsActivity.java b/src/org/lineageos/setupwizard/LocationSettingsActivity.java
index 0e70e9c5619cc3cab4d7668169ba94bc5db17c3f..754dcbe4b56dc676b54b57b431903a1bb5069d45 100644
--- a/src/org/lineageos/setupwizard/LocationSettingsActivity.java
+++ b/src/org/lineageos/setupwizard/LocationSettingsActivity.java
@@ -1,6 +1,7 @@
/*
* SPDX-FileCopyrightText: 2016 The CyanogenMod Project
* SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
+ * SPDX-FileCopyrightText: 2018-2024 E FOUNDATION
* SPDX-License-Identifier: Apache-2.0
*/
@@ -13,6 +14,7 @@ import android.os.UserManager;
import android.provider.Settings;
import android.view.View;
import android.widget.CheckBox;
+import android.provider.Settings;
public class LocationSettingsActivity extends BaseSetupWizardActivity {
@@ -42,6 +44,8 @@ public class LocationSettingsActivity extends BaseSetupWizardActivity {
} else {
locationAgpsAccessView.setVisibility(View.GONE);
}
+ Settings.Global.putInt(getContentResolver(),
+ Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE,1);
}
@Override
diff --git a/src/org/lineageos/setupwizard/ParentalControlActivity.java b/src/org/lineageos/setupwizard/ParentalControlActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..4a49f37b21a86356d03e3faa924484f39b347b8f
--- /dev/null
+++ b/src/org/lineageos/setupwizard/ParentalControlActivity.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2024 MURENA SAS
+ *
+ * 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 org.lineageos.setupwizard;
+
+import androidx.activity.result.ActivityResult;
+
+import android.content.ComponentName;
+import android.content.Intent;
+import android.net.Uri;
+import android.view.View;
+import android.os.Bundle;
+import androidx.browser.customtabs.CustomTabsIntent;
+
+public class ParentalControlActivity extends SubBaseActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setNextText(R.string.skip);
+ }
+
+ @Override
+ protected void onStartSubactivity() {
+ setNextAllowed(true);
+ findViewById(R.id.activate_parental_control).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ launchParentalControl();
+ }
+ });
+ findViewById(R.id.more_info_textview).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ String docUrl = getString(R.string.more_info_text);
+ try {
+ CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder().setShowTitle(true).build();
+ customTabsIntent.launchUrl(getApplicationContext(), Uri.parse(docUrl));
+ } catch (Exception e) {
+ // Fallback to default browser
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(docUrl));
+ startActivity(intent);
+ }
+ }
+ });
+ }
+
+ @Override
+ protected void onSubactivityResult(ActivityResult activityResult) {
+ Intent data = activityResult.getData();
+ if (data != null && data.getBooleanExtra("onBackPressed", false)) {
+ onStartSubactivity();
+ return;
+ // Check for back press from Parental control activity
+ } else if(activityResult.getResultCode() == RESULT_OK) {
+ onNavigateNext();
+ }
+
+ }
+
+ @Override
+ protected int getLayoutResId() {
+ return R.layout.setup_parental_control;
+ }
+
+ @Override
+ protected int getTitleResId() {
+ return R.string.parental_control_setup_title;
+ }
+
+ @Override
+ protected int getIconResId() {
+ return R.drawable.ic_account_manager_screen;
+ }
+
+ private void launchParentalControl() {
+ Intent intent = new Intent();
+ intent.setComponent(new ComponentName("foundation.e.parentalcontrol", "foundation.e.parentalcontrol.MainActivity"));
+ startSubactivity(intent);
+ }
+}
diff --git a/src/org/lineageos/setupwizard/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java
index d635bfafefd49e6524fd5f09ddd6212082326ac3..e8d3df76e1aa17f20fbeaa3a30c92c99eee954df 100644
--- a/src/org/lineageos/setupwizard/SetupWizardApp.java
+++ b/src/org/lineageos/setupwizard/SetupWizardApp.java
@@ -1,6 +1,7 @@
/*
* SPDX-FileCopyrightText: 2013 The CyanogenMod Project
* SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
+ * SPDX-FileCopyrightText: 2022 The Calyx Institute
* SPDX-License-Identifier: Apache-2.0
*/
@@ -8,10 +9,12 @@ package org.lineageos.setupwizard;
import android.app.Application;
import android.app.StatusBarManager;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
+import android.service.oemlock.OemLockManager;
import android.util.Log;
import org.lineageos.setupwizard.util.SetupWizardUtils;
@@ -26,6 +29,7 @@ public class SetupWizardApp extends Application {
"com.stevesoltys.seedvault.RESTORE_BACKUP";
public static final String ACTION_EMERGENCY_DIAL = "com.android.phone.EmergencyDialer.DIAL";
public static final String ACTION_LOAD = "com.android.wizard.LOAD";
+ public static final String ACTION_CREATE_E_ACCOUNT = "foundation.e.accountmanager.ui.setup.CreateAccountActivity";
public static final String EXTRA_WIZARD_BUNDLE = "wizardBundle";
public static final String EXTRA_SCRIPT_URI = "scriptUri";
@@ -43,6 +47,7 @@ public class SetupWizardApp extends Application {
public static final String UPDATE_RECOVERY_PROP = "persist.vendor.recovery_update";
public static final String NAVIGATION_OPTION_KEY = "navigation_option";
+ public static final String ACCOUNT_TYPE_E = "e.foundation.webdav.eelo";
public static final int RADIO_READY_TIMEOUT = 10 * 1000;
@@ -64,6 +69,25 @@ public class SetupWizardApp extends Application {
}
sStatusBarManager = SetupWizardUtils.disableStatusBar(this);
mHandler.postDelayed(mRadioTimeoutRunnable, SetupWizardApp.RADIO_READY_TIMEOUT);
+ // If the bootloader is locked, and OEM unlocking is allowed, turn it off
+ if (!Build.IS_EMULATOR && SetupWizardUtils.isOwner()
+ && !SetupWizardUtils.isBootloaderUnlocked(this)
+ && SetupWizardUtils.isOemunlockAllowed(this)) {
+ String manufacturer = Build.MANUFACTURER.toLowerCase();
+ String device = Build.DEVICE.toLowerCase();
+ String[] allowedBrandsAndDevices = getResources().getStringArray(R.array.allowed_brands_and_devices);
+
+ for (String brandAndDevice : allowedBrandsAndDevices) {
+ String[] parts = brandAndDevice.split(":");
+ String allowedBrand = parts[0];
+ String allowedDevice = parts[1];
+
+ if (manufacturer.equals(allowedBrand) && device.equals(allowedDevice)) {
+ getSystemService(OemLockManager.class).setOemUnlockAllowedByUser(false);
+ break;
+ }
+ }
+ }
if (SetupWizardUtils.hasGMS(this)) {
SetupWizardUtils.disableHome(this);
if (SetupWizardUtils.isOwner()) {
diff --git a/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java b/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java
index 7ce308085a2559886213990ce6fd2841883c4ed6..af3d3225f1ea11c92933a422da297a1154bd8f11 100644
--- a/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java
+++ b/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java
@@ -29,7 +29,7 @@ public class UpdateRecoveryActivity extends BaseSetupWizardActivity {
super.onCreate(savedInstanceState);
mSetupWizardApp = (SetupWizardApp) getApplication();
getGlifLayout().setDescriptionText(getString(R.string.update_recovery_full_description,
- getString(R.string.update_recovery_description),
+ getString(R.string.update_recovery_description_e),
getString(R.string.update_recovery_warning)));
if (!SetupWizardUtils.hasRecoveryUpdater(this)) {
@@ -77,7 +77,7 @@ public class UpdateRecoveryActivity extends BaseSetupWizardActivity {
@Override
protected int getTitleResId() {
- return R.string.update_recovery_title;
+ return R.string.update_recovery_title_e;
}
@Override
diff --git a/src/org/lineageos/setupwizard/WelcomeActivity.java b/src/org/lineageos/setupwizard/WelcomeActivity.java
index 4dc594e27ead30c7ffda01e430e790f97ac910b3..2e12426546444da8ab8c4eeb5efe722f1143a40f 100644
--- a/src/org/lineageos/setupwizard/WelcomeActivity.java
+++ b/src/org/lineageos/setupwizard/WelcomeActivity.java
@@ -57,7 +57,7 @@ public class WelcomeActivity extends SubBaseActivity {
if (SetupWizardUtils.isManagedProfile(this)) {
welcomeTitle.setText(getString(R.string.setup_managed_profile_welcome_message));
} else {
- welcomeTitle.setText(getString(R.string.setup_welcome_message,
+ welcomeTitle.setText(getString(R.string.setup_welcome_message_e,
getString(R.string.os_name)));
}
}
diff --git a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
index 831552308572119ff72a6977b1f28b0640f6e79a..3747231ddf5e7d07b39655bec92b806e102fe0b6 100644
--- a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
+++ b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
@@ -1,6 +1,7 @@
/*
* SPDX-FileCopyrightText: 2013 The CyanogenMod Project
* SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
+ * SPDX-FileCopyrightText: 2022 The Calyx Institute
* SPDX-License-Identifier: Apache-2.0
*/
@@ -46,6 +47,7 @@ import android.os.UserManager;
import android.provider.Settings;
import android.sysprop.TelephonyProperties;
import android.telephony.SubscriptionInfo;
+import android.service.oemlock.OemLockManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
@@ -191,7 +193,7 @@ public class SetupWizardUtils {
Settings.Secure.TV_USER_SETUP_COMPLETE, 1);
}
- handleEnableMetrics(context);
+ handleDisableMetrics(context);
handleNavKeys(context);
handleRecoveryUpdate();
handleNavigationOption();
@@ -232,6 +234,22 @@ public class SetupWizardUtils {
};
}
+ public static boolean isBootloaderUnlocked(Context context) {
+ OemLockManager oemLockManager = context.getSystemService(OemLockManager.class);
+ if (oemLockManager != null) {
+ return oemLockManager.isDeviceOemUnlocked();
+ }
+ return true; // Default to unlocked
+ }
+
+ public static boolean isOemunlockAllowed(Context context) {
+ OemLockManager oemLockManager = context.getSystemService(OemLockManager.class);
+ if (oemLockManager != null) {
+ return oemLockManager.isOemUnlockAllowed();
+ }
+ return true; // Default to unlock allowed
+ }
+
/**
* Disable the Home component, which is presumably SetupWizardActivity at this time.
*/
@@ -271,15 +289,9 @@ public class SetupWizardUtils {
enabledState, DONT_KILL_APP);
}
- private static void handleEnableMetrics(Context context) {
- Bundle privacyData = SetupWizardApp.getSettingsBundle();
- if (privacyData != null
- && privacyData.containsKey(KEY_SEND_METRICS)) {
- LineageSettings.Secure.putInt(context.getContentResolver(),
- LineageSettings.Secure.STATS_COLLECTION,
- privacyData.getBoolean(KEY_SEND_METRICS)
- ? 1 : 0);
- }
+ private static void handleDisableMetrics(Context context) {
+ LineageSettings.Secure.putInt(context.getContentResolver(),
+ LineageSettings.Secure.STATS_COLLECTION, 0);
}
private static void handleNavKeys(Context context) {