|
@@ -37,7 +37,6 @@ import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.content.IntentFilter;
|
|
|
import android.content.ServiceConnection;
|
|
|
-import android.content.SharedPreferences;
|
|
|
import android.content.SyncRequest;
|
|
|
import android.content.pm.PackageManager;
|
|
|
import android.content.res.Resources.NotFoundException;
|
|
@@ -63,7 +62,8 @@ import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
|
|
import com.owncloud.android.datamodel.FileDataStorageManager;
|
|
|
import com.owncloud.android.datamodel.OCFile;
|
|
|
import com.owncloud.android.datamodel.VirtualFolderType;
|
|
|
-import com.owncloud.android.db.PreferenceManager;
|
|
|
+import com.nextcloud.client.preferences.AppPreferences;
|
|
|
+import com.nextcloud.client.preferences.PreferenceManager;
|
|
|
import com.owncloud.android.files.services.FileDownloader;
|
|
|
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
|
|
|
import com.owncloud.android.files.services.FileUploader;
|
|
@@ -206,6 +206,7 @@ public class FileDisplayActivity extends HookActivity
|
|
|
private boolean searchOpen;
|
|
|
|
|
|
private SearchView searchView;
|
|
|
+ private AppPreferences preferences;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
@@ -215,6 +216,8 @@ public class FileDisplayActivity extends HookActivity
|
|
|
super.onCreate(savedInstanceState); // this calls onAccountChanged() when ownCloud Account
|
|
|
// is valid
|
|
|
|
|
|
+ preferences = PreferenceManager.fromContext(this);
|
|
|
+
|
|
|
/// Load of saved instance state
|
|
|
if (savedInstanceState != null) {
|
|
|
mWaitingToPreview = savedInstanceState.getParcelable(FileDisplayActivity.KEY_WAITING_TO_PREVIEW);
|
|
@@ -316,24 +319,8 @@ public class FileDisplayActivity extends HookActivity
|
|
|
*/
|
|
|
private void upgradeNotificationForInstantUpload() {
|
|
|
// check for Android 6+ if legacy instant upload is activated --> disable + show info
|
|
|
- if (PreferenceManager.instantPictureUploadEnabled(this) ||
|
|
|
- PreferenceManager.instantVideoUploadEnabled(this)) {
|
|
|
-
|
|
|
- // remove legacy shared preferences
|
|
|
- SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
|
|
|
- editor.remove("instant_uploading")
|
|
|
- .remove("instant_video_uploading")
|
|
|
- .remove("instant_upload_path")
|
|
|
- .remove("instant_upload_path_use_subfolders")
|
|
|
- .remove("instant_upload_on_wifi")
|
|
|
- .remove("instant_upload_on_charging")
|
|
|
- .remove("instant_video_upload_path")
|
|
|
- .remove("instant_video_upload_path_use_subfolders")
|
|
|
- .remove("instant_video_upload_on_wifi")
|
|
|
- .remove("instant_video_uploading")
|
|
|
- .remove("instant_video_upload_on_charging")
|
|
|
- .remove("prefs_instant_behaviour").apply();
|
|
|
-
|
|
|
+ if (preferences.instantPictureUploadEnabled() || preferences.instantVideoUploadEnabled()) {
|
|
|
+ preferences.removeLegacyPreferences();
|
|
|
// show info pop-up
|
|
|
new AlertDialog.Builder(this, R.style.Theme_ownCloud_Dialog)
|
|
|
.setTitle(R.string.drawer_synced_folders)
|