Skip to content

Commit

Permalink
update targetSdkVersion 30 (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxiaoping authored May 24, 2022
1 parent a503d6d commit 9d700d7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
15 changes: 13 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId 'com.seafile.seadroid2'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 119
versionName "2.2.44"
versionCode 120
versionName "2.2.45"
multiDexEnabled true
resValue "string", "authorities", applicationId + '.cameraupload.provider'
resValue "string", "account_type", "com.seafile.seadroid2.account.api2"
Expand Down Expand Up @@ -88,6 +88,17 @@ android {
}
}
}
bundle {
density {
enableSplit true
}
abi {
enableSplit true
}
language {
enableSplit true
}
}

allprojects {
repositories {
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/java/com/seafile/seadroid2/ui/WidgetUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,13 @@ public static void showFile(final BaseActivity activity, File file, boolean isOp
} else {
open.setDataAndType((Uri.fromFile(file)), mime);
}

if (activity.getPackageManager().resolveActivity(open, 0) == null) {
String message = String.format(activity.getString(R.string.op_exception_suitable_app_not_found), mime);
activity.showShortToast(activity, message);
mime = "*/*";
open.setType(mime);
if (android.os.Build.VERSION.SDK_INT < 30) {
if (activity.getPackageManager().resolveActivity(open, 0) == null) {
String message = String.format(activity.getString(R.string.op_exception_suitable_app_not_found), mime);
activity.showShortToast(activity, message);
mime = "*/*";
open.setType(mime);
}
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public class BrowserActivity extends BaseActivity
private Account account;

private Intent mediaObserver;
private Intent monitorIntent;

public DataManager getDataManager() {
return dataManager;
Expand Down Expand Up @@ -387,7 +388,7 @@ public void onPageScrollStateChanged(int state) {
bindService(bIntent, mConnection, Context.BIND_AUTO_CREATE);
Log.d(DEBUG_TAG, "try bind TransferService");

Intent monitorIntent = new Intent(this, FileMonitorService.class);
monitorIntent = new Intent(this, FileMonitorService.class);
startService(monitorIntent);

requestServerInfo();
Expand Down Expand Up @@ -2448,5 +2449,11 @@ public void onEvent(CheckUploadServiceEvent result) {
} else {
Log.d(DEBUG_TAG, "onEvent============true ");
}
if (!Utils.isServiceRunning(BrowserActivity.this, "com.seafile.seadroid2.monitor.FileMonitorService")) {
monitorIntent = new Intent(this, FileMonitorService.class);
startService(monitorIntent);
Log.d(DEBUG_TAG, "FileMonitorService============false ");
}

}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ ext {
compileSdkVersion = 29
supportLibVersion = '27.1.1' // variable that can be referenced to keep support libs consistent
minSdkVersion = 21
targetSdkVersion = 29
targetSdkVersion = 30
buildToolsVersion = '27.0.3'
}

0 comments on commit 9d700d7

Please sign in to comment.