diff --git a/app/build.gradle b/app/build.gradle index 49fea6707..32a78ab2b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" @@ -88,6 +88,17 @@ android { } } } + bundle { + density { + enableSplit true + } + abi { + enableSplit true + } + language { + enableSplit true + } + } allprojects { repositories { diff --git a/app/src/main/java/com/seafile/seadroid2/ui/WidgetUtils.java b/app/src/main/java/com/seafile/seadroid2/ui/WidgetUtils.java index 8f2b20cce..dac996e22 100644 --- a/app/src/main/java/com/seafile/seadroid2/ui/WidgetUtils.java +++ b/app/src/main/java/com/seafile/seadroid2/ui/WidgetUtils.java @@ -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 { diff --git a/app/src/main/java/com/seafile/seadroid2/ui/activity/BrowserActivity.java b/app/src/main/java/com/seafile/seadroid2/ui/activity/BrowserActivity.java index 8ece25d4c..33b2f1320 100644 --- a/app/src/main/java/com/seafile/seadroid2/ui/activity/BrowserActivity.java +++ b/app/src/main/java/com/seafile/seadroid2/ui/activity/BrowserActivity.java @@ -165,6 +165,7 @@ public class BrowserActivity extends BaseActivity private Account account; private Intent mediaObserver; + private Intent monitorIntent; public DataManager getDataManager() { return dataManager; @@ -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(); @@ -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 "); + } + } } diff --git a/build.gradle b/build.gradle index 6e3e6e830..1676c7316 100644 --- a/build.gradle +++ b/build.gradle @@ -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' }