diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index bf93c4105ef9096037427acb333fd4f7ab18cc02..7f0c8474e42c1198d7f2cc09586503fb0154e453 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2,6 +2,7 @@
+
+
+
+
+
diff --git a/res/layout/setup_e_account_manager.xml b/res/layout/setup_e_account_manager.xml
new file mode 100644
index 0000000000000000000000000000000000000000..bee46e4d630a32a0aacec549c6e90e9e010727f9
--- /dev/null
+++ b/res/layout/setup_e_account_manager.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/raw/cm_wizard_script.xml b/res/raw/cm_wizard_script.xml
index 9c0c38ac23389175f8fa78ec784888215c923cf3..dd7b09997711982d5c9cb28d2acbc99a8c703465 100644
--- a/res/raw/cm_wizard_script.xml
+++ b/res/raw/cm_wizard_script.xml
@@ -70,9 +70,13 @@
-
+
+
+
+
+
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index ff14b5d483d488352068ec12120b8d2c179f3921..01da9d26e33f714bb60ae603db96be43067fe0af 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -84,4 +84,10 @@
Protéger votre téléphone
"Protéger l\'appareil"\" et exiger code, schéma ou mot de passe pour déverrouiller l\'écran\"
Configurer
+
+
+ Configurer votre compte /e/
+ Permet d\'enregistrer vos identifiant /e/ dans le gestionnaire de compte afin de pouvoir les réutiliser simplement dans d\'autres applications.
+ Configurer
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d112785a346b0842f06885baf0f161860ad89b7e..54f4691d01fd735d2abbbbdc710b37df2c00da5d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -110,6 +110,8 @@
Set up
- Cannot start eelo synchronizer
+ Configure /e/ account
+ Save your /e/ identifiers in the account manager, thus you can simply reuse them later in other applications.
+ Set up
diff --git a/src/com/cyanogenmod/setupwizard/EAccountManagerActivity.java b/src/com/cyanogenmod/setupwizard/EAccountManagerActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..e1c3fac3280c57523ce181e44f5522fcdc5befdd
--- /dev/null
+++ b/src/com/cyanogenmod/setupwizard/EAccountManagerActivity.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2018 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 com.cyanogenmod.setupwizard;
+
+import android.content.Intent;
+import android.view.View;
+
+import android.accounts.Account;
+import android.accounts.AccountManager;
+import android.accounts.AccountManagerCallback;
+import android.accounts.AccountManagerFuture;
+import android.os.Bundle;
+
+public class EAccountManagerActivity extends SubBaseActivity {
+
+ public static final String TAG = EAccountManagerActivity.class.getSimpleName();
+
+ private static boolean isInit = false;
+ private AccountManager accountManager = null;
+
+ @Override
+ protected void onStartSubactivity() {
+ setNextAllowed(true);
+ findViewById(R.id.setup_e_account_manager).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ launchAccountManagerSetup();
+ }
+ });
+ }
+
+ @Override
+ protected int getTransition() {
+ return TRANSITION_ID_SLIDE;
+ }
+
+ @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() {
+
+ isInit = true;
+
+ try {
+ accountManager = AccountManager.get(this);
+ accountManager.addAccount("bitfire.at.davdroid.eelo", null, null, null, this, null, null);
+ }
+ catch (Exception e) {}
+ finally {}
+ }
+
+ @Override
+ protected int getSubactivityNextTransition() {
+ return TRANSITION_ID_SLIDE;
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+ if (isInit == false)
+ return;
+
+ try {
+ Account[] accounts = accountManager.getAccounts();
+ if (accounts != null) {
+ // An eelo account has been created, goto the next screen
+ onNavigateNext();
+ }
+ }
+ catch (Exception e) {
+ onNavigateNext();
+ }
+ finally {}
+
+ }
+
+}
diff --git a/src/com/cyanogenmod/setupwizard/FinishActivity.java b/src/com/cyanogenmod/setupwizard/FinishActivity.java
index e66e9b65e3ae6583dec2b77e73012bdb26f45810..9411c1d935ce87b5903970cc5f018bfe0f8de3d4 100644
--- a/src/com/cyanogenmod/setupwizard/FinishActivity.java
+++ b/src/com/cyanogenmod/setupwizard/FinishActivity.java
@@ -64,29 +64,11 @@ public class FinishActivity extends BaseSetupWizardActivity {
private final Handler mHandler = new Handler();
private volatile boolean mIsFinishing = false;
-
- private final static int EELO_SYNCHRONIZER_REQUEST_CODE = 0x01;
-
- private boolean hasError = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- hasError = false;
-
- try {
- Intent intent = new Intent("xxx.io.eelo.drive.LAUNCHER"); // TODO static
- intent.putExtra("EELO_SETTINGS_LAUNCHER", "SETUP_WIZARD");
-
- startActivityForResult(intent, EELO_SYNCHRONIZER_REQUEST_CODE);
-
- } catch (android.content.ActivityNotFoundException err) {
-
- hasError = true;
-
- }
-
mSetupWizardApp = (SetupWizardApp) getApplication();
//mSetupWizardApp.getSettingsBundle().putBoolean(KEY_SEND_METRICS, false); // /e/ do *not* send metrics by default.
@@ -96,31 +78,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
EnableAccessibilityController.getInstance(getApplicationContext());
setNextText(R.string.start);
}
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-
- //super must be called
- //super.onActivityResult(requestCode, resultCode, data);
-
- if (requestCode==EELO_SYNCHRONIZER_REQUEST_CODE) {
- //String message=data.getStringExtra("MESSAGE");
- //alert(message);
-
- if (resultCode == RESULT_CANCELED) {
- //This is a BACK, or the Activity has not been found.
- if (!hasError) {
- // If the activity has not been found do *NOT* return back! (we will be in a (custom) loop)
- onBackPressed();
- }
- }
-
-
- }
-
-
-
- }
@Override
protected int getTransition() {
diff --git a/src/com/cyanogenmod/setupwizard/SetupWizardExitActivity.java b/src/com/cyanogenmod/setupwizard/SetupWizardExitActivity.java
index 69388254883c098be07a90255cf14587bb8d6b9b..a27ed35722036ade9c8b5ee68a35aa9dff1523d8 100644
--- a/src/com/cyanogenmod/setupwizard/SetupWizardExitActivity.java
+++ b/src/com/cyanogenmod/setupwizard/SetupWizardExitActivity.java
@@ -51,7 +51,6 @@ public class SetupWizardExitActivity extends BaseSetupWizardActivity {
SetupWizardUtils.enableCaptivePortalDetection(this);
PhoneMonitor.onSetupFinished();
launchHome();
- launchEeloSynchronizer();
finish();
applyForwardTransition(TRANSITION_ID_FADE);
Intent i = new Intent();
@@ -64,23 +63,5 @@ public class SetupWizardExitActivity extends BaseSetupWizardActivity {
.addCategory("android.intent.category.HOME")
.addFlags(FLAG_ACTIVITY_NEW_TASK|FLAG_ACTIVITY_CLEAR_TASK));
}
-
- /*
- * Launch eelo synchronizer service
- */
- private final void launchEeloSynchronizer() {
- try {
- IntentFilter filter = new IntentFilter();
- filter.addAction(Intent.ACTION_BOOT_COMPLETED);
- ComponentName receiver = new ComponentName("io.eelo.synchronizer",
- "io.eelo.synchronizer.triggers.BootCompleteReceiver");
- PackageManager pm = getPackageManager();
- pm.setComponentEnabledSetting(receiver,
- PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
- PackageManager.DONT_KILL_APP);
- } catch (java.lang.Throwable t) {
- //Toast.makeText(getApplicationContext(), getString(R.string.eelo_start_synchronizer_err), Toast.LENGTH_LONG).show();
- }
- }
}