Skip to content

Commit

Permalink
Merge pull request #752 from haiwen/fix_google_paly_errer
Browse files Browse the repository at this point in the history
Fix google paly errer
  • Loading branch information
freeplant authored Aug 6, 2018
2 parents be479e6 + 3c67d5b commit 0513ccc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

<activity android:name="com.seafile.seadroid2.ui.activity.BrowserActivity"
android:label="@string/app_name"
android:configChanges="orientation"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/com/seafile/seadroid2/data/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ public synchronized File getFileByBlocks(String repoName, String repoID, String
}

final Pair<String, String> pair = getRepoEncKey(repoID);
if (pair == null) {
throw SeafException.decryptException;
}
final String encKey = pair.first;
final String encIv = pair.second;
if (TextUtils.isEmpty(encKey) || TextUtils.isEmpty(encIv)) {
Expand Down Expand Up @@ -646,6 +649,9 @@ public List<SeafCachedFile> getCachedFiles() {
}

public void addCachedFile(String repoName, String repoID, String path, String fileID, File file) {
if (file == null) {
return;
}
// notify Android Gallery that a new file has appeared

// file does not always reside in Seadroid directory structure (e.g. camera upload)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,10 @@ else if (which == 1) // create folder
* @param fileName
*/
public void downloadFile(String dir, String fileName) {
// txService maybe null if layout orientation has changed
if (txService == null) {
return;
}
String filePath = Utils.pathJoin(dir, fileName);
txService.addDownloadTask(account,
navContext.getRepoName(),
Expand Down Expand Up @@ -1700,6 +1704,10 @@ protected void onPostExecute(List<SeafDirent> dirents) {
}

private void startFileActivity(String repoName, String repoID, String filePath, long fileSize) {
// txService maybe null if layout orientation has changed
if (txService == null) {
return;
}
int taskID = txService.addDownloadTask(account, repoName, repoID, filePath, fileSize);
Intent intent = new Intent(this, FileActivity.class);
intent.putExtra("repoName", repoName);
Expand Down

0 comments on commit 0513ccc

Please sign in to comment.