Эх сурвалжийг харах

Merge pull request #11273 from nextcloud/chore/compile-sdk-33

build: Bump compileSdk to 33
Tobias Kaminsky 2 жил өмнө
parent
commit
191d7532c0

+ 1 - 1
app/build.gradle

@@ -73,7 +73,7 @@ def perfAnalysis = project.hasProperty('perfAnalysis')
 
 android {
 
-    compileSdkVersion 32
+    compileSdkVersion 33
     // install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
     ndkVersion "${ndkEnv.get("NDK_VERSION")}"
 

+ 7 - 5
app/src/androidTest/java/com/nextcloud/client/integrations/deck/DeckApiTest.kt

@@ -33,6 +33,7 @@ import org.junit.Test
 import org.junit.runner.RunWith
 import org.junit.runners.Parameterized
 import org.junit.runners.Suite
+import org.mockito.ArgumentMatchers.anyInt
 import org.mockito.Mock
 import org.mockito.MockitoAnnotations
 import org.mockito.kotlin.any
@@ -84,7 +85,7 @@ class DeckApiTest {
 
         @Before
         fun setUp() {
-            whenever(packageManager.resolveActivity(any(), any())).thenAnswer {
+            whenever(packageManager.resolveActivity(any(), anyInt())).thenAnswer {
                 val intent = it.getArgument<Intent>(0)
                 return@thenAnswer if (intent.component?.packageName == installedDeckPackage) {
                     ResolveInfo()
@@ -124,7 +125,7 @@ class DeckApiTest {
             // THEN
             //      deck application is not being resolved
             //      open action is not created
-            verify(packageManager, never()).resolveActivity(anyOrNull(), anyOrNull())
+            verify(packageManager, never()).resolveActivity(anyOrNull(), anyOrNull<Int>())
             assertFalse(openDeckActionIntent.isPresent)
         }
     }
@@ -133,7 +134,7 @@ class DeckApiTest {
 
         @Before
         fun setUp() {
-            whenever(packageManager.resolveActivity(any(), any())).thenReturn(null)
+            whenever(packageManager.resolveActivity(any(), anyInt())).thenReturn(null)
         }
 
         @Test
@@ -151,7 +152,8 @@ class DeckApiTest {
             // THEN
             //      deck application is being resolved using all known packages
             //      open action is not created
-            verify(packageManager, times(DeckApiImpl.DECK_APP_PACKAGES.size)).resolveActivity(anyOrNull(), anyOrNull())
+            verify(packageManager, times(DeckApiImpl.DECK_APP_PACKAGES.size))
+                .resolveActivity(anyOrNull(), anyOrNull<Int>())
             assertFalse(openDeckActionIntent.isPresent)
         }
 
@@ -170,7 +172,7 @@ class DeckApiTest {
             // THEN
             //      deck application is not being resolved
             //      open action is not created
-            verify(packageManager, never()).resolveActivity(anyOrNull(), anyOrNull())
+            verify(packageManager, never()).resolveActivity(anyOrNull(), anyOrNull<Int>())
             assertFalse(openDeckActionIntent.isPresent)
         }
     }

+ 2 - 1
app/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java

@@ -73,6 +73,7 @@ import org.apache.commons.httpclient.methods.GetMethod;
 
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.io.InputStream;
 import java.lang.ref.WeakReference;
 import java.net.URLEncoder;
@@ -944,7 +945,7 @@ public final class ThumbnailsCacheManager {
                     } finally {
                         try {
                             retriever.release();
-                        } catch (RuntimeException ex) {
+                        } catch (RuntimeException | IOException ex) {
                             // Ignore failure at this point.
                             Log_OC.w(TAG, "Failed release MediaMetadataRetriever for " + file.getAbsolutePath());
                         }

+ 2 - 3
app/src/main/java/com/owncloud/android/ui/activity/ExternalSiteWebView.java

@@ -193,9 +193,8 @@ public class ExternalSiteWebView extends FileActivity {
         webSettings.setDomStorageEnabled(true);
 
         // caching disabled in debug mode
-        if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
-            webSettings.setAppCacheEnabled(true);
-            webSettings.setAppCachePath(getCacheDir().getPath());
+        if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
+            getWebView().getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
         }
     }
 

+ 2 - 2
app/src/main/java/com/owncloud/android/utils/EncryptionUtils.java

@@ -30,6 +30,7 @@ import com.google.common.collect.Lists;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
 import com.nextcloud.client.account.User;
+import com.owncloud.android.R;
 import com.owncloud.android.datamodel.ArbitraryDataProvider;
 import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;
 import com.owncloud.android.datamodel.DecryptedFolderMetadata;
@@ -664,8 +665,7 @@ public final class EncryptionUtils {
      */
 
     public static List<String> getRandomWords(int count, Context context) throws IOException {
-        InputStream ins = context.getResources().openRawResource(context.getResources()
-                .getIdentifier("encryption_key_words", "raw", context.getPackageName()));
+        InputStream ins = context.getResources().openRawResource(R.raw.encryption_key_words);
 
         InputStreamReader inputStreamReader = new InputStreamReader(ins);