Skip to content

Commit bd07b13

Browse files
authored
Merge pull request #2332 from owncloud/release_2.9.0
Release 2.9.0
2 parents 3bb003e + cce352b commit bd07b13

29 files changed

+355
-159
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## 2.9.0 (November 2018)
2+
- Search in current folder
3+
- Select all/inverse files (contribution)
4+
- Improve available offline files synchronization and conflict resolution (Android 5 or higher required)
5+
- Sort files in file picker when uploading (contribution)
6+
- Access ownCloud files from files apps, even with files not downloaded
7+
- New login view
8+
- Show re-shares
9+
- Switch apache and jackrabbit deprecated network libraries to more modern and active library, OkHttp + Dav4Android
10+
- UI improvements, including:
11+
+ Change edit share icon
12+
+ New gradient in top of the list of files (contribution)
13+
+ More accurate message when creating folders with the same name (contribution)
14+
- Bug fixes, including:
15+
+ Fix some crashes:
16+
- When rebooting the device
17+
- When copying, moving files or choosing a folder within camera uploads feature
18+
- When creating private/public link
19+
+ Fix some failing downloads
20+
+ Fix pattern lock being asked very often after disabling fingerprint lock (contribution)
21+
122
## 2.9.0 beta v2 (October 2018)
223
- Bug fixes, including:
324
+ Fix some crashes:

androidTest/java/com/owncloud/android/authentication/AuthenticatorActivityTest.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ public void test3_check_login()
270270
//To avoid the short delay when the activity starts
271271
SystemClock.sleep(WAIT_INITIAL_MS);
272272

273-
// Check that login button is disabled
274-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
273+
// Check that login button is hidden
274+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
275275

276276
setFields(testServerURL, testUser, testPassword);
277277

@@ -343,8 +343,8 @@ public void test5_check_login_special_characters()
343343

344344
Log_OC.i(LOG_TAG, "Test Check Login Special Characters Start");
345345

346-
// Check that login button is disabled
347-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
346+
// Check that login button is hidden
347+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
348348

349349
setFields(testServerURL, testUser2, testPassword2);
350350

@@ -373,8 +373,8 @@ public void test6_check_login_incorrect()
373373

374374
Log_OC.i(LOG_TAG, "Test Check Login Incorrect Start");
375375

376-
// Check that login button is disabled
377-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
376+
// Check that login button is hidden
377+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
378378

379379
setFields(testServerURL, USER_INEXISTENT, testPassword);
380380

@@ -401,8 +401,8 @@ public void test7_check_existing_account()
401401
//Add an account to the device
402402
AccountsManager.addAccount(targetContext, testServerURL, testUser, testPassword);
403403

404-
// Check that login button is disabled
405-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
404+
// Check that login button is hidden
405+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
406406

407407
setFields(testServerURL, testUser, testPassword);
408408

@@ -423,8 +423,8 @@ public void test8_check_login_blanks()
423423

424424
Log_OC.i(LOG_TAG, "Test Check Blanks Login Start");
425425

426-
// Check that login button is disabled
427-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
426+
// Check that login button is hidden
427+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
428428

429429
setFields(testServerURL, "", "");
430430

@@ -446,8 +446,8 @@ public void test9_check_login_trimmed_blanks()
446446

447447
String UserBlanks = " " + testUser + " ";
448448

449-
// Check that login button is disabled
450-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
449+
// Check that login button is hidden
450+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
451451

452452
setFields(testServerURL, UserBlanks, testPassword);
453453

@@ -477,8 +477,8 @@ public void test_10_check_url_from_browser()
477477

478478
String connectionString = testServerURL + SUFFIX_BROWSER;
479479

480-
// Check that login button is disabled
481-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
480+
// Check that login button is hidden
481+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
482482

483483
setFields(connectionString, testUser2, testPassword2);
484484

