Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkaW committed Oct 5, 2018
1 parent 4390c73 commit db7e9c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha11'
classpath 'com.android.tools.build:gradle:3.3.0-alpha12'

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Sat Sep 15 16:10:59 CST 2018
#Sun Sep 30 23:11:47 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
4 changes: 2 additions & 2 deletions manager/build.gradle
Expand Up @@ -73,8 +73,8 @@ dependencies {
implementation "moe.shizuku.preference:preference-dialog-android:$preferenceLibraryVersion"
implementation "moe.shizuku.preference:preference-simplemenu:$preferenceLibraryVersion"
implementation "moe.shizuku.support:design:3.0.0"
implementation 'moe.shizuku.support:support-utils:3.0.0'
implementation 'moe.shizuku.support:recyclerview-utils:3.0.0'
implementation 'moe.shizuku.support:support-utils:3.0.2'
implementation 'moe.shizuku.support:recyclerview-utils:3.0.2'
implementation 'moe.shizuku.fontprovider:api:10'
implementation 'io.reactivex.rxjava2:rxjava:2.2.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
Expand Down
20 changes: 7 additions & 13 deletions manager/src/main/java/moe/shizuku/manager/service/WorkService.java
@@ -1,5 +1,6 @@
package moe.shizuku.manager.service;

import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
Expand Down Expand Up @@ -63,20 +64,13 @@ public Notification onStartForeground() {
return builder.build();
}

@TargetApi(Build.VERSION_CODES.O)
@Override
public void onCreate() {
super.onCreate();

NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

if (notificationManager != null
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_WORK, getString(R.string.channel_service_status), NotificationManager.IMPORTANCE_MIN);
channel.setSound(null, null);
channel.setShowBadge(false);

notificationManager.createNotificationChannel(channel);
}
public void onCreateNotificationChannel(NotificationManager notificationManager) {
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_WORK, getString(R.string.channel_service_status), NotificationManager.IMPORTANCE_MIN);
channel.setSound(null, null);
channel.setShowBadge(false);
notificationManager.createNotificationChannel(channel);
}

@Override
Expand Down

0 comments on commit db7e9c8

Please sign in to comment.