From: masensio Date: Tue, 8 Apr 2014 10:50:50 +0000 (+0200) Subject: Merge branch 'develop' into videoInstandUploads X-Git-Tag: oc-android-1.7.0_signed~332^2~10 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/3351db65273a8d8ff1d012e00025e728cc428419?ds=inline;hp=-c Merge branch 'develop' into videoInstandUploads --- 3351db65273a8d8ff1d012e00025e728cc428419 diff --combined AndroidManifest.xml index d88f6562,3067a40f..48d5b0c1 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@@ -3,7 -3,7 +3,7 @@@ ownCloud Android client application Copyright (C) 2012 Bartek Przybylski - Copyright (C) 2012-2013 ownCloud Inc. + Copyright (C) 2012-2014 ownCloud Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, @@@ -18,8 -18,8 +18,8 @@@ along with this program. If not, see . --> + android:versionCode="105005" + android:versionName="1.5.5" xmlns:android="http://schemas.android.com/apk/res/android"> @@@ -38,21 -38,22 +38,22 @@@ + android:targetSdkVersion="19" /> + android:label="@string/app_name" + > - @@@ -61,7 -62,7 +62,7 @@@ - + @@@ -81,7 -82,8 +82,8 @@@ - + + - + - + @@@ -110,7 -116,8 +116,8 @@@ + android:exported="true" + > @@@ -122,7 -129,7 +129,7 @@@ + android:theme="@style/Theme.ownCloud.noActionBar" + android:launchMode="singleTask"> + + + + + + + - - - @@@ -156,14 -168,13 +168,17 @@@ + + + + + + + @@@ -173,6 -184,12 +188,12 @@@ + + + - + diff --combined res/values/strings.xml index 83ea1548,8d243fce..39ea2607 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@@ -1,68 -1,48 +1,48 @@@ - ownCloud - Password: - Username: - Login - Welcome - Files - Music - Contacts - Calendar - Bookmarks - Settings - Setup Account - There is no account set up on your device. In order to use this App, you need to create one. %1$s Android App version %1$s - Refresh + Refresh account Upload Content from other apps Files - Create directory - Search + Open with + New folder Settings Details - + Send General - Add new session - Create image thumbnails - Select an account - Choose which of your accounts the app should use. - Device Tracking - Enable this App to track your device location - This App keeps track of this device - Update Interval - Update every %1$s minutes + More Accounts Manage Accounts App PIN Protect your client Enable instant uploads - Instantly upload photos taken by camera + Instantly upload media taken by camera Enable Logging This is used to log problems Logging History This shows the recorded logs Delete History + Help + Recommend to a friend + Feedback + Imprint - URL + "Try %1$s on your smartphone!" + "I want to invite you to use %1$s on your smartphone!\nDownload here: %2$s" + + + Check Server + Server address https://… Username Password - I am new to %1$s - Incorrect address given - Incorrect session name + New to %1$s? Files - No file selected for upload - Username - Password - Web address - Show password? - Connect to your %1$s Connect Upload - Choose upload directory: + Choose upload folder: No account found There are no %1$s accounts on your device. Please setup an account first. Setup @@@ -71,7 -51,6 +51,6 @@@ No content was received. Nothing to upload. %1$s is not allowed to access the shared content Uploading - Create directory for upload There are no files in this folder.\nNew files can be added with the \"Upload\" menu option. Tap on a file to display additional information. Size: @@@ -79,10 -58,10 +58,10 @@@ Created: Modified: Download - Refresh - Redownload - Open + Refresh file File was renamed to %1$s during upload + Share link + Unshare link Yes No OK @@@ -90,23 -69,21 +69,21 @@@ Cancel upload Cancel Save & Exit - Leave %1$s Error Loading … Unknown error About + Change password Delete account Create account Upload from … - Directory name + Folder name Uploading … %1$d%% Uploading %2$s Upload succeeded %1$s was successfully uploaded - %1$d files were successfully uploaded Upload failed Upload of %1$s could not be completed - Upload failed: %1$d/%2$d files were upload Downloading … %1$d%% Downloading %2$s Download succeeded @@@ -115,26 -92,25 +92,25 @@@ Download of %1$s could not be completed Not downloaded yet Choose account - Contacts Synchronization failed Synchronization of %1$s could not be completed - Conflicts found - %1$d kept-in-sync files could not be sync\'ed + Invalid password for %1$s + Conflicts found + %1$d kept-in-sync files could not be sync\'ed Kept-in-sync files failed Contents of %1$d files could not be sync\'ed (%2$d conflicts) Some local files were forgotten - %1$d files out of the %2$s directory could not be copied into - "As of version 1.3.16, files uploaded from this device are copied into the local %1$s folder to prevent data loss when a single file is synced with multiple accounts.\n\nDue to this change, all files uploaded in previous versions of this app were copied into the %2$s folder. However, an error prevented the completion of this operation during account synchronization. You may either leave the file(s) as is and remove the link to %3$s, or move the file(s) into the %1$s directory and retain the link to %4$s.\n\nListed below are the local file(s), and the the remote file(s) in %5$s they were linked to. + %1$d files out of the %2$s folder could not be copied into + As of version 1.3.16, files uploaded from this device are copied into the local %1$s folder to prevent data loss when a single file is synced with multiple accounts.\n\nDue to this change, all files uploaded in previous versions of this app were copied into the %2$s folder. However, an error prevented the completion of this operation during account synchronization. You may either leave the file(s) as is and remove the link to %3$s, or move the file(s) into the %1$s folder and retain the link to %4$s.\n\nListed below are the local file(s), and the remote file(s) in %5$s they were linked to. + Folder %1$s does not exist anymore "Move all" "All files were moved" "Some files could not be moved" "Local: %1$s" "Remote: %1$s" There is not space enough to copy the selected files into the %1$s folder. Would like to move them into instead? - Use Secure Connection - %1$s cannot track your device. Please check your location settings Please, insert your App PIN - Please, insert your new App PIN + Enter your App PIN The PIN will be requested every time the app is started Please, reenter your App PIN @@@ -150,66 -126,54 +126,54 @@@ "%1$s playback finished" No media file found No account provided - File not in a valid account - Unsupported media codec - Media file could not be read - Media file not correctly encoded - Too much time trying to play - Media file cannot be streamed - Media file cannot be played with the stock media player - Security error trying to play %1$s + File not in a valid account + Unsupported media codec + Media file could not be read + Media file not correctly encoded + Timed out while trying to play + Media file cannot be streamed + Media file cannot be played with the stock media player + Security error trying to play %1$s Input error trying to play %1$s Unexpected error trying to play %1$s - Previous track button Rewind button Play or pause button Fast forward button - Next track button - - 15 Minutes - 30 Minutes - 60 Minutes - - - 15 - 30 - 60 - - Trying to login... - No network connection - No network connection has been detected, check your Internet connection and try again. - Connect anyway - Secure connection unavailable. - The Application cannot establish a secure connection to the server. A non secure connection is available. You may continue or cancel. - Connection established - Testing connection... - Malformed server configuration - It seems that your server instance is not correctly configured. Contact your administrator for more details. - Unknown error occurred! - An unknown error occurred. Please contact support and include logs from your device. - Couldn\'t find host - Couldn\'t find the entered host. Please check hostname and server availability and try again. - Server instance not found - Application couldn\'t find a server instance at the given path. Please check your path and try again. - The server took too long to respond - Malformed URL - SSL initialization failed - Unverified SSL server\'s identity - Unrecognized server version - Couldn\'t establish connection - Secure connection established - Login details - Invalid login / password - Wrong path given - Internal server error, code %1$d - Application terminated unexpectedly. Would you like to submit a crash report? - Send report - Don\'t send report - Extensions available! - Looks like your server instance is supporting advanced extensions. Would you like to see extensions available for android ? + Getting authorization… + Trying to login… + No network connection + Secure connection unavailable. + Connection established + Testing connection… + Malformed server configuration + An account for the same user and server already exists in the device + The entered user does not match the user of this account + Unknown error occurred! + Couldn\'t find host + Server instance not found + The server took too long to respond + Malformed URL + SSL initialization failed + Couldn\'t verify SSL server\'s identity + Unrecognized server version + Couldn\'t establish connection + Secure connection established + Wrong username or password + Unsuccessful authorization + Access denied by authorization server + Unexpected state; please, enter the server URL again + Your authorization expired. Please, authorize again + Please, enter the current password + Your session expired. Please connect again + Connecting to authentication server… + The server does not support this authentication method + %1$s does not support multiple accounts + Your server is not returning a correct user id, please contact an administrator + + Can not authenticate against this server + Keep file up to date - Share Rename Remove "Do you really want to remove %1$s ?" @@@ -225,17 -189,21 +189,21 @@@ "Rename could not be completed" Remote file could not be checked File contents already synchronized - Directory could not be created + Folder could not be created + Forbidden characters: / \\ < > : " | ? * Wait a moment "Unexpected problem ; please select the file from a different app" No file was selected - Warning + Send link to … + + Login with oAuth2 + Connecting to oAuth2 server… + The identity of the site could not be verified - The server certificate is not trusted - The server certificate expired - The server certificate valid dates are in the future - The URL does not match the hostname in the certificate - The server certificate could not be obtained Do you want to trust this certificate anyway? The certificate could not be saved Details @@@ -253,6 -221,8 +221,8 @@@ To: Signature: Algorithm: + The certificate could not be shown. + - No information about the error This is a placeholder placeholder.txt @@@ -271,11 -241,9 +241,9 @@@ Image preview This image can not be shown - "Not enough memory to show this image - - %1$s could not be copied to %2$s local directory - Failed InstantUpload" + %1$s could not be copied to %2$s local folder + Failed InstantUpload Failed instant uploads Summary of all failed instant uploads select all @@@ -286,4 -254,18 +254,18 @@@ do nothing you are not online for instant upload Failure Message: Please check your server configuration,maybe your quota is exceeded. + + Sorry, sharing is not enabled on your server. Please contact your + administrator. + Unable to share this file or folder. Please, make sure it exists + An error occurred while trying to share this file or folder + Unable to unshare this file or folder. It does not exist. + An error occurred while trying to unshare this file or folder + + Send + + Copy link + Copied to clipboard + + Critical error: can not perform operations diff --combined src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java index 2c2fa91a,1943d320..ee004b23 --- a/src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java +++ b/src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java @@@ -1,6 -1,6 +1,6 @@@ /* ownCloud Android client application * Copyright (C) 2012 Bartek Przybylski -- * Copyright (C) 2012-2013 ownCloud Inc. ++ * Copyright (C) 2012-2014 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@@ -20,39 -20,48 +20,52 @@@ package com.owncloud.android.files import java.io.File; + import com.owncloud.android.MainApp; + import com.owncloud.android.authentication.AccountUtils; + import com.owncloud.android.db.DbHandler; + import com.owncloud.android.files.services.FileUploader; + import com.owncloud.android.utils.FileStorageUtils; + import com.owncloud.android.utils.Log_OC; + + import android.accounts.Account; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; - import android.content.IntentFilter; + //import android.content.IntentFilter; import android.database.Cursor; import android.net.ConnectivityManager; import android.net.NetworkInfo.State; import android.preference.PreferenceManager; -import android.provider.MediaStore.Images.Media; +import android.provider.MediaStore.*; import android.webkit.MimeTypeMap; - import com.owncloud.android.AccountUtils; - import com.owncloud.android.Log_OC; - import com.owncloud.android.authenticator.AccountAuthenticator; - import com.owncloud.android.db.DbHandler; - import com.owncloud.android.files.services.FileUploader; - import com.owncloud.android.utils.FileStorageUtils; public class InstantUploadBroadcastReceiver extends BroadcastReceiver { private static String TAG = "InstantUploadBroadcastReceiver"; - private static final String[] CONTENT_PROJECTION = { Media.DATA, Media.DISPLAY_NAME, Media.MIME_TYPE, Media.SIZE }; ++ // private static final String[] CONTENT_PROJECTION = { Media.DATA, Media.DISPLAY_NAME, Media.MIME_TYPE, Media.SIZE }; + //Unofficial action, works for most devices but not HTC. See: https://github.com/owncloud/android/issues/6 + private static String NEW_PHOTO_ACTION_UNOFFICIAL = "com.android.camera.NEW_PICTURE"; + //Officially supported action since SDK 14: http://developer.android.com/reference/android/hardware/Camera.html#ACTION_NEW_PICTURE private static String NEW_PHOTO_ACTION = "android.hardware.action.NEW_PICTURE"; ++ // Video action + private static String NEW_VIDEO_ACTION = "android.hardware.action.NEW_VIDEO"; @Override public void onReceive(Context context, Intent intent) { Log_OC.d(TAG, "Received: " + intent.getAction()); if (intent.getAction().equals(android.net.ConnectivityManager.CONNECTIVITY_ACTION)) { handleConnectivityAction(context, intent); + }else if (intent.getAction().equals(NEW_PHOTO_ACTION_UNOFFICIAL)) { - handleNewPhotoAction(context, intent); ++ handleNewMediaAction(context, intent); //handleNewPhotoAction(context, intent); + Log_OC.d(TAG, "UNOFFICIAL processed: com.android.camera.NEW_PICTURE"); + } else if (intent.getAction().equals(NEW_PHOTO_ACTION)) { - handleNewPhotoAction(context, intent); ++ handleNewMediaAction(context, intent); //handleNewPhotoAction(context, intent); + Log_OC.d(TAG, "OFFICIAL processed: android.hardware.action.NEW_PICTURE"); + } else if (intent.getAction().equals(NEW_PHOTO_ACTION) || intent.getAction().equals(NEW_VIDEO_ACTION)) { + handleNewMediaAction(context, intent); - } else if (intent.getAction().equals(FileUploader.UPLOAD_FINISH_MESSAGE)) { + } else if (intent.getAction().equals(FileUploader.getUploadFinishMessage())) { handleUploadFinished(context, intent); } else { Log_OC.e(TAG, "Incorrect intent sent: " + intent.getAction()); @@@ -61,6 -70,7 +74,7 @@@ private void handleUploadFinished(Context context, Intent intent) { // remove successfull uploading, ignore rest for reupload on reconnect + /* if (intent.getBooleanExtra(FileUploader.EXTRA_UPLOAD_RESULT, false)) { DbHandler db = new DbHandler(context); String localPath = intent.getStringExtra(FileUploader.EXTRA_OLD_FILE_PATH); @@@ -69,16 -79,12 +83,17 @@@ } db.close(); } + */ } - private void handleNewPhotoAction(Context context, Intent intent) { + private void handleNewMediaAction(Context context, Intent intent) { + Cursor c = null; + String file_path = null; + String file_name = null; + String mime_type = null; + if (!instantUploadEnabled(context)) { - Log_OC.d(TAG, "Instant upload disabled, abording uploading"); + Log_OC.d(TAG, "Instant upload disabled, aborting uploading"); return; } @@@ -88,36 -94,19 +103,36 @@@ return; } - Cursor c = context.getContentResolver().query(intent.getData(), CONTENT_PROJECTION, null, null, null); - - if (!c.moveToFirst()) { - Log_OC.e(TAG, "Couldn't resolve given uri: " + intent.getDataString()); - return; + if (intent.getAction().equals(NEW_PHOTO_ACTION)) { + String[] CONTENT_PROJECTION = { Images.Media.DATA, Images.Media.DISPLAY_NAME, Images.Media.MIME_TYPE, Images.Media.SIZE }; + c = context.getContentResolver().query(intent.getData(), CONTENT_PROJECTION, null, null, null); + if (!c.moveToFirst()) { + Log_OC.e(TAG, "Couldn't resolve given uri: " + intent.getDataString()); + return; + } + file_path = c.getString(c.getColumnIndex(Images.Media.DATA)); + file_name = c.getString(c.getColumnIndex(Images.Media.DISPLAY_NAME)); + mime_type = c.getString(c.getColumnIndex(Images.Media.MIME_TYPE)); + Log_OC.w(TAG, "New photo received"); + } + else if (intent.getAction().equals(NEW_VIDEO_ACTION)) { + if (!isConnectedViaWiFi(context)) { + Log_OC.e(TAG, "No Wifi available .. Video instant upload only possible if WiFi is on"); + return; + } + String[] CONTENT_PROJECTION = { Video.Media.DATA, Video.Media.DISPLAY_NAME, Video.Media.MIME_TYPE, Video.Media.SIZE }; + c = context.getContentResolver().query(intent.getData(), CONTENT_PROJECTION, null, null, null); + if (!c.moveToFirst()) { + Log_OC.e(TAG, "Couldn't resolve given uri: " + intent.getDataString()); + return; + } + file_path = c.getString(c.getColumnIndex(Video.Media.DATA)); + file_name = c.getString(c.getColumnIndex(Video.Media.DISPLAY_NAME)); + mime_type = c.getString(c.getColumnIndex(Video.Media.MIME_TYPE)); + Log_OC.w(TAG, "New video received"); } - - String file_path = c.getString(c.getColumnIndex(Media.DATA)); - String file_name = c.getString(c.getColumnIndex(Media.DISPLAY_NAME)); - String mime_type = c.getString(c.getColumnIndex(Media.MIME_TYPE)); - c.close(); - Log_OC.e(TAG, file_path + ""); + Log_OC.d(TAG, file_path + ""); // same always temporally the picture to upload DbHandler db = new DbHandler(context); @@@ -136,8 -125,8 +151,8 @@@ // we can unregister from entire listenings but thats suck a bit. // On the other hand this might be only for dynamicly registered // broadcast receivers, needs investigation. - IntentFilter filter = new IntentFilter(FileUploader.UPLOAD_FINISH_MESSAGE); - context.getApplicationContext().registerReceiver(this, filter); + /*IntentFilter filter = new IntentFilter(FileUploader.UPLOAD_FINISH_MESSAGE); + context.getApplicationContext().registerReceiver(this, filter);*/ Intent i = new Intent(context, FileUploader.class); i.putExtra(FileUploader.KEY_ACCOUNT, account); @@@ -162,14 -151,14 +177,14 @@@ DbHandler db = new DbHandler(context); Cursor c = db.getAwaitingFiles(); if (c.moveToFirst()) { - IntentFilter filter = new IntentFilter(FileUploader.UPLOAD_FINISH_MESSAGE); - context.getApplicationContext().registerReceiver(this, filter); + //IntentFilter filter = new IntentFilter(FileUploader.UPLOAD_FINISH_MESSAGE); + //context.getApplicationContext().registerReceiver(this, filter); do { String account_name = c.getString(c.getColumnIndex("account")); String file_path = c.getString(c.getColumnIndex("path")); File f = new File(file_path); if (f.exists()) { - Account account = new Account(account_name, AccountAuthenticator.ACCOUNT_TYPE); + Account account = new Account(account_name, MainApp.getAccountType()); String mimeType = null; try {