@@ -526,7 +526,7 @@ private void setFields (String connectionString, String username, String passwor
526526
// Type server url
527527
onView(withId(R.id.hostUrlInput))
528528
.perform(replaceText(connectionString), closeSoftKeyboard());
529-
onView(withId(R.id.scroll)).perform(click());
529+
onView(withId(R.id.embeddedCheckServerButton)).perform(click());
530530
SystemClock.sleep(WAIT_CONNECTION_MS);
531531

532532
checkStatusMessage();

androidTest/java/com/owncloud/android/authentication/SAMLAuthenticatorActivityTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
5656
import static android.support.test.espresso.action.ViewActions.replaceText;
5757
import static android.support.test.espresso.assertion.ViewAssertions.matches;
58+
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
5859
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
5960
import static android.support.test.espresso.matcher.ViewMatchers.withId;
6061
import static android.support.test.espresso.matcher.ViewMatchers.withText;
@@ -185,8 +186,8 @@ public void test1_check_login_saml()
185186

186187
SystemClock.sleep(WAIT_INITIAL_MS);
187188

188-
// Check that login button is disabled
189-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
189+
// Check that login button is hidden
190+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
190191

191192
onView(withId(R.id.hostUrlInput)).perform(replaceText(testServerURL));
192193

@@ -236,7 +237,8 @@ public void test2_check_login_saml_orientation_changes()
236237

237238
Log_OC.i(LOG_TAG, "Test Check Login SAML Orientation Changes Start");
238239

239-
onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
240+
// Check that login button is hidden
241+
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));
240242

241243
onView(withId(R.id.hostUrlInput)).perform(replaceText(testServerURL));
242244

androidTest/java/com/owncloud/android/ui/activity/PublicShareActivityTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ public void test_13_capability_allow_public_links()
688688

689689
SystemClock.sleep(WAIT_CONNECTION_MS);
690690

691-
AccountsManager.saveCapabilities(capabilities, testServerURL, testUser);
691+
AccountsManager.saveCapabilities(targetContext ,capabilities, testServerURL, testUser);
692692

693693
//Select share option
694694
selectShare(folder2);
@@ -716,7 +716,7 @@ public void test_14_capability_allow_public_uploads()
716716

717717
SystemClock.sleep(WAIT_CONNECTION_MS);
718718

719-
AccountsManager.saveCapabilities(capabilities, testServerURL, testUser);
719+
AccountsManager.saveCapabilities(targetContext, capabilities, testServerURL, testUser);
720720

721721
//Select share option
722722
selectShare(folder2);

