Skip to content

Commit 7966430

Browse files
authored
Merge pull request #1807 from owncloud/instant_upload_combined_solution
Release 2.1.2
2 parents 65abf82 + 55bfb27 commit 7966430

File tree

10 files changed

+424
-121
lines changed

10 files changed

+424
-121
lines changed

AndroidManifest.xml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
-->
2020
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
21-
xmlns:tools="http://schemas.android.com/tools"
2221
package="com.owncloud.android"
23-
android:versionCode="20100100"
24-
android:versionName="2.1.1" >
22+
android:versionCode="20100200"
23+
android:versionName="2.1.2" >
2524

2625
<uses-sdk
2726
android:minSdkVersion="14"
@@ -197,19 +196,32 @@
197196
<activity android:name=".ui.errorhandling.ErrorShowActivity" />
198197
<activity android:name=".ui.activity.UploadListActivity" />
199198

200-
<receiver android:name=".files.services.ConnectivityActionReceiver"
201-
android:enabled="true" android:label="ConnectivityActionReceiver">
202-
<intent-filter>
203-
<!--action android:name="android.net.conn.CONNECTIVITY_CHANGE"/-->
204-
<action android:name="android.net.wifi.STATE_CHANGE"/>
205-
</intent-filter>
206-
</receiver>
207-
<receiver android:name=".files.BootupBroadcastReceiver" >
199+
<receiver android:name=".broadcastreceivers.ConnectivityActionReceiver"
200+
android:enabled="true" android:label="ConnectivityActionReceiver">
201+
<intent-filter>
202+
<!--action android:name="android.net.conn.CONNECTIVITY_CHANGE"/-->
203+
<action android:name="android.net.wifi.STATE_CHANGE"/>
204+
</intent-filter>
205+
</receiver>
206+
207+
<receiver android:name=".broadcastreceivers.BootupBroadcastReceiver" >
208208
<intent-filter>
209209
<action android:name="android.intent.action.BOOT_COMPLETED" />
210210
</intent-filter>
211211
</receiver>
212212

213+
<receiver android:name=".broadcastreceivers.InstantUploadBroadcastReceiver">
214+
<intent-filter>
215+
<action android:name="android.hardware.action.NEW_PICTURE" />
216+
<data android:mimeType="image/*" />
217+
</intent-filter>
218+
<intent-filter>
219+
<action android:name="android.hardware.action.NEW_VIDEO" />
220+
<data android:mimeType="video/*" />
221+
</intent-filter>
222+
</receiver>
223+
224+
213225
<service android:name=".services.observer.FileObserverService" />
214226

215227
<activity

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.1.2 (September 2016)
2+
- Instant uploads fixed in Android 6.
3+
14
## 2.1.1 (September 2016)
25
- Instant uploads work in Android 7.
36
- Select your camera folder to upload pictures or videos from any

oc_jb_workaround/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.owncloud.android.workaround.accounts"
4-
android:versionCode="0100031"
5-
android:versionName="1.0.31" >
4+
android:versionCode="0100032"
5+
android:versionName="1.0.32" >
66

77
<uses-sdk
88
android:minSdkVersion="16"

res/values/strings.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,9 @@
398398
<string name="file_list__footer__files">%1$d files</string>
399399
<string name="file_list__footer__files_and_folder">%1$d files, 1 folder</string>
400400
<string name="file_list__footer__files_and_folders">%1$d files, %2$d folders</string>
401-
<string name="prefs_instant_upload_source_path_title">Camera folder</string>
401+
<string name="prefs_instant_upload_source_path_title">Camera folder (%1$s)</string>
402+
<string name="prefs_instant_upload_source_path_title_required">required</string>
403+
<string name="prefs_instant_upload_source_path_title_optional">optional</string>
402404
<string name="prefs_instant_behaviour_dialogTitle">Original file will be...</string>
403405
<string name="prefs_instant_behaviour_title">Original file will be...</string>
404406
<string name="upload_copy_files">Copy file</string>

src/com/owncloud/android/files/BootupBroadcastReceiver.java renamed to src/com/owncloud/android/broadcastreceivers/BootupBroadcastReceiver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*/
2121

22-
package com.owncloud.android.files;
22+
package com.owncloud.android.broadcastreceivers;
2323

2424
import com.owncloud.android.lib.common.utils.Log_OC;
2525
import com.owncloud.android.services.observer.FileObserverService;

src/com/owncloud/android/files/services/ConnectivityActionReceiver.java renamed to src/com/owncloud/android/broadcastreceivers/ConnectivityActionReceiver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
*/
2020

21-
package com.owncloud.android.files.services;
21+
package com.owncloud.android.broadcastreceivers;
2222

2323
import android.content.BroadcastReceiver;
2424
import android.content.ComponentName;
@@ -35,6 +35,7 @@
3535
import com.owncloud.android.MainApp;
3636
import com.owncloud.android.db.PreferenceManager;
3737
import com.owncloud.android.db.UploadResult;
38+
import com.owncloud.android.files.services.FileUploader;
3839
import com.owncloud.android.lib.common.utils.Log_OC;
3940

4041
/**
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* ownCloud Android client application
3+
*
4+
* @author Bartek Przybylski
5+
* @author David A. Velasco
6+
* Copyright (C) 2012 Bartek Przybylski
7+
* Copyright (C) 2016 ownCloud GmbH.
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License version 2,
11+
* as published by the Free Software Foundation.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
package com.owncloud.android.broadcastreceivers;
23+
24+
import android.content.BroadcastReceiver;
25+
import android.content.Context;
26+
import android.content.Intent;
27+
28+
import com.owncloud.android.db.PreferenceManager;
29+
import com.owncloud.android.lib.common.utils.Log_OC;
30+
import com.owncloud.android.services.observer.InstantUploadsHandler;
31+
32+
33+
public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
34+
35+
private static String TAG = InstantUploadBroadcastReceiver.class.getName();
36+
// Image action
37+
// Officially supported action since SDK 14:
38+
// http://developer.android.com/reference/android/hardware/Camera.html#ACTION_NEW_PICTURE
39+
private static String NEW_PHOTO_ACTION = "android.hardware.action.NEW_PICTURE";
40+
// Video action
41+
// Officially supported action since SDK 14:
42+
// http://developer.android.com/reference/android/hardware/Camera.html#ACTION_NEW_VIDEO
43+
private static String NEW_VIDEO_ACTION = "android.hardware.action.NEW_VIDEO";
44+
45+
@Override
46+
public void onReceive(Context context, Intent intent) {
47+
Log_OC.d(TAG, "Received: " + intent.getAction());
48+
if (intent.getAction().equals(NEW_PHOTO_ACTION)) {
49+
InstantUploadsHandler handler = new InstantUploadsHandler();
50+
handler.handleNewPictureAction(
51+
intent,
52+
PreferenceManager.getInstantUploadsConfiguration(context),
53+
context
54+
);
55+
Log_OC.d(TAG, "processed: android.hardware.action.NEW_PICTURE");
56+
57+
} else if (intent.getAction().equals(NEW_VIDEO_ACTION)) {
58+
InstantUploadsHandler handler = new InstantUploadsHandler();
59+
handler.handleNewVideoAction(
60+
intent,
61+
PreferenceManager.getInstantUploadsConfiguration(context),
62+
context
63+
);
64+
Log_OC.d(TAG, "processed: android.hardware.action.NEW_VIDEO");
65+
66+
} else {
67+
Log_OC.e(TAG, "Incorrect intent received: " + intent.getAction());
68+
}
69+
}
70+
71+
}

0 commit comments

Comments
 (0)