Skip to content

Commit

Permalink
Build with SDK 27.
Browse files Browse the repository at this point in the history
NotificationCompat from the v7 support library is deprecated so fall
back to using the v4 support library.

Change-Id: I1ef1c9dd136508abdf9670fb78564f7711dd787d
  • Loading branch information
AndrewScull committed Dec 13, 2017
1 parent b5fb2d0 commit dc98288
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down Expand Up @@ -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')
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 0 additions & 5 deletions app/src/main/java/com/afwsamples/testdpc/common/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit dc98288

Please sign in to comment.