Skip to content

Commit a75803e

Browse files
author
JM.PASCAL
committed
Merge pull request #386 from Alfresco/1.6.1
Prepare 1.6.1 release
2 parents 53c1027 + 9b986ad commit a75803e

File tree

181 files changed

+4671
-1233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+4671
-1233
lines changed

alfresco-mobile-android/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/build
2+
#Google
3+
google-services.json

alfresco-mobile-android/build.gradle

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
1+
/*
2+
* Copyright (C) 2005-2016 Alfresco Software Limited.
3+
*
4+
* This file is part of Alfresco Mobile for Android.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
apply plugin: 'com.android.application'
220

321
android {
4-
compileSdkVersion 22
5-
buildToolsVersion "22.0.1"
22+
compileSdkVersion 23
23+
buildToolsVersion "23.0.2"
624

725
defaultConfig {
826
applicationId APPLICATION_ID
927

1028
minSdkVersion 15
1129
targetSdkVersion 22
12-
versionCode 51
30+
versionCode 60
1331
versionName VERSION_NAME
1432

1533
manifestPlaceholders = [PROVIDER_AUTHORITY: PROVIDER_AUTHORITY]
@@ -23,6 +41,8 @@ android {
2341
resValue "string", "oauth_callback", OAUTH_CALLBACK
2442
resValue "string", "oauth_scope", OAUTH_SCOPE
2543
resValue "string", "bamboo_buildnumber", BUILDNUMBER
44+
45+
resValue "string", "ga_trackingId", TRACKER_ID
2646
}
2747

2848
lintOptions {
@@ -57,7 +77,7 @@ android {
5777
resValue "string", "favorites_adapter", FAVORITES_ADAPTER_DEBUG
5878

5979
resValue "string", "hockeyapp_key", HOCKEYAPP_KEY
60-
80+
resValue "string", "ga_trackingId", TRACKER_ID_DEBUG
6181
}
6282

6383
release {
@@ -89,9 +109,13 @@ android {
89109
dependencies {
90110
//DEBUG BUILD TYPE
91111
debugCompile project(':extensions:hockeyapp')
112+
debugCompile project(':extensions:analytics')
113+
debugCompile project(':extensions:tools')
114+
92115

93116
storeCompile project(':extensions:samsung')
94117
storeCompile project(':extensions:scansnap')
118+
storeCompile project(':extensions:analytics')
95119
}
96120
}
97121

alfresco-mobile-android/src/debug/java/org/alfresco/mobile/android/application/managers/DevToolsManagerImpl.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,25 @@
1717
******************************************************************************/
1818
package org.alfresco.mobile.android.application.managers;
1919

20+
import org.alfresco.mobile.android.application.R;
21+
import org.alfresco.mobile.android.application.extension.analytics.GAnalyticsManagerImpl;
2022
import org.alfresco.mobile.android.application.fragments.config.ConfigMenuEditorFragment;
23+
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
2124
import org.alfresco.mobile.android.platform.extensions.DevToolsManager;
25+
import org.alfresco.mobile.android.ui.holder.HolderUtils;
26+
import org.alfresco.mobile.android.ui.holder.TwoLinesCheckboxViewHolder;
27+
import org.alfresco.mobile.android.ui.holder.TwoLinesViewHolder;
2228

2329
import android.content.Context;
2430
import android.support.v4.app.FragmentActivity;
31+
import android.view.LayoutInflater;
32+
import android.view.View;
33+
import android.view.ViewGroup;
2534

