Merge remote-tracking branch 'remotes/upstream/bug_1251' into beta
authortobiasKaminsky <tobias@kaminsky.me>
Fri, 20 Nov 2015 17:51:37 +0000 (18:51 +0100)
committertobiasKaminsky <tobias@kaminsky.me>
Fri, 20 Nov 2015 17:51:37 +0000 (18:51 +0100)
1  2 
CHANGELOG.md
src/com/owncloud/android/ui/activity/PassCodeActivity.java
src/com/owncloud/android/ui/activity/Preferences.java

diff --cc CHANGELOG.md
@@@ -1,51 -1,60 +1,55 @@@
 -## 1.8.0 (September 2015)
 -- New MATERIAL DESIGN theme
 -- Updated FILE TYPE ICONS
 -- Preview TXT files within the app
 -- COPY files & folders
 -- Preview the full file/folder name from the long press menu
 -- Set a file as FAVORITE (kept-in-sync) from the CONTEXT MENU
 -- Updated CONFLICT RESOLUTION dialog (wording)
 -- Updated background for images with TRANSPARENCY in GALLERY
 -- Hidden files will not enforce list view instead of GRID VIEW (folders from Picasa & others)
 -- Security:
 -  + Updated network stack with security fixes (Jackrabbit 2.10.1)
 -- Bugs fixed:
 -  + Fixed crash when ETag is lost
 -  + Passcode creation not restarted on device rotation
 -  + Recovered share icon shown on folders 'shared with me'
 -  + User name added to subject when sending a share link through e-mail (fixed on SAMLed apps)
 -
 -## 1.7.2 (July 2015)
 -- New navigation drawer
 -- Improved Passcode
 -- Automatic grid view just for folders full of images
 -- More characters allowed in file names
 -- Support for servers in same domain, different path
 -- Bugs fixed:
 -  + Frequent crashes in folder with several images
 -  + Sync error in servers with huge quota and external storage enable
 -  + Share by link error 
 -  + Some other crashes and minor bugs
 -
 -## 1.7.1 (April 2015)
 -
 -- Share link even with password enforced by server
 -- Get the app ready for oc 8.1 servers
 -- Added option to create new folder in uploads from external apps
 -- Improved management of deleted users
 -- Bugs fixed
 -  + Fixed crash on Android 2.x devices
 -  + Improvements on uploads
 -
 -## 1.7.0 (February 2015)
 -
 -- Download full folders
 -- Grid view for images
 -- Remote thumbnails (OC Server 8.0+)
 -- Added number of files and folders at the end of the list
 -- "Open with" in contextual menu
 -- Downloads added to Media Provider
 -- Uploads:
 -  + Local thumbnails in section "Files"
 -  + Multiple selection in "Content from other apps" (Android 4.3+)
 -- Gallery: 
 -  + proper handling of EXIF
 -  + obey sorting in the list of files
 -- Settings view updated
 -- Improved subjects in e-mails
 -- Bugs fixed
 -
 -
 -
