diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..f01e7779057d55c3e2f9d091c60879e100af9deb
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,7 @@
+stages:
+ - update-from-upstream
+
+include:
+ - project: 'e/templates'
+ ref: master
+ file: '/gitlab-ci/.gitlab-ci-import-updates-from-upstream.yml'
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d68f421c5873451d7da4175fe99a0b94a30d5b7c..3d4413a9ebd6777dc96bdfcd12c416b5c4231396 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2,6 +2,7 @@
+
+
+
+
+
diff --git a/res/drawable/logo.xml b/res/drawable/logo.xml
index ffaf10affc26be441a97b9c732ea64967b2700ec..942971bd0bc7ffda5d3ca0eb0fb2dab262995451 100644
--- a/res/drawable/logo.xml
+++ b/res/drawable/logo.xml
@@ -1,6 +1,6 @@
-
+ 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/update_recovery_page.xml b/res/layout/update_recovery_page.xml
index 5e86aeeaa51c733d71c1441eb70dc741e3232863..61850dcb4a1d02aaab5ecde465bfc4c50bbf3933 100644
--- a/res/layout/update_recovery_page.xml
+++ b/res/layout/update_recovery_page.xml
@@ -65,7 +65,7 @@
diff --git a/res/raw/lineage_wizard_script.xml b/res/raw/lineage_wizard_script.xml
index cb404ebfac5795b2855e59c107661e26c76ab543..793177f8f431ce71c83bf02c14a3a292965e9626 100644
--- a/res/raw/lineage_wizard_script.xml
+++ b/res/raw/lineage_wizard_script.xml
@@ -3,6 +3,7 @@
@@ -68,12 +71,18 @@
-
+
+
+
+
+
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cff3db53dd80c5288dc65e6b81aa741f1fa6a2e7..70bf8d1ee9a1525a9ce87a68759485d7a0b16af0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2,6 +2,7 @@
+ 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
diff --git a/src/org/lineageos/setupwizard/EAccountManagerActivity.java b/src/org/lineageos/setupwizard/EAccountManagerActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..c09c38dd258f00da62c03dd0d7c9eae941be2129
--- /dev/null
+++ b/src/org/lineageos/setupwizard/EAccountManagerActivity.java
@@ -0,0 +1,103 @@
+/*
+ * 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 static org.lineageos.setupwizard.SetupWizardApp.REQUEST_CODE_SETUP_ACCOUNT_TYPE_E;
+
+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);
+ startActivityForResult(intent, SetupWizardApp.REQUEST_CODE_CREATE_E_ACCOUNT);
+ }
+ });
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ if(resultCode == RESULT_OK) {
+ onNavigateNext();
+ }
+ }
+
+ @Override
+ protected void onSubactivityResult(int requestCode, int resultCode, Intent data) {
+ // AccountManager activity always return resultCode as 0, check manually
+ if (isEAccountAvailable()) {
+ Log.v(TAG, "An E account is already set up; skipping EAccountManagerActivity");
+ nextAction(RESULT_OK);
+ } else {
+ super.onSubactivityResult(requestCode, resultCode, data);
+ }
+ }
+
+ @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, REQUEST_CODE_SETUP_ACCOUNT_TYPE_E);
+ }
+
+ 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/FinishActivity.java b/src/org/lineageos/setupwizard/FinishActivity.java
index 95e316615dc72d478f0e1783ffe528d6aa4e5245..9d033427b0ded3934f4ecaa2b8f926d3fe47031c 100644
--- a/src/org/lineageos/setupwizard/FinishActivity.java
+++ b/src/org/lineageos/setupwizard/FinishActivity.java
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017-2020, 2022 The LineageOS Project
+ * * Copyright (C) 2018-2022 E FOUNDATION
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -175,7 +176,7 @@ public class FinishActivity extends BaseSetupWizardActivity {
}
private void completeSetup() {
- handleEnableMetrics(mSetupWizardApp);
+ handleDisableMetrics(mSetupWizardApp);
handleNavKeys(mSetupWizardApp);
handleRecoveryUpdate(mSetupWizardApp);
handleNavigationOption(mSetupWizardApp);
@@ -189,15 +190,9 @@ public class FinishActivity extends BaseSetupWizardActivity {
startActivityForResult(intent, NEXT_REQUEST);
}
- private static void handleEnableMetrics(SetupWizardApp setupWizardApp) {
- Bundle privacyData = setupWizardApp.getSettingsBundle();
- if (privacyData != null
- && privacyData.containsKey(KEY_SEND_METRICS)) {
- LineageSettings.Secure.putInt(setupWizardApp.getContentResolver(),
- LineageSettings.Secure.STATS_COLLECTION,
- privacyData.getBoolean(KEY_SEND_METRICS)
- ? 1 : 0);
- }
+ private static void handleDisableMetrics(SetupWizardApp setupWizardApp) {
+ LineageSettings.Secure.putInt(setupWizardApp.getContentResolver(),
+ LineageSettings.Secure.STATS_COLLECTION, 0);
}
private static void handleNavKeys(SetupWizardApp setupWizardApp) {
diff --git a/src/org/lineageos/setupwizard/LocationSettingsActivity.java b/src/org/lineageos/setupwizard/LocationSettingsActivity.java
index 846020bb0a829fbbf6578b166cb5c8db0cc49917..d547dedd7689c0607e4dadd073dccb49c7e28eb2 100644
--- a/src/org/lineageos/setupwizard/LocationSettingsActivity.java
+++ b/src/org/lineageos/setupwizard/LocationSettingsActivity.java
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017-2021 The LineageOS Project
+ * Copyright (C) 2020-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.
@@ -22,6 +23,7 @@ import android.os.Bundle;
import android.os.UserHandle;
import android.view.View;
import android.widget.CheckBox;
+import android.provider.Settings;
public class LocationSettingsActivity extends BaseSetupWizardActivity {
@@ -45,6 +47,8 @@ public class LocationSettingsActivity extends BaseSetupWizardActivity {
new UserHandle(UserHandle.USER_CURRENT));
mLocationAccess.setChecked(!mLocationAccess.isChecked());
});
+ Settings.Global.putInt(getContentResolver(),
+ Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE,1);
}
@Override
diff --git a/src/org/lineageos/setupwizard/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java
index dcfe3bc8003f97847d4114ee3d51488be7199c6c..a1d7f938c4271c8769e7487f89cfd906e6661777 100644
--- a/src/org/lineageos/setupwizard/SetupWizardApp.java
+++ b/src/org/lineageos/setupwizard/SetupWizardApp.java
@@ -46,6 +46,7 @@ public class SetupWizardApp extends Application {
public static final String ACTION_EMERGENCY_DIAL = "com.android.phone.EmergencyDialer.DIAL";
public static final String ACTION_NEXT = "com.android.wizard.NEXT";
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_HAS_MULTIPLE_USERS = "hasMultipleUsers";
public static final String EXTRA_TITLE = "title";
@@ -66,6 +67,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 REQUEST_CODE_SETUP_NETWORK = 0;
public static final int REQUEST_CODE_SETUP_CAPTIVE_PORTAL = 4;
@@ -73,6 +75,8 @@ public class SetupWizardApp extends Application {
public static final int REQUEST_CODE_SETUP_BIOMETRIC = 7;
public static final int REQUEST_CODE_SETUP_LOCKSCREEN = 9;
public static final int REQUEST_CODE_RESTORE = 10;
+ public static final int REQUEST_CODE_SETUP_ACCOUNT_TYPE_E = 11;
+ public static final int REQUEST_CODE_CREATE_E_ACCOUNT = 1;
public static final int RADIO_READY_TIMEOUT = 10 * 1000;
diff --git a/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java b/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java
index 2296804791550ee5266ed5bc37b33ed0c41bccfa..5e2be77425ced5a89885258b59ed6d251c7881e9 100644
--- a/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java
+++ b/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java
@@ -42,7 +42,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)) {
@@ -96,7 +96,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 b115f8101ba40e83d379354c422b99d9cf56d556..b169660f084d26366d8479177591cc387551b642 100644
--- a/src/org/lineageos/setupwizard/WelcomeActivity.java
+++ b/src/org/lineageos/setupwizard/WelcomeActivity.java
@@ -50,8 +50,7 @@ public class WelcomeActivity extends BaseSetupWizardActivity {
FooterButtonStyleUtils.applySecondaryButtonPartnerResource(this, emergButton, true);
TextView welcomeTitle = findViewById(R.id.welcome_title);
- welcomeTitle.setText(getString(R.string.setup_welcome_message,
- getString(R.string.os_name)));
+ welcomeTitle.setText(getString(R.string.setup_welcome_message_e));
}
@Override