Merge branch 'api-24' into 'master'

Api 24

Based on https://gitlab.com/fdroid/fdroidclient/merge_requests/352 with fixes for robolectric

See merge request !360
This commit is contained in:
Daniel Martí 2016-07-25 12:58:46 +00:00
commit f9bfe2a877
16 changed files with 34 additions and 26 deletions

View File

@ -1,4 +1,4 @@
image: mvdan/fdroid-ci:client-20160706 image: mvdan/fdroid-ci:client-20160709
cache: cache:
paths: paths:
@ -47,12 +47,12 @@ connected10:
- exit $EXITVALUE - exit $EXITVALUE
allow_failure: true # remove once install segfaults are gone allow_failure: true # remove once install segfaults are gone
connected23: connected24:
variables: variables:
AVD_SDK: "23" AVD_SDK: "24"
script: script:
- export GRADLE_USER_HOME=$PWD/.gradle - export GRADLE_USER_HOME=$PWD/.gradle
- emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window & - emulator64-x86 -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
- ./tools/wait-for-emulator - ./tools/wait-for-emulator
- adb shell input keyevent 82 & - adb shell input keyevent 82 &
- export EXITVALUE=0 - export EXITVALUE=0

View File

@ -10,12 +10,12 @@ dependencies {
} }
android { android {
compileSdkVersion 23 compileSdkVersion 24
buildToolsVersion '23.0.3' buildToolsVersion '24.0.0'
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 23 targetSdkVersion 24
versionCode 1050 versionCode 1050
versionName "0.1" versionName "0.1"
} }

View File

@ -139,8 +139,8 @@ if (!hasProperty('sourceDeps')) {
} }
android { android {
compileSdkVersion 23 compileSdkVersion 24
buildToolsVersion '23.0.3' buildToolsVersion '24.0.0'
useLibrary 'org.apache.http.legacy' useLibrary 'org.apache.http.legacy'
buildTypes { buildTypes {

View File

@ -5,7 +5,7 @@
<uses-sdk <uses-sdk
android:minSdkVersion="10" android:minSdkVersion="10"
android:targetSdkVersion="23" android:targetSdkVersion="24"
/> />
<supports-screens <supports-screens

View File

@ -92,6 +92,6 @@ public class DefaultInstaller extends Installer {
@Override @Override
protected boolean supportsContentUri() { protected boolean supportsContentUri() {
// Android N only supports content Uris // Android N only supports content Uris
return Build.VERSION.SDK_INT >= 24; // TODO: Use Build.VERSION_CODES.N return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
} }
} }

View File

@ -79,11 +79,11 @@ public class DefaultInstallerActivity extends FragmentActivity {
throw new RuntimeException("Set the data uri to point to an apk location!"); throw new RuntimeException("Set the data uri to point to an apk location!");
} }
// https://code.google.com/p/android/issues/detail?id=205827 // https://code.google.com/p/android/issues/detail?id=205827
if ((Build.VERSION.SDK_INT < 24) // TODO: Use Build.VERSION_CODES.N if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
&& (!uri.getScheme().equals("file"))) { && (!uri.getScheme().equals("file"))) {
throw new RuntimeException("PackageInstaller < Android N only supports file scheme!"); throw new RuntimeException("PackageInstaller < Android N only supports file scheme!");
} }
if ((Build.VERSION.SDK_INT >= 24) // TODO: Use Build.VERSION_CODES.N if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
&& (!uri.getScheme().equals("content"))) { && (!uri.getScheme().equals("content"))) {
throw new RuntimeException("PackageInstaller >= Android N only supports content scheme!"); throw new RuntimeException("PackageInstaller >= Android N only supports content scheme!");
} }
@ -103,7 +103,7 @@ public class DefaultInstallerActivity extends FragmentActivity {
intent.putExtra(Intent.EXTRA_RETURN_RESULT, true); intent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true); intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true);
intent.putExtra(Intent.EXTRA_ALLOW_REPLACE, true); intent.putExtra(Intent.EXTRA_ALLOW_REPLACE, true);
} else if (Build.VERSION.SDK_INT < 24) { // TODO: Use Build.VERSION_CODES.N } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
intent.setAction(Intent.ACTION_INSTALL_PACKAGE); intent.setAction(Intent.ACTION_INSTALL_PACKAGE);
intent.putExtra(Intent.EXTRA_RETURN_RESULT, true); intent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true); intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true);

