diff --git a/app/build.gradle b/app/build.gradle index 2b798207..19ecd5ad 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,13 +13,13 @@ ext { } android { - compileSdkVersion 26 - buildToolsVersion "26.0.0" + compileSdkVersion 27 + buildToolsVersion "27.0.1" defaultConfig { applicationId "com.afwsamples.testdpc" minSdkVersion 21 - targetSdkVersion 26 + targetSdkVersion 27 versionCode versionMajor * 1000 + versionMinor * 100 + versionBuild versionName "${versionMajor}.${versionMinor}.${versionBuild}" } @@ -66,9 +66,9 @@ android { } dependencies { - compile 'com.android.support:preference-v14:26.0.0' - compile 'com.android.support:recyclerview-v7:26.0.0' - compile 'com.android.support:support-v13:26.0.0' + compile 'com.android.support:preference-v14:27.0.2' + compile 'com.android.support:recyclerview-v7:27.0.2' + compile 'com.android.support:support-v13:27.0.2' compile 'com.google.android.gms:play-services-safetynet:+' compile(name:'setup-wizard-lib-platform-release', ext:'aar') } diff --git a/app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java b/app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java index 2840dcee..d384bb8a 100644 --- a/app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java +++ b/app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java @@ -17,7 +17,6 @@ package com.afwsamples.testdpc; import android.annotation.TargetApi; -import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.admin.DevicePolicyManager; @@ -33,13 +32,12 @@ import android.os.UserHandle; import android.os.UserManager; import android.preference.PreferenceManager; -import android.support.v7.app.NotificationCompat; +import android.support.v4.app.NotificationCompat; import android.text.TextUtils; import android.util.Log; import android.widget.Toast; import com.afwsamples.testdpc.common.NotificationUtil; -import com.afwsamples.testdpc.common.Util; import com.afwsamples.testdpc.provision.PostProvisioningTask; import java.io.BufferedReader; diff --git a/app/src/main/java/com/afwsamples/testdpc/PackageMonitorReceiver.java b/app/src/main/java/com/afwsamples/testdpc/PackageMonitorReceiver.java index b175056d..6d6e35b4 100644 --- a/app/src/main/java/com/afwsamples/testdpc/PackageMonitorReceiver.java +++ b/app/src/main/java/com/afwsamples/testdpc/PackageMonitorReceiver.java @@ -5,9 +5,9 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import android.support.v7.app.NotificationCompat; -import android.support.v7.app.NotificationCompat.Builder; +import android.support.v4.app.NotificationCompat; import android.text.TextUtils; + import com.afwsamples.testdpc.common.NotificationUtil; public class PackageMonitorReceiver extends BroadcastReceiver { diff --git a/app/src/main/java/com/afwsamples/testdpc/common/NotificationUtil.java b/app/src/main/java/com/afwsamples/testdpc/common/NotificationUtil.java index 63845852..1ce37d9c 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/NotificationUtil.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/NotificationUtil.java @@ -8,7 +8,7 @@ import android.support.annotation.RequiresApi; import android.support.annotation.StringRes; import android.support.v4.os.BuildCompat; -import android.support.v7.app.NotificationCompat; +import android.support.v4.app.NotificationCompat; import com.afwsamples.testdpc.R; @@ -37,8 +37,8 @@ public static NotificationCompat.Builder getNotificationBuilder(Context context) if (BuildCompat.isAtLeastO()) { createDefaultNotificationChannel(context); } - NotificationCompat.Builder builder = new NotificationCompat.Builder(context); - builder.setChannelId(DEFAULT_CHANNEL_ID); + NotificationCompat.Builder builder + = new NotificationCompat.Builder(context, DEFAULT_CHANNEL_ID); return builder; } diff --git a/app/src/main/java/com/afwsamples/testdpc/common/Util.java b/app/src/main/java/com/afwsamples/testdpc/common/Util.java index d4b74d25..0ebd9e80 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/Util.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/Util.java @@ -17,9 +17,6 @@ package com.afwsamples.testdpc.common; import android.annotation.TargetApi; -import android.app.Notification; -import android.app.NotificationChannel; -import android.app.NotificationManager; import android.app.Service; import android.app.admin.DevicePolicyManager; import android.content.ActivityNotFoundException; @@ -33,10 +30,8 @@ import android.os.Bundle; import android.os.UserHandle; import android.os.UserManager; -import android.support.annotation.RequiresApi; import android.support.v14.preference.PreferenceFragment; import android.support.v4.os.BuildCompat; -import android.support.v7.app.NotificationCompat; import android.text.format.DateUtils; import android.util.Log; import android.widget.ImageView;