++# 2015-11-20
++- PR [#1293] (https://github.com/owncloud/android/pull/1293) "External SD by przybylski" merged
++- PR [#1296] (https://github.com/owncloud/android/pull/1296) "Don't allow to remove passcode without entering it. Don't allow to set incomplete passcode by przybylski" merged
++
 +# 2015-11-18
 +- update all PR
 +- fix #1259
 +
 +# 2015-11-13
 +- update all PR
 +
 +# 2015-11-10
 +- update master
 +- PR [#1277] (https://github.com/owncloud/android/pull/1277) "Optimized uploader layout and user configured sorting" merged
 +
 +# 2015-11-05
 +- update master
 +- fix #1244
 +- add changelog
 +- add check for update of beta version
 +
 +# 2015-11-02
 +- PR [#1240](https://github.com/owncloud/android/pull/1240) "Set as wallpaper" merged
 +- updated other PRs
 +
 +# 2015-11-01
 +- PR [#1236](https://github.com/owncloud/android/pull/1236) "Streaming video/audio" merged
 +- PR [#1035](https://github.com/owncloud/android/pull/1035) "Enable video thumbnail" merged
 +
 +# 2015-10-31
 +- updated all PR
 +- bugfix: #1234, #1230
 +- implement Crash Handler
 +- implement direct download of latest apk in settings -> last item on bottom
 +
 +# 2015-10-30
 +- fixed problem with Authority
 +
 +# 2015-10-29
 +- PR [#1099](https://github.com/owncloud/android/pull/1099) "Switch list vs grid" merged
 +- PR [#1100](https://github.com/owncloud/android/pull/1100) "Material FAB with speed dial implementation" merged
 +- PR [#1209](https://github.com/owncloud/android/pull/1209) "Material buttons - before in #1090" merged
 +- PR [#1205](https://github.com/owncloud/android/pull/1205) "Switch between online and offline files" merged
 +- PR [#1195](https://github.com/owncloud/android/pull/1195) "Resize Cache" merged
 +- PR [#1187](https://github.com/owncloud/android/pull/1187) "Video: Big thumbnails" merged
 +- PR [#1058](https://github.com/owncloud/android/pull/1058) "add sort to UploadFileActiviy" merged
 +- PR [#1168](https://github.com/owncloud/android/pull/1168) "Avoid duplicate files" merged
 +- PR [#1176](https://github.com/owncloud/android/pull/1176) "Multi select" merged
 +
 +
 +# 2015-10-26
 +- start of branch
 +- PR [#745](https://github.com/owncloud/android/pull/745) merged
 +- PR [#1044](https://github.com/owncloud/android/pull/1044) merged: < 8.1: GalleryPlus app needed, >= 8.2 Gallery app needed
 +- PR [#1111](https://github.com/owncloud/android/pull/1111) merged
@@@ -106,8 -94,8 +106,10 @@@ public class Preferences extends Prefer
  
      private static final int ACTION_SELECT_UPLOAD_PATH = 1;
      private static final int ACTION_SELECT_UPLOAD_VIDEO_PATH = 2;
+     private static final int ACTION_REQUEST_PASSCODE = 5;
+     private static final int ACTION_CONFIRM_PASSCODE = 6;
 +    private static final int ACTION_SELECT_STORAGE_PATH = 3;
 +    private static final int ACTION_PERFORM_MIGRATION = 4;
  
      private DbHandler mDbHandler;
      private CheckBoxPreference pCode;
      protected FileDownloader.FileDownloaderBinder mDownloaderBinder = null;
      protected FileUploader.FileUploaderBinder mUploaderBinder = null;
      private ServiceConnection mDownloadServiceConnection, mUploadServiceConnection = null;
 +    private PreferenceWithLongSummary mPrefStoragePath;
 +    private String mStoragePath;
  
      @SuppressWarnings("deprecation")
      @Override
      public void onCreate(Bundle savedInstanceState) {
              mPrefInstantVideoUploadPath.setSummary(mUploadVideoPath);
  
              saveInstantUploadVideoPathOnPreferences();
 +        } else if (requestCode == ACTION_SELECT_STORAGE_PATH && resultCode == RESULT_OK) {
 +            File currentStorageDir = new File(mStoragePath);
 +            File upcomingStorageDir = new File(data.getStringExtra(UploadFilesActivity.EXTRA_CHOSEN_FILES));
 +
 +            if (currentStorageDir != upcomingStorageDir) {
 +                Intent migrationIntent = new Intent(this, StorageMigrationActivity.class);
 +                migrationIntent.putExtra(StorageMigrationActivity.KEY_MIGRATION_SOURCE_DIR,
 +                        currentStorageDir.getAbsolutePath());
 +                migrationIntent.putExtra(StorageMigrationActivity.KEY_MIGRATION_TARGET_DIR,
 +                        upcomingStorageDir.getAbsolutePath());
 +                startActivityForResult(migrationIntent, ACTION_PERFORM_MIGRATION);
 +            }
 +        } else if (requestCode == ACTION_PERFORM_MIGRATION && resultCode == RESULT_OK) {
 +            String resultStorageDir = data.getStringExtra(StorageMigrationActivity.KEY_MIGRATION_TARGET_DIR);
 +            saveStoragePath(resultStorageDir);
+         } else if (requestCode == ACTION_REQUEST_PASSCODE && resultCode == RESULT_OK) {
+             String passcode = data.getStringExtra(PassCodeActivity.KEY_PASSCODE);
+             if (passcode != null && passcode.length() == 4) {
+                 SharedPreferences.Editor appPrefs = PreferenceManager
+                         .getDefaultSharedPreferences(getApplicationContext()).edit();
+                 for (int i = 1; i <= 4; ++i) {
+                     appPrefs.putString("PrefPinCode" + i, passcode.substring(i-1, i));
+                 }
+                 appPrefs.putBoolean("set_pincode", true);
+                 appPrefs.commit();
+                 Toast.makeText(this, R.string.pass_code_stored, Toast.LENGTH_LONG).show();
+             }
+         } else if (requestCode == ACTION_CONFIRM_PASSCODE && resultCode == RESULT_OK) {
+             if (data.getBooleanExtra(PassCodeActivity.KEY_CHECK_RESULT, false)) {
+                 SharedPreferences.Editor appPrefs = PreferenceManager
+                         .getDefaultSharedPreferences(getApplicationContext()).edit();
+                 appPrefs.putBoolean("set_pincode", false);
+                 appPrefs.commit();
+                 Toast.makeText(this, R.string.pass_code_removed, Toast.LENGTH_LONG).show();
+             }
          }
      }