Skip to content

Commit

Permalink
Merge pull request #2332 from owncloud/release_2.9.0
Browse files Browse the repository at this point in the history
Release 2.9.0
  • Loading branch information
davigonz committed Nov 6, 2018
2 parents 3bb003e + cce352b commit bd07b13
Show file tree
Hide file tree
Showing 29 changed files with 355 additions and 159 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## 2.9.0 (November 2018)
- Search in current folder
- Select all/inverse files (contribution)
- Improve available offline files synchronization and conflict resolution (Android 5 or higher required)
- Sort files in file picker when uploading (contribution)
- Access ownCloud files from files apps, even with files not downloaded
- New login view
- Show re-shares
- Switch apache and jackrabbit deprecated network libraries to more modern and active library, OkHttp + Dav4Android
- UI improvements, including:
+ Change edit share icon
+ New gradient in top of the list of files (contribution)
+ More accurate message when creating folders with the same name (contribution)
- Bug fixes, including:
+ Fix some crashes:
- When rebooting the device
- When copying, moving files or choosing a folder within camera uploads feature
- When creating private/public link
+ Fix some failing downloads
+ Fix pattern lock being asked very often after disabling fingerprint lock (contribution)

## 2.9.0 beta v2 (October 2018)
- Bug fixes, including:
+ Fix some crashes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ public void test3_check_login()
//To avoid the short delay when the activity starts
SystemClock.sleep(WAIT_INITIAL_MS);

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

setFields(testServerURL, testUser, testPassword);

Expand Down Expand Up @@ -343,8 +343,8 @@ public void test5_check_login_special_characters()

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

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

setFields(testServerURL, testUser2, testPassword2);

Expand Down Expand Up @@ -373,8 +373,8 @@ public void test6_check_login_incorrect()

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

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

setFields(testServerURL, USER_INEXISTENT, testPassword);

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

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

setFields(testServerURL, testUser, testPassword);

Expand All @@ -423,8 +423,8 @@ public void test8_check_login_blanks()

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

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

setFields(testServerURL, "", "");

Expand All @@ -446,8 +446,8 @@ public void test9_check_login_trimmed_blanks()

String UserBlanks = " " + testUser + " ";

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

setFields(testServerURL, UserBlanks, testPassword);

Expand Down Expand Up @@ -477,8 +477,8 @@ public void test_10_check_url_from_browser()

String connectionString = testServerURL + SUFFIX_BROWSER;

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

setFields(connectionString, testUser2, testPassword2);

Expand Down Expand Up @@ -526,7 +526,7 @@ private void setFields (String connectionString, String username, String passwor
// Type server url
onView(withId(R.id.hostUrlInput))
.perform(replaceText(connectionString), closeSoftKeyboard());
onView(withId(R.id.scroll)).perform(click());
onView(withId(R.id.embeddedCheckServerButton)).perform(click());
SystemClock.sleep(WAIT_CONNECTION_MS);

checkStatusMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.replaceText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
Expand Down Expand Up @@ -185,8 +186,8 @@ public void test1_check_login_saml()

SystemClock.sleep(WAIT_INITIAL_MS);

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

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

Expand Down Expand Up @@ -236,7 +237,8 @@ public void test2_check_login_saml_orientation_changes()

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

onView(withId(R.id.loginButton)).check(matches(not(isEnabled())));
// Check that login button is hidden
onView(withId(R.id.loginButton)).check(matches(not(isDisplayed())));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public void test_13_capability_allow_public_links()

SystemClock.sleep(WAIT_CONNECTION_MS);

AccountsManager.saveCapabilities(capabilities, testServerURL, testUser);
AccountsManager.saveCapabilities(targetContext ,capabilities, testServerURL, testUser);

//Select share option
selectShare(folder2);
Expand Down Expand Up @@ -716,7 +716,7 @@ public void test_14_capability_allow_public_uploads()

SystemClock.sleep(WAIT_CONNECTION_MS);

AccountsManager.saveCapabilities(capabilities, testServerURL, testUser);
AccountsManager.saveCapabilities(targetContext, capabilities, testServerURL, testUser);

//Select share option
selectShare(folder2);
Expand Down
13 changes: 4 additions & 9 deletions androidTest/java/com/owncloud/android/utils/AccountsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,14 @@ public static String regularURL(String url){

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

}

//Save capabilities (in device DB)
public static void saveCapabilities (OCCapability capabilities, String server, String user){
FileDataStorageManager fm = new FileDataStorageManager(new Account(buildAccountName(user, server), accountType),
public static void saveCapabilities (Context context, OCCapability capabilities, String server, String user){
FileDataStorageManager fm = new FileDataStorageManager(context, new Account(buildAccountName(user, server), accountType),
MainApp.getAppContext().getContentResolver());
fm.saveCapabilities (capabilities);
}
Expand Down
4 changes: 2 additions & 2 deletions oc_jb_workaround/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
compileSdkVersion 26

defaultConfig {
versionCode = 100039
versionName = "1.0.39"
versionCode = 100040
versionName = "1.0.40"
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion res/layout/files_folder_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/common_cancel"
android:text="@android:string/cancel"
android:theme="@style/Button.Secondary" />

<ImageButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* @author LukeOwncloud
* @author Christian Schabesberger
* @author David González Verdugo
* Copyright (C) 2018 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -167,32 +168,30 @@ private void wifiConnected(Context context) {
) {

Handler h = new Handler(Looper.getMainLooper());
h.postDelayed(new Runnable() {
@Override
public void run() {
Log_OC.d(TAG, "Requesting retry of camera uploads (& friends)");
TransferRequester requester = new TransferRequester();

//Avoid duplicate uploads, because uploads retry is also managed in FileUploader
//by using jobs in versions 5 or higher
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {

requester.retryFailedUploads(
MainApp.getAppContext(),
null,
// for the interrupted when Wifi fell, if any
// (side effect: any upload failed due to network error will be
// retried too, instant or not)
UploadResult.NETWORK_CONNECTION
);
}
h.postDelayed(() -> {
Log_OC.d(TAG, "Requesting retry of camera uploads (& friends)");
TransferRequester requester = new TransferRequester();

//Avoid duplicate uploads, because uploads retry is also managed in FileUploader
//by using jobs in versions 5 or higher
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
requester.retryFailedUploads(
MainApp.getAppContext(),
null,
UploadResult.DELAYED_FOR_WIFI // for the rest of enqueued when Wifi fell
MainApp.getAppContext(),
null,
// for the interrupted when Wifi fell, if any
// (side effect: any upload failed due to network error will be
// retried too, instant or not)
UploadResult.NETWORK_CONNECTION,
true
);
}

requester.retryFailedUploads(
MainApp.getAppContext(),
null,
UploadResult.DELAYED_FOR_WIFI, // for the rest of enqueued when Wifi fell
true
);
},
500
);
Expand Down
11 changes: 7 additions & 4 deletions src/com/owncloud/android/files/services/FileDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class FileDownloader extends Service
public static final String KEY_ACCOUNT = "ACCOUNT";
public static final String KEY_FILE = "FILE";
public static final String KEY_IS_AVAILABLE_OFFLINE_FILE = "KEY_IS_AVAILABLE_OFFLINE_FILE";
public static final String KEY_RETRY_DOWNLOAD = "KEY_RETRY_DOWNLOAD";

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

boolean isAvailableOfflineFile = intent.getBooleanExtra(KEY_IS_AVAILABLE_OFFLINE_FILE, false);
boolean retryDownload = intent.getBooleanExtra(KEY_RETRY_DOWNLOAD, false);

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

0 comments on commit bd07b13

Please sign in to comment.