androidTest/java/com/owncloud/android/utils/AccountsManager.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,14 @@ public static String regularURL(String url){
115115

116116
//Get server capabilities
117117
public static OCCapability getCapabilities (String server, String user, String pass) {
118-
GetRemoteCapabilitiesOperation getCapabilities = new GetRemoteCapabilitiesOperation();
119-
OwnCloudClient client = new OwnCloudClient(Uri.parse(server),
120-
NetworkUtils.getMultiThreadedConnManager());
121-
client.setCredentials(
122-
OwnCloudCredentialsFactory.newBasicCredentials(user, pass));
123-
RemoteOperationResult result = getCapabilities.execute(client);
124-
return (OCCapability) result.getData().get(0);
118+
//REDO -> need mocks or integration with new networking stuff
119+
return new OCCapability();
125120

126121
}
127122

128123
//Save capabilities (in device DB)
129-
public static void saveCapabilities (OCCapability capabilities, String server, String user){
130-
FileDataStorageManager fm = new FileDataStorageManager(new Account(buildAccountName(user, server), accountType),
124+
public static void saveCapabilities (Context context, OCCapability capabilities, String server, String user){
125+
FileDataStorageManager fm = new FileDataStorageManager(context, new Account(buildAccountName(user, server), accountType),
131126
MainApp.getAppContext().getContentResolver());
132127
fm.saveCapabilities (capabilities);
133128
}

oc_jb_workaround/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ android {
2525
compileSdkVersion 26
2626

2727
defaultConfig {
28-
versionCode = 100039
29-
versionName = "1.0.39"
28+
versionCode = 100040
29+
versionName = "1.0.40"
3030
}
3131

3232
sourceSets {

res/layout/files_folder_picker.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4040
android:layout_width="wrap_content"
4141
android:layout_height="wrap_content"
4242
android:layout_weight="1"
43-
android:text="@string/common_cancel"
43+
android:text="@android:string/cancel"
4444
android:theme="@style/Button.Secondary" />
4545

4646
<ImageButton

src/com/owncloud/android/broadcastreceivers/ConnectivityActionReceiver.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*
44
* @author LukeOwncloud
55
* @author Christian Schabesberger
6+
* @author David González Verdugo
67
* Copyright (C) 2018 ownCloud GmbH.
78
*
89
* This program is free software: you can redistribute it and/or modify
@@ -167,32 +168,30 @@ private void wifiConnected(Context context) {
167168
) {
168169

169170
Handler h = new Handler(Looper.getMainLooper());
170-
h.postDelayed(new Runnable() {
171-
@Override
172-
public void run() {
173-
Log_OC.d(TAG, "Requesting retry of camera uploads (& friends)");
174-
TransferRequester requester = new TransferRequester();
175-
176-
//Avoid duplicate uploads, because uploads retry is also managed in FileUploader
177-
//by using jobs in versions 5 or higher
178-
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
179-
180-
requester.retryFailedUploads(
181-
MainApp.getAppContext(),
182-
null,
183-
// for the interrupted when Wifi fell, if any
184-
// (side effect: any upload failed due to network error will be
185-
// retried too, instant or not)
186-
UploadResult.NETWORK_CONNECTION
187-
);
188-
}
171+
h.postDelayed(() -> {
172+
Log_OC.d(TAG, "Requesting retry of camera uploads (& friends)");
173+
TransferRequester requester = new TransferRequester();
189174

175+
//Avoid duplicate uploads, because uploads retry is also managed in FileUploader
176+
//by using jobs in versions 5 or higher
177+
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
190178
requester.retryFailedUploads(
191-
MainApp.getAppContext(),
192-
null,
193-
UploadResult.DELAYED_FOR_WIFI // for the rest of enqueued when Wifi fell
179+
MainApp.getAppContext(),
180+
null,
181+
// for the interrupted when Wifi fell, if any
182+
// (side effect: any upload failed due to network error will be
183+
// retried too, instant or not)
184+
UploadResult.NETWORK_CONNECTION,
185+
true
194186
);
195187
}
188+
189+
requester.retryFailedUploads(
190+
MainApp.getAppContext(),
191+
null,
192+
UploadResult.DELAYED_FOR_WIFI, // for the rest of enqueued when Wifi fell
193+
true
194+
);
196195
},
197196
500
198197
);

src/com/owncloud/android/files/services/FileDownloader.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public class FileDownloader extends Service
7979
public static final String KEY_ACCOUNT = "ACCOUNT";
8080
public static final String KEY_FILE = "FILE";
8181
public static final String KEY_IS_AVAILABLE_OFFLINE_FILE = "KEY_IS_AVAILABLE_OFFLINE_FILE";
82+
public static final String KEY_RETRY_DOWNLOAD = "KEY_RETRY_DOWNLOAD";
8283

8384
private static final String DOWNLOAD_ADDED_MESSAGE = "DOWNLOAD_ADDED";
8485
private static final String DOWNLOAD_FINISH_MESSAGE = "DOWNLOAD_FINISH";
@@ -186,12 +187,13 @@ public int onStartCommand(Intent intent, int flags, int startId) {
186187
Log_OC.d(TAG, "Starting command with id " + startId);
187188

188189
boolean isAvailableOfflineFile = intent.getBooleanExtra(KEY_IS_AVAILABLE_OFFLINE_FILE, false);
190+
boolean retryDownload = intent.getBooleanExtra(KEY_RETRY_DOWNLOAD, false);
189191

190-
if (isAvailableOfflineFile && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
192+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && (isAvailableOfflineFile || retryDownload)) {
191193
/**
192-
* After calling startForegroundService method from
193-
* {@link com.owncloud.android.operations.SynchronizeFileOperation}, we have to call this within
194-
* five seconds after the service is created to avoid an error
194+
* We have to call this within five seconds after the service is created with startForegroundService when:
195+
* - Checking available offline files in background
196+
* - Retry downloads in background, e.g. when recovering wifi connection
195197
*/
196198
Log_OC.d(TAG, "Starting FileDownloader service in foreground");
197199
startForeground(1, mNotificationBuilder.build());
@@ -421,6 +423,7 @@ public void handleMessage(Message msg) {
421423
}
422424
}
423425
Log_OC.d(TAG, "Stopping after command with id " + msg.arg1);
426+
mService.stopForeground(true);
424427
mService.stopSelf(msg.arg1);
425428
}
426429
}

0 commit comments

Comments
 (0)