diff --git a/README.md b/README.md
index 39db91ac..c57a427e 100644
--- a/README.md
+++ b/README.md
@@ -9,8 +9,8 @@ Alfresco Mobile is based on top of our Alfresco Android SDK. More information on
## Where can I find it ?
-
+
@@ -45,7 +45,7 @@ Before your code can be accepted into the project you must also sign the Individ
## What's the code License ?
- Alfresco Mobile for Android 1.5
+ Alfresco Mobile for Android 1.6.2
Copyright © 2015 Alfresco Software, Ltd. and others.
diff --git a/alfresco-mobile-android/build.gradle b/alfresco-mobile-android/build.gradle
index 2e2d7020..2af5653a 100644
--- a/alfresco-mobile-android/build.gradle
+++ b/alfresco-mobile-android/build.gradle
@@ -27,7 +27,7 @@ android {
minSdkVersion 15
targetSdkVersion 22
- versionCode 60
+ versionCode 61
versionName VERSION_NAME
manifestPlaceholders = [PROVIDER_AUTHORITY: PROVIDER_AUTHORITY]
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/VersionNumber.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/VersionNumber.java
index f4002cad..06aa348a 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/VersionNumber.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/VersionNumber.java
@@ -58,8 +58,14 @@ public interface VersionNumber
/** Release 3 July 2015. */
int VERSION_1_5_2 = 46;
- /** Release Q3 2015. */
+ /** Release 19 Nov 2015. */
int VERSION_1_6_0 = 50;
- int LATEST_VERSION = VERSION_1_6_0;
+ /** Release 11 March 2015. */
+ int VERSION_1_6_1 = 60;
+
+ /** Release April 2015. */
+ int VERSION_1_6_2 = 61;
+
+ int LATEST_VERSION = VERSION_1_6_2;
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/builder/AlfrescoFragmentBuilder.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/builder/AlfrescoFragmentBuilder.java
index 3b472cdb..068d7db1 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/builder/AlfrescoFragmentBuilder.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/builder/AlfrescoFragmentBuilder.java
@@ -243,7 +243,7 @@ public Fragment createFragment()
// Analytics
// Report only fragment & report at creation enable (cf. pager case)
if (AnalyticsManager.getInstance(getActivity()) != null
- || AnalyticsManager.getInstance(getActivity()).isEnable())
+ && AnalyticsManager.getInstance(getActivity()).isEnable())
{
if (frag instanceof AnalyticsManager.FragmentAnalyzed
&& ((AnalyticsManager.FragmentAnalyzed) frag).reportAtCreationEnable())
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
index 6474413e..88cefd6a 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
@@ -342,7 +342,8 @@ public void onClick(View v)
if (AnalyticsManager.getInstance(getActivity()) == null
|| AnalyticsManager.getInstance(getActivity()).isBlocked())
{
- boolean isEnable = AnalyticsManager.getInstance(getActivity()).isEnable();
+ boolean isEnable = AnalyticsManager.getInstance(getActivity()) != null
+ && AnalyticsManager.getInstance(getActivity()).isEnable();
diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
getString(R.string.settings_feedback_diagnostic), getString(R.string.settings_custom_menu_disable),
@@ -353,7 +354,8 @@ public void onClick(View v)
}
else
{
- boolean isEnable = AnalyticsManager.getInstance(getActivity()).isEnable();
+ boolean isEnable = AnalyticsManager.getInstance(getActivity()) != null
+ && AnalyticsManager.getInstance(getActivity()).isEnable();
diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
getString(R.string.settings_feedback_diagnostic),
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountSignInFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountSignInFragment.java
index c34c80b6..6e65d73e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountSignInFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountSignInFragment.java
@@ -21,6 +21,7 @@
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.application.activity.BaseActivity;
+import org.alfresco.mobile.android.application.activity.MainActivity;
import org.alfresco.mobile.android.application.activity.WelcomeActivity;
import org.alfresco.mobile.android.application.fragments.builder.LeafFragmentBuilder;
import org.alfresco.mobile.android.application.managers.ConfigManager;
@@ -41,6 +42,7 @@
import org.alfresco.mobile.android.ui.utils.UIUtils;
import android.content.DialogInterface;
+import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
@@ -251,6 +253,8 @@ public void onCancel(DialogInterface dialog)
{
ConfigManager.getInstance(getActivity()).setSession(event.data.getId(),
SessionUtils.getSession(getActivity()));
+ startActivity(new Intent(getActivity(), MainActivity.class));
+ getActivity().finish();
}
}
diff --git a/gradle.properties b/gradle.properties
index 67239bc6..f200a018 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -39,7 +39,7 @@
## DEFAULT BUILD VARIANT
####################################################################
# Current Version number of the application
-VERSION_NAME=1.6.1
+VERSION_NAME=1.6.2
# Build Number of the application
# Overrides by Continuous Integration System during build
diff --git a/mdm/mobileiron/src/main/java/org/alfresco/mobile/android/application/mdm/mobileiron/AppConnectService.java b/mdm/mobileiron/src/main/java/org/alfresco/mobile/android/application/mdm/mobileiron/AppConnectService.java
index d0765e11..d0af607d 100644
--- a/mdm/mobileiron/src/main/java/org/alfresco/mobile/android/application/mdm/mobileiron/AppConnectService.java
+++ b/mdm/mobileiron/src/main/java/org/alfresco/mobile/android/application/mdm/mobileiron/AppConnectService.java
@@ -9,10 +9,12 @@
import org.alfresco.mobile.android.platform.exception.AlfrescoAppException;
import org.alfresco.mobile.android.platform.extensions.MobileIronManager;
import org.alfresco.mobile.android.platform.mdm.MDMEvent;
+import org.alfresco.mobile.android.platform.mdm.MDMManager;
import android.app.IntentService;
import android.content.Intent;
import android.os.Bundle;
+import android.util.Log;
public class AppConnectService extends IntentService
{
@@ -36,28 +38,36 @@ public AppConnectService()
@Override
protected void onHandleIntent(Intent intent)
{
- if (ACTION_HANDLE_CONFIG.equals(intent.getAction()))
+
+ try
{
- Intent i;
- try
+ if (ACTION_HANDLE_CONFIG.equals(intent.getAction()))
{
- Bundle config = intent.getBundleExtra(CONFIG);
+ Intent i;
+ try
+ {
+ Bundle config = intent.getBundleExtra(CONFIG);
- if (config == null) { throw new AlfrescoAppException("No Config."); }
+ if (config == null) { throw new AlfrescoAppException("No Config."); }
- MobileIronManager.getInstance(getApplicationContext()).setConfig(config);
- i = intent.getParcelableExtra(CONFIG_APPLIED_INTENT);
+ MobileIronManager.getInstance(getApplicationContext()).setConfig(config);
+ i = intent.getParcelableExtra(CONFIG_APPLIED_INTENT);
- EventBusManager.getInstance().post(new MDMEvent());
- }
- catch (Exception e)
- {
- i = intent.getParcelableExtra(CONFIG_ERROR_INTENT);
- i.putExtra(ERROR_STRING, e.getMessage());
+ EventBusManager.getInstance().post(new MDMEvent());
+ }
+ catch (Exception e)
+ {
+ i = intent.getParcelableExtra(CONFIG_ERROR_INTENT);
+ i.putExtra(ERROR_STRING, e.getMessage());
- EventBusManager.getInstance().post(new MDMEvent(e));
+ EventBusManager.getInstance().post(new MDMEvent(e));
+ }
+ startService(MDMManager.createExplicitFromImplicitIntent(getApplicationContext(), i));
}
- startService(i);
+ }
+ catch (Exception e)
+ {
+ Log.i(TAG, "Error during handle config");
}
}
}
diff --git a/mdm/mobileiron/src/main/java/org/alfresco/mobile/android/application/mdm/mobileiron/MobileIronManagerImpl.java b/mdm/mobileiron/src/main/java/org/alfresco/mobile/android/application/mdm/mobileiron/MobileIronManagerImpl.java
index ae0bb51c..2405c86b 100644
--- a/mdm/mobileiron/src/main/java/org/alfresco/mobile/android/application/mdm/mobileiron/MobileIronManagerImpl.java
+++ b/mdm/mobileiron/src/main/java/org/alfresco/mobile/android/application/mdm/mobileiron/MobileIronManagerImpl.java
@@ -22,12 +22,14 @@
import org.alfresco.mobile.android.platform.exception.AlfrescoAppException;
import org.alfresco.mobile.android.platform.extensions.MobileIronManager;
+import org.alfresco.mobile.android.platform.mdm.MDMManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
+import android.util.Log;
public class MobileIronManagerImpl extends MobileIronManager
{
@@ -63,9 +65,16 @@ protected MobileIronManagerImpl(Context context)
// ///////////////////////////////////////////////////////////////////////////
public void requestConfig(FragmentActivity activity, String applicationId)
{
- Intent intent = new Intent("com.mobileiron.REQUEST_CONFIG");
- intent.putExtra("packageName", applicationId);
- activity.startService(intent);
+ try
+ {
+ Intent intent = new Intent("com.mobileiron.REQUEST_CONFIG");
+ intent.putExtra("packageName", applicationId);
+ activity.startService(MDMManager.createExplicitFromImplicitIntent(activity, intent));
+ }
+ catch (Exception e)
+ {
+ Log.i(TAG, "Error during request config");
+ }
}
@Override
@@ -97,8 +106,8 @@ public void setConfig(Bundle b)
// REPOSITORY URL
String repositoryURL = (String) b.get(ALFRESCO_REPOSITORY_URL);
- if (TextUtils.isEmpty(repositoryURL)) { throw new AlfrescoAppException(ALFRESCO_REPOSITORY_URL
- + " can't be empty."); }
+ if (TextUtils.isEmpty(
+ repositoryURL)) { throw new AlfrescoAppException(ALFRESCO_REPOSITORY_URL + " can't be empty."); }
URL u = null;
try
@@ -112,7 +121,7 @@ public void setConfig(Bundle b)
// USERNAME
String username = (String) b.get(ALFRESCO_USERNAME);
- if (TextUtils.isEmpty(repositoryURL)) { throw new AlfrescoAppException(ALFRESCO_USERNAME + " can't be empty."); }
+ if (TextUtils.isEmpty(username)) { throw new AlfrescoAppException(ALFRESCO_USERNAME + " can't be empty."); }
}
@Override
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/mdm/MDMManager.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/mdm/MDMManager.java
index 7ef7c6b0..c64320a2 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/mdm/MDMManager.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/mdm/MDMManager.java
@@ -18,6 +18,8 @@
package org.alfresco.mobile.android.platform.mdm;
+import java.util.List;
+
import org.alfresco.mobile.android.platform.EventBusManager;
import org.alfresco.mobile.android.platform.Manager;
import org.alfresco.mobile.android.platform.extensions.MobileIronManager;
@@ -25,8 +27,12 @@
import org.alfresco.mobile.android.platform.utils.BundleUtils;
import android.annotation.TargetApi;
+import android.content.ComponentName;
import android.content.Context;
+import android.content.Intent;
import android.content.RestrictionsManager;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
@@ -160,4 +166,28 @@ else if (restrictions != null)
return "";
}
}
+
+ public static Intent createExplicitFromImplicitIntent(Context context, Intent implicitIntent)
+ {
+ // Retrieve all services that can match the given intent
+ PackageManager pm = context.getPackageManager();
+ List resolveInfo = pm.queryIntentServices(implicitIntent, 0);
+
+ // Make sure only one match was found
+ if (resolveInfo == null || resolveInfo.size() != 1) { return null; }
+
+ // Get component info and create ComponentName
+ ResolveInfo serviceInfo = resolveInfo.get(0);
+ String packageName = serviceInfo.serviceInfo.packageName;
+ String className = serviceInfo.serviceInfo.name;
+ ComponentName component = new ComponentName(packageName, className);
+
+ // Create a new intent. Use the old one for extras and such reuse
+ Intent explicitIntent = new Intent(implicitIntent);
+
+ // Set the component to be explicit
+ explicitIntent.setComponent(component);
+
+ return explicitIntent;
+ }
}