Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fac9b14 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Migrate to SDK level 28 and AndroidX

parent 4e9e2088
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line

buildscript {
    ext.kotlin_version = '1.2.71'
    ext.kotlin_version = '1.3.10'
    ext.dokka_version = '0.9.17'

    repositories {
@@ -9,7 +9,7 @@ buildscript {
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:${dokka_version}"
    }
@@ -39,18 +39,18 @@ android {
    }

    defaultConfig {
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.cardview:cardview:1.0.0'

    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'androidx.test:runner:1.1.0'
    androidTestImplementation 'androidx.test:rules:1.1.0'

    testImplementation 'junit:junit:4.12'
}
+1 −0
Original line number Diff line number Diff line
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
+10 −10
Original line number Diff line number Diff line
@@ -11,9 +11,8 @@ package at.bitfire.cert4android
import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.support.test.InstrumentationRegistry.getContext
import android.support.test.InstrumentationRegistry.getTargetContext
import android.support.test.rule.ServiceTestRule
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import androidx.test.rule.ServiceTestRule
import org.junit.After
import org.junit.Assert.assertNotNull
import org.junit.Assume.assumeNotNull
@@ -70,12 +69,13 @@ class CustomCertManagerTest {
        val binder = bindService(CustomCertService::class.java)
        assertNotNull(binder)

        CustomCertManager.resetCertificates(getContext())
        val context = getInstrumentation().context
        CustomCertManager.resetCertificates(context)

        certManager = CustomCertManager(getContext(), false)
        certManager = CustomCertManager(context, false)
        assertNotNull(certManager)

        paranoidCertManager = CustomCertManager(getContext(), false, false)
        paranoidCertManager = CustomCertManager(context, false, false)
        assertNotNull(paranoidCertManager)
    }

@@ -114,7 +114,7 @@ class CustomCertManagerTest {

        // remove certificate and check again
        // should now be rejected for the whole session, i.e. no timeout anymore
        val intent = Intent(getContext(), CustomCertService::class.java)
        val intent = Intent(getInstrumentation().context, CustomCertService::class.java)
        intent.action = CustomCertService.CMD_CERTIFICATION_DECISION
        intent.putExtra(CustomCertService.EXTRA_CERTIFICATE, siteCerts!!.first().encoded)
        intent.putExtra(CustomCertService.EXTRA_TRUSTED, false)
@@ -124,7 +124,7 @@ class CustomCertManagerTest {

    private fun addCustomCertificate() {
        // add certificate and check again
        val intent = Intent(getContext(), CustomCertService::class.java)
        val intent = Intent(getInstrumentation().context, CustomCertService::class.java)
        intent.action = CustomCertService.CMD_CERTIFICATION_DECISION
        intent.putExtra(CustomCertService.EXTRA_CERTIFICATE, siteCerts!!.first().encoded)
        intent.putExtra(CustomCertService.EXTRA_TRUSTED, true)
@@ -133,10 +133,10 @@ class CustomCertManagerTest {


    private fun bindService(clazz: Class<out Service>): IBinder {
        var binder = serviceTestRule.bindService(Intent(getTargetContext(), clazz))
        var binder = serviceTestRule.bindService(Intent(getInstrumentation().targetContext, clazz))
        var it = 0
        while (binder == null && it++ <100) {
            binder = serviceTestRule.bindService(Intent(getTargetContext(), clazz))
            binder = serviceTestRule.bindService(Intent(getInstrumentation().targetContext, clazz))
            System.err.println("Waiting for ServiceTestRule.bindService")
            Thread.sleep(50)
        }
+1 −1
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ import android.app.PendingIntent
import android.app.Service
import android.content.Context
import android.content.Intent
import android.support.v4.app.NotificationCompat
import android.widget.Toast
import androidx.core.app.NotificationCompat
import java.io.ByteArrayInputStream
import java.io.File
import java.io.FileInputStream
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.os.Build
import android.support.v4.app.NotificationManagerCompat
import androidx.core.app.NotificationManagerCompat

object NotificationUtils {

Loading