// Path: app/src/main/java/am/project/x/broadcast/BroadcastApplication.java
// @SuppressWarnings("unused")
// @SuppressLint("Registered")
// public class BroadcastApplication extends MultiDexApplication {
// 
//     private final BroadcastReceiver mBroadcastReceiver = new InnerBroadcastReceiver();
//     private final BroadcastReceiver mLocalBroadcastReceiver = new InnerLocalBroadcastReceiver();
//     private LocalBroadcastManager mLocalBroadcastManager;// 应用内部广播
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         final IntentFilter intentFilter = new IntentFilter();
//         onAddAction(intentFilter);
//         registerReceiver(mBroadcastReceiver, intentFilter);
//         final IntentFilter localIntentFilter = new IntentFilter();
//         onAddLocalAction(localIntentFilter);
//         mLocalBroadcastManager = LocalBroadcastManager.getInstance(this);
//         mLocalBroadcastManager.registerReceiver(mLocalBroadcastReceiver, localIntentFilter);
//     }
// 
//     @Override
//     public void onTerminate() {
//         unregisterReceiver(mBroadcastReceiver);
//         mLocalBroadcastManager.unregisterReceiver(mLocalBroadcastReceiver);
//         super.onTerminate();
//     }
// 
//     /**
//      * 添加广播意图筛选器动作
//      *
//      * @param filter 筛选器
//      */
//     protected void onAddAction(IntentFilter filter) {
//     }
// 
//     /**
//      * 添加本地广播意图筛选器动作
//      *
//      * @param filter 筛选器
//      */
//     protected void onAddLocalAction(IntentFilter filter) {
//     }
// 
//     /**
//      * 接收到广播
//      *
//      * @param context Context
//      * @param intent  意图
//      */
//     protected void onReceiveBroadcast(Context context, Intent intent) {
//     }
// 
//     /**
//      * 接收到本地广播
//      *
//      * @param context Context
//      * @param intent  意图
//      */
//     protected void onReceiveLocalBroadcast(Context context, Intent intent) {
//     }
// 
//     /**
//      * 获取本地广播管理器
//      *
//      * @return 本地广播管理器
//      */
//     public LocalBroadcastManager getLocalBroadcastManager() {
//         return mLocalBroadcastManager;
//     }
// 
//     private class InnerBroadcastReceiver extends BroadcastReceiver {
// 
//         @Override
//         public void onReceive(Context context, Intent intent) {
//             onReceiveBroadcast(context, intent);
//         }
//     }
// 
//     private class InnerLocalBroadcastReceiver extends BroadcastReceiver {
// 
//         @Override
//         public void onReceive(Context context, Intent intent) {
//             onReceiveLocalBroadcast(context, intent);
//         }
//     }
// }
// 
// Path: app/src/main/java/am/project/x/notification/NotificationChannelHelper.java
// public class NotificationChannelHelper {
//     private static final String CHANEL_ID_LOW = "am.project.ftpgo.notification.CHANEL_LOW";// 不发出提示音
// 
//     /**
//      * 更新通知渠道
//      *
//      * @param context Context
//      */
//     public static void updateNotificationChannel(Context context) {
//         updateChannelLow(context);
//     }
// 
//     static String getChannelLow(Context context) {
//         updateChannelLow(context);
//         return CHANEL_ID_LOW;
//     }
// 
//     @Nullable
//     private static NotificationManager getNotificationManager(Context context) {
//         return (NotificationManager) context.getSystemService(
//                 Context.NOTIFICATION_SERVICE);
//     }
// 
//     private static void updateChannelLow(Context context) {
//         if (Build.VERSION.SDK_INT < 26)
//             return;
//         NotificationManager manager = getNotificationManager(context);
//         if (manager == null)
//             return;
//         NotificationChannel channel = manager.getNotificationChannel(CHANEL_ID_LOW);
//         final String name = context.getString(R.string.notification_name_low);
//         if (channel == null) {
//             channel = new NotificationChannel(CHANEL_ID_LOW, name,
//                     NotificationManager.IMPORTANCE_LOW);
//             manager.createNotificationChannel(channel);
//         }
//         channel.setName(name);
//     }
// 
// }


import am.project.x.broadcast.BroadcastApplication;
import am.project.x.notification.NotificationChannelHelper;
/*
 * Copyright (C) 2018 AlexMofer
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package am.project.x;


/**
 * 应用Application
 * 做一些全局变量存储
 * Created by Alex on 2018/7/23.
 */
public class ProjectXApplication extends BroadcastApplication {

    private static ProjectXApplication mInstance;