2635
public class DevToolsManagerImpl extends DevToolsManager
2736
{
37+
public boolean enableManualDispatch = false;
38+
2839
// ///////////////////////////////////////////////////////////////////////////
2940
// CONSTRUCTOR
3041
// ///////////////////////////////////////////////////////////////////////////
@@ -54,4 +65,40 @@ public void displayMenuConfig(FragmentActivity activity)
5465
{
5566
ConfigMenuEditorFragment.with(activity).display();
5667
}
68+
69+
@Override
70+
public void generateMenu(final FragmentActivity activity, ViewGroup root)
71+
{
72+
TwoLinesViewHolder vh = HolderUtils.configure(root, R.layout.row_two_lines_borderless, "Menu Editor",
73+
"Tools to edit and manage menu and profiles", -1);
74+
75+
((ViewGroup) vh.icon.getParent().getParent()).setOnClickListener(new View.OnClickListener()
76+
{
77+
@Override
78+
public void onClick(View v)
79+
{
80+
DevToolsManager.getInstance(activity).displayMenuConfig(activity);
81+
}
82+
});
83+
84+
View v = LayoutInflater.from(root.getContext()).inflate(R.layout.row_two_lines_checkbox, root, false);
85+
final TwoLinesCheckboxViewHolder cvh = HolderUtils.configure(v, "Analytics RealTime",
86+
"Switch ON to enable faster realtime analytics", enableManualDispatch);
87+
root.addView(v);
88+
89+
cvh.choose.setOnClickListener(new View.OnClickListener()
90+
{
91+
@Override
92+
public void onClick(View v)
93+
{
94+
enableManualDispatch = cvh.choose.isChecked();
95+
if (AnalyticsManager.getInstance(activity) != null)
96+
{
97+
((GAnalyticsManagerImpl) AnalyticsManager.getInstance(activity))
98+
.enableManualDispatch(cvh.choose.isChecked());
99+
}
100+
}
101+
});
102+
}
103+
57104
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright (C) 2005-2016 Alfresco Software Limited.
3+
~
4+
~ This file is part of Alfresco Mobile for Android.
5+
~
6+
~ Licensed under the Apache License, Version 2.0 (the "License");
7+
~ you may not use this file except in compliance with the License.
8+
~ You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
-->
18+
19+
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="all">
20+
21+
<!-- Percentage of events to include in reports -->
22+
<string name="ga_sampleFrequency">100.0</string>
23+
24+
<!-- Enable automatic Activity measurement -->
25+
<bool name="ga_autoActivityTracking">false</bool>
26+
27+
<!-- Enable Manual Dispatch -->
28+
<bool name="ga_manualDispatch">false</bool>
29+
30+
<!-- catch and report uncaught exceptions from the app -->
31+
<bool name="ga_reportUncaughtExceptions">true</bool>
32+
33+
<!-- How long a session exists before giving up -->
34+
<integer name="ga_sessionTimeout">2</integer>
35+
36+
37+
</resources>

alfresco-mobile-android/src/main/assets/Configuration/embedded_config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
"root-view-id": "views-menu-default"
1111
}
1212
},
13+
"features": [
14+
{
15+
"id": "feature-analytics-default",
16+
"type": "org.alfresco.client.feature.analytics",
17+
"enable": false
18+
}
19+
],
1320
"view-groups": [
1421
{
1522
"id": "views-menu-default",
Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
/*******************************************************************************
2-
* Copyright (C) 2005-2014 Alfresco Software Limited.
1+
/*
2+
* Copyright (C) 2005-2016 Alfresco Software Limited.
33
*
4-
* This file is part of Alfresco Mobile for Android.
4+
* This file is part of Alfresco Mobile for Android.
55
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
99
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
10+
* http://www.apache.org/licenses/LICENSE-2.0
1111
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
17-
*******************************************************************************/
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
1818
package org.alfresco.mobile.android.application;
1919

2020
import org.alfresco.mobile.android.application.managers.upgrade.UpgradeManager;
2121
import org.alfresco.mobile.android.async.OperationsUtils;
2222
import org.alfresco.mobile.android.platform.SessionManager;
23+
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
2324

2425
import android.app.Application;
2526

2627
public class AlfrescoApplication extends Application
2728
{
2829
protected SessionManager sessionManager;
2930

31+
private AnalyticsManager analyticsManager;
32+
3033
@Override
3134
public void onCreate()
3235
{
@@ -39,4 +42,9 @@ public void onCreate()
3942
// Remove operations if necessary
4043
OperationsUtils.clean(this);
4144
}
45+
46+
synchronized public AnalyticsManager getAnalyticsTracker()
47+
{
48+
return AnalyticsManager.getInstance(this);
49+
}
4250
}

alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.alfresco.mobile.android.application.intent.RequestCode;
4848
import org.alfresco.mobile.android.application.managers.ConfigManager;
4949
import org.alfresco.mobile.android.application.managers.RenditionManagerImpl;
50+
import org.alfresco.mobile.android.application.managers.extensions.AnalyticHelper;
5051
import org.alfresco.mobile.android.application.security.DataProtectionUserDialogFragment;
5152
import org.alfresco.mobile.android.async.Operator;
5253
import org.alfresco.mobile.android.async.account.CreateAccountEvent;
@@ -67,6 +68,7 @@
6768
import org.alfresco.mobile.android.platform.accounts.AccountsPreferences;
6869
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
6970
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
71+
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
7072
import org.alfresco.mobile.android.platform.favorite.FavoritesManager;
7173
import org.alfresco.mobile.android.platform.intent.AlfrescoIntentAPI;
7274
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
@@ -216,7 +218,7 @@ public void onCreate(Bundle savedInstanceState)
216218
// re-created after the AlfrescoAccount is created.
217219
DataProtectionUserDialogFragment.newInstance(true).show(getSupportFragmentManager(),
218220
DataProtectionUserDialogFragment.TAG);
219-
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
221+
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
220222
}
221223
}
222224
}
@@ -280,6 +282,11 @@ public void onDrawerOpened(View drawerView)
280282
@Override
281283
protected void onStart()
282284
{
285+
if (AnalyticsManager.getInstance(this) != null && AnalyticsManager.getInstance(this).isEnable())
286+
{
287+
AnalyticsManager.getInstance(this).startReport(this);
288+
}
289+
283290
registerPublicReceiver(new NetworkReceiver(), new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
284291

285292
super.onStart();
@@ -355,7 +362,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data)
355362
((MainMenuFragment) getFragment(MainMenuFragment.SLIDING_TAG)).refreshAccount();
356363

357364
// Send Event
358-
ConfigManager.getInstance(this).loadAndUseCustom(getCurrentAccount());
365+
// ConfigManager.getInstance(this).loadAndUseCustom(getCurrentAccount());
359366
EventBusManager.getInstance()
360367
.post(new ConfigManager.ConfigurationMenuEvent(getCurrentAccount().getId()));
361368
}
@@ -782,7 +789,7 @@ public void onAccountCreated(CreateAccountEvent event)
782789
{
783790
DataProtectionUserDialogFragment.newInstance(true).show(getSupportFragmentManager(),
784791
DataProtectionUserDialogFragment.TAG);
785-
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
792+
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
786793
}
787794
}
788795
}
@@ -943,7 +950,7 @@ public void onAccountLoaded(LoadAccountCompletedEvent event)
943950
if (paidNetwork)
944951
{
945952
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
946-
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
953+
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
947954

948955
if (mdmManager.hasConfig())
949956
{
@@ -972,6 +979,9 @@ public void onAccountLoaded(LoadAccountCompletedEvent event)
972979
startActivityForResult(new Intent(this, InfoActivity.class), SyncMigrationFragment.REQUEST_CODE);
973980
}
974981

982+
// Analytics
983+
AnalyticHelper.analyzeSession(this, event.account, getCurrentSession());
984+
975985
// Activate Automatic Sync for Sync Content & Favorite
976986
SyncContentManager.getInstance(this).setActivateSync(getCurrentAccount(), true);
977987
if (SyncContentManager.getInstance(this).canSync(getCurrentAccount()))
@@ -986,6 +996,7 @@ public void onAccountLoaded(LoadAccountCompletedEvent event)
986996
}
987997

