From 93d19c3a656a3b969d3a3ee2c6b9f65701c4ffec Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Sun, 2 Jun 2019 14:47:39 +0200 Subject: [PATCH 01/11] SetupWizard: Add /e/ account manager page Change-Id: I199bf14873adc72f05f99c626a339e35fd358f29 --- AndroidManifest.xml | 13 ++++ res/drawable/ic_account_manager_screen.xml | 29 ++++++++ res/layout/setup_e_account_manager.xml | 61 +++++++++++++++ res/raw/lineage_wizard_script.xml | 15 +++- res/values/strings.xml | 5 ++ .../setupwizard/EAccountManagerActivity.java | 74 +++++++++++++++++++ .../lineageos/setupwizard/SetupWizardApp.java | 1 + 7 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 res/drawable/ic_account_manager_screen.xml create mode 100644 res/layout/setup_e_account_manager.xml create mode 100644 src/org/lineageos/setupwizard/EAccountManagerActivity.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 30d53571..c6825c9a 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -256,6 +256,19 @@ + + + + + + + + + + + + + diff --git a/res/layout/setup_e_account_manager.xml b/res/layout/setup_e_account_manager.xml new file mode 100644 index 00000000..89aba7a6 --- /dev/null +++ b/res/layout/setup_e_account_manager.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/raw/lineage_wizard_script.xml b/res/raw/lineage_wizard_script.xml index 7c87abd6..4d964ea8 100644 --- a/res/raw/lineage_wizard_script.xml +++ b/res/raw/lineage_wizard_script.xml @@ -2,6 +2,7 @@ - + + - + + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index fec0e846..b6e48bff 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2,6 +2,7 @@ @@ -82,4 +83,8 @@ Dark theme uses a black background to help keep battery alive longer on some screens Dark Light + + + Setup /e/ account + Save your /e/ identifiers in the account manager, therefore you can simply reuse them later in other applications. diff --git a/src/org/lineageos/setupwizard/EAccountManagerActivity.java b/src/org/lineageos/setupwizard/EAccountManagerActivity.java new file mode 100644 index 00000000..f6ebf4fc --- /dev/null +++ b/src/org/lineageos/setupwizard/EAccountManagerActivity.java @@ -0,0 +1,74 @@ +/* + * 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 android.accounts.Account; +import android.accounts.AccountManager; +import android.content.Intent; +import android.provider.Settings; +import android.util.Log; + +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); + } + + @Override + protected void onNextPressed() { + launchAccountManagerSetup(); + } + + @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/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java index d635bfaf..30228e9d 100644 --- a/src/org/lineageos/setupwizard/SetupWizardApp.java +++ b/src/org/lineageos/setupwizard/SetupWizardApp.java @@ -43,6 +43,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; -- GitLab From e08cad516fc78bca1726e73adf61047b786f4f08 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Tue, 14 Sep 2021 15:43:55 +0530 Subject: [PATCH 02/11] SetupWizard: Disable LineageOS metrics Change-Id: I55ab0172bf0d8f44ff9180cec4d2985ae237094f --- .../setupwizard/util/SetupWizardUtils.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java index fb107605..26ee2056 100644 --- a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java +++ b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java @@ -190,7 +190,7 @@ public class SetupWizardUtils { Settings.Secure.TV_USER_SETUP_COMPLETE, 1); } - handleEnableMetrics(context); + handleDisableMetrics(context); handleNavKeys(context); handleRecoveryUpdate(); handleNavigationOption(); @@ -270,15 +270,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) { -- GitLab From 4ff552b3aed8d211f2c2b5e1431e7c73b2c02891 Mon Sep 17 00:00:00 2001 From: Alexandre Roux D'Anzi Date: Mon, 29 Jun 2020 14:12:21 +0200 Subject: [PATCH 03/11] SetupWizard: Enable wifi location Change-Id: I256e9b008850200b60154c83f1e32e93de45a967 Signed-off-by: Aayush Gupta --- src/org/lineageos/setupwizard/LocationSettingsActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/lineageos/setupwizard/LocationSettingsActivity.java b/src/org/lineageos/setupwizard/LocationSettingsActivity.java index 0e70e9c5..754dcbe4 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 -- GitLab From 48733dda44c6952e07918eadef14f0e6aed43960 Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Wed, 30 Mar 2022 08:00:02 +0000 Subject: [PATCH 04/11] SetupWizard: Change eDrive strings according to our needs --- res/values/strings.xml | 5 +++-- src/org/lineageos/setupwizard/EAccountManagerActivity.java | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index b6e48bff..1955398c 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -85,6 +85,7 @@ Light - Setup /e/ account - Save your /e/ identifiers in the account manager, therefore you can simply reuse them later in other applications. + 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 diff --git a/src/org/lineageos/setupwizard/EAccountManagerActivity.java b/src/org/lineageos/setupwizard/EAccountManagerActivity.java index f6ebf4fc..21cb779c 100644 --- a/src/org/lineageos/setupwizard/EAccountManagerActivity.java +++ b/src/org/lineageos/setupwizard/EAccountManagerActivity.java @@ -32,6 +32,7 @@ public class EAccountManagerActivity extends SubBaseActivity { @Override protected void onStartSubactivity() { + setNextText(R.string.e_account_manager_setup_configure); setNextAllowed(true); } -- GitLab From a10adb1e74df97b1333c72503d6d00a36922072c Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Wed, 13 Apr 2022 17:14:00 +0530 Subject: [PATCH 05/11] Add create account functionality Change-Id: Ia9dc940aafdb6918808bd97fbb054dd5cd63b163 --- res/layout/setup_e_account_manager.xml | 27 ++++++++++++++++++- res/values/strings.xml | 3 +++ .../setupwizard/EAccountManagerActivity.java | 22 ++++++++++++--- .../lineageos/setupwizard/SetupWizardApp.java | 1 + 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/res/layout/setup_e_account_manager.xml b/res/layout/setup_e_account_manager.xml index 89aba7a6..e9abf98c 100644 --- a/res/layout/setup_e_account_manager.xml +++ b/res/layout/setup_e_account_manager.xml @@ -47,6 +47,31 @@ style="@style/SudItemTitle.GlifDescription" android:text="@string/e_account_manager_setup_summary" /> +