    @Override
    public void onCreate() {
        mInstance = this;
        super.onCreate();
// Path: app/src/main/java/am/project/x/broadcast/BroadcastApplication.java
// @SuppressWarnings("unused")
// @SuppressLint("Registered")
// public class BroadcastApplication extends MultiDexApplication {
// 
//     private final BroadcastReceiver mBroadcastReceiver = new InnerBroadcastReceiver();
//     private final BroadcastReceiver mLocalBroadcastReceiver = new InnerLocalBroadcastReceiver();
//     private LocalBroadcastManager mLocalBroadcastManager;// 应用内部广播
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         final IntentFilter intentFilter = new IntentFilter();
//         onAddAction(intentFilter);
//         registerReceiver(mBroadcastReceiver, intentFilter);
//         final IntentFilter localIntentFilter = new IntentFilter();
//         onAddLocalAction(localIntentFilter);
//         mLocalBroadcastManager = LocalBroadcastManager.getInstance(this);
//         mLocalBroadcastManager.registerReceiver(mLocalBroadcastReceiver, localIntentFilter);
//     }
// 
//     @Override
//     public void onTerminate() {
//         unregisterReceiver(mBroadcastReceiver);
//         mLocalBroadcastManager.unregisterReceiver(mLocalBroadcastReceiver);
//         super.onTerminate();
//     }
// 
//     /**
//      * 添加广播意图筛选器动作
//      *
//      * @param filter 筛选器
//      */
//     protected void onAddAction(IntentFilter filter) {
//     }
// 
//     /**
//      * 添加本地广播意图筛选器动作
//      *
//      * @param filter 筛选器
//      */
//     protected void onAddLocalAction(IntentFilter filter) {
//     }
// 
//     /**
//      * 接收到广播
//      *
//      * @param context Context
//      * @param intent  意图
//      */
//     protected void onReceiveBroadcast(Context context, Intent intent) {
//     }
// 
//     /**
//      * 接收到本地广播
//      *
//      * @param context Context
//      * @param intent  意图
//      */
//     protected void onReceiveLocalBroadcast(Context context, Intent intent) {
//     }
// 
//     /**
//      * 获取本地广播管理器
//      *
//      * @return 本地广播管理器
//      */
//     public LocalBroadcastManager getLocalBroadcastManager() {
//         return mLocalBroadcastManager;
//     }
// 
//     private class InnerBroadcastReceiver extends BroadcastReceiver {
// 
//         @Override
//         public void onReceive(Context context, Intent intent) {
//             onReceiveBroadcast(context, intent);
//         }
//     }
// 
//     private class InnerLocalBroadcastReceiver extends BroadcastReceiver {
// 
//         @Override
//         public void onReceive(Context context, Intent intent) {
//             onReceiveLocalBroadcast(context, intent);
//         }
//     }
// }
// 
// Path: app/src/main/java/am/project/x/notification/NotificationChannelHelper.java
// public class NotificationChannelHelper {
//     private static final String CHANEL_ID_LOW = "am.project.ftpgo.notification.CHANEL_LOW";// 不发出提示音
// 
//     /**
//      * 更新通知渠道
//      *
//      * @param context Context
//      */
//     public static void updateNotificationChannel(Context context) {
//         updateChannelLow(context);
//     }
// 
//     static String getChannelLow(Context context) {
//         updateChannelLow(context);
//         return CHANEL_ID_LOW;
//     }
// 
//     @Nullable
//     private static NotificationManager getNotificationManager(Context context) {
//         return (NotificationManager) context.getSystemService(
//                 Context.NOTIFICATION_SERVICE);
//     }
// 
//     private static void updateChannelLow(Context context) {
//         if (Build.VERSION.SDK_INT < 26)
//             return;
//         NotificationManager manager = getNotificationManager(context);
//         if (manager == null)
//             return;
//         NotificationChannel channel = manager.getNotificationChannel(CHANEL_ID_LOW);
//         final String name = context.getString(R.string.notification_name_low);
//         if (channel == null) {
//             channel = new NotificationChannel(CHANEL_ID_LOW, name,
//                     NotificationManager.IMPORTANCE_LOW);
//             manager.createNotificationChannel(channel);
//         }
//         channel.setName(name);
//     }
// 
// }


// Path: app/src/main/java/am/project/x/ProjectXApplication.java
import am.project.x.broadcast.BroadcastApplication;
import am.project.x.notification.NotificationChannelHelper;

/*
 * Copyright (C) 2018 AlexMofer
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package am.project.x;


/**
 * 应用Application
 * 做一些全局变量存储
 * Created by Alex on 2018/7/23.
 */
public class ProjectXApplication extends BroadcastApplication {

    private static ProjectXApplication mInstance;

    @Override
    public void onCreate() {
        mInstance = this;
        super.onCreate();
        NotificationChannelHelper.updateNotificationChannel(this);