소스 검색

codacy: combine if blocks

AndyScherzinger 7 년 전
부모
커밋
487407fb49
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      src/main/java/com/owncloud/android/MainApp.java

+ 5 - 3
src/main/java/com/owncloud/android/MainApp.java

@@ -264,10 +264,12 @@ public class MainApp extends MultiDexApplication {
         }
     }
 
-    private static void createChannel(NotificationManager notificationManager, String channelId, int channelName,
+    private static void createChannel(NotificationManager notificationManager,
+                                      String channelId, int channelName,
                                       int channelDescription, Context context) {
-        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O && getAppContext() != null) {
-            if (notificationManager.getNotificationChannel(channelId) == null) {
+        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O
+                && getAppContext() != null
+                && notificationManager.getNotificationChannel(channelId) == null) {
                 CharSequence name = context.getString(channelName);
                 String description = context.getString(channelDescription);
                 NotificationChannel channel = new NotificationChannel(channelId, name,