View File

@ -19,7 +19,8 @@ import java.util.List;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
@Config(constants = BuildConfig.class) // TODO: Use sdk=24 when Robolectric supports this
@Config(constants = BuildConfig.class, sdk = 23)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class AcceptableMultiRepoUpdaterTest extends MultiRepoUpdaterTest { public class AcceptableMultiRepoUpdaterTest extends MultiRepoUpdaterTest {
private static final String TAG = "AcceptableMultiRepoTest"; private static final String TAG = "AcceptableMultiRepoTest";

View File

@ -38,7 +38,8 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
@Config(constants = BuildConfig.class) // TODO: Use sdk=24 when Robolectric supports this
@Config(constants = BuildConfig.class, sdk = 23)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class RepoXMLHandlerTest { public class RepoXMLHandlerTest {
private static final String TAG = "RepoXMLHandlerTest"; private static final String TAG = "RepoXMLHandlerTest";

View File

@ -15,7 +15,8 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
@Config(constants = BuildConfig.class) // TODO: Use sdk=24 when Robolectric supports this
@Config(constants = BuildConfig.class, sdk = 23)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class UtilsTest { public class UtilsTest {

View File

@ -31,7 +31,8 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
@Config(constants = BuildConfig.class, application = Application.class) // TODO: Use sdk=24 when Robolectric supports this
@Config(constants = BuildConfig.class, application = Application.class, sdk = 23)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class ApkProviderTest extends FDroidProviderTest { public class ApkProviderTest extends FDroidProviderTest {

View File

@ -27,7 +27,8 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
@Config(constants = BuildConfig.class, application = Application.class) // TODO: Use sdk=24 when Robolectric supports this
@Config(constants = BuildConfig.class, application = Application.class, sdk = 23)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class AppProviderTest extends FDroidProviderTest { public class AppProviderTest extends FDroidProviderTest {

View File

@ -23,7 +23,8 @@ import static org.junit.Assert.assertTrue;
import java.util.Map; import java.util.Map;
@Config(constants = BuildConfig.class, application = Application.class) // TODO: Use sdk=24 when Robolectric supports this
@Config(constants = BuildConfig.class, application = Application.class, sdk = 23)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class InstalledAppProviderTest extends FDroidProviderTest { public class InstalledAppProviderTest extends FDroidProviderTest {

View File

@ -20,7 +20,8 @@ import java.util.List;
import static org.fdroid.fdroid.Assert.assertInvalidUri; import static org.fdroid.fdroid.Assert.assertInvalidUri;
import static org.fdroid.fdroid.Assert.assertValidUri; import static org.fdroid.fdroid.Assert.assertValidUri;
@Config(constants = BuildConfig.class) // TODO: Use sdk=24 when Robolectric supports this
@Config(constants = BuildConfig.class, sdk = 23)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class ProviderUriTests { public class ProviderUriTests {

View File

@ -13,7 +13,8 @@ import java.io.IOException;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
@Config(constants = BuildConfig.class) // TODO: Use sdk=24 when Robolectric supports this
@Config(constants = BuildConfig.class, sdk = 23)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class ApkCacheTest { public class ApkCacheTest {

View File

@ -19,7 +19,7 @@ dependencies {
android { android {
compileSdkVersion 19 compileSdkVersion 19
buildToolsVersion '23.0.2' buildToolsVersion '24.0.0'
defaultConfig { defaultConfig {
minSdkVersion 7 minSdkVersion 7

View File

@ -1,12 +1,12 @@
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion 23 compileSdkVersion 24
buildToolsVersion '23.0.3' buildToolsVersion '24.0.0'
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 23 targetSdkVersion 24
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
} }