988998
invalidateOptionsMenu();
999+
9891000
}
9901001

9911002
@Subscribe
@@ -1077,7 +1088,6 @@ else if (sessionState == SESSION_ERROR && getCurrentSession() == null)
10771088
if (!isSyncActive(AlfrescoAccountManager.getInstance(context)
10781089
.getAndroidAccount(getCurrentAccount().getId()), SyncContentProvider.AUTHORITY))
10791090
{
1080-
Log.e(TAG, "[Sync NETWORK]");
10811091
SyncContentManager.getInstance(context).sync(getCurrentAccount());
10821092
}
10831093
}

alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/PrivateDialogActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import org.alfresco.mobile.android.application.fragments.workflow.CreateTaskTypePickerFragment;
3535
import org.alfresco.mobile.android.application.ui.form.picker.DocumentPickerFragment.onPickDocumentFragment;
3636
import org.alfresco.mobile.android.async.file.encryption.AccountProtectionEvent;
37+
import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
38+
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
3739
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
3840

3941
import android.content.Intent;
@@ -140,6 +142,8 @@ && getIntent().getExtras().containsKey(PrivateIntent.EXTRA_DOCUMENTS))
140142
Fragment f = docs.isEmpty() ? new CreateTaskTypePickerFragment()
141143
: CreateTaskTypePickerFragment.newInstance(docs);
142144
FragmentDisplayer.with(this).load(f).back(false).animate(null).into(FragmentDisplayer.PANEL_LEFT);
145+
146+
AnalyticsHelper.reportScreen(this, AnalyticsManager.SCREEN_TASK_CREATE_TYPE);
143147
}
144148

145149
if (PrivateIntent.ACTION_DISPLAY_HELP.equals(action))

0 commit comments

Comments
 (0)