// Path: lib/src/main/java/io/xpush/chat/persist/ChannelTable.java
// public class ChannelTable {
// 
//     public static final String KEY_ROWID = "_id";
//     public static final String KEY_ID = "id";
//     public static final String KEY_NAME = "name";
//     public static final String KEY_USERS = "users";
//     public static final String KEY_IMAGE = "image";
//     public static final String KEY_COUNT = "count";
//     public static final String KEY_MESSAGE = "message";
//     public static final String KEY_MESSAGE_TYPE = "message_type";
//     public static final String KEY_UPDATED = "updated";
//     public static String SQLITE_TABLE;
// 
//     public static final String[] ALL_PROJECTION = {
//         KEY_ROWID,
//         KEY_ID,
//         KEY_NAME,
//         KEY_USERS,
//         KEY_IMAGE,
//         KEY_COUNT,
//         KEY_MESSAGE,
//         KEY_MESSAGE_TYPE,
//         KEY_UPDATED
//     };
// 
//     public static void onCreate(SQLiteDatabase db, String tableName) {
//         SQLITE_TABLE = tableName;
// 
//         db.execSQL("DROP TABLE IF EXISTS " + tableName);
// 
//         String DATABASE_CREATE =
//                 "CREATE TABLE if not exists " + tableName + " (" +
//                         KEY_ROWID + " integer PRIMARY KEY autoincrement," +
//                         KEY_ID + " unique ," +
//                         KEY_NAME + "," +
//                         KEY_USERS + "," +
//                         KEY_IMAGE + "," +
//                         KEY_COUNT + " integer ," +
//                         KEY_MESSAGE + "," +
//                         KEY_MESSAGE_TYPE + " integer ,"+
//                         KEY_UPDATED + " integer );";
// 
//         db.execSQL(DATABASE_CREATE);
//     }
// 
//     public static void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion, String tableName) {
//         SQLITE_TABLE = tableName;
// 
//         db.execSQL("DROP TABLE IF EXISTS " + tableName);
//         onCreate(db, tableName);
//     }
// }
// 
// Path: lib/src/main/java/io/xpush/chat/persist/DBHelper.java
// public class DBHelper extends SQLiteOpenHelper {
// 
//     private static final String DATABASE_NAME = "xpush.db";
//     private static final int DATABASE_VERSION = 2;
//     private String CHANNEL_TABLE_NAME;
//     private String MESSAGE_TABLE_NAME;
//     private String USER_TABLE_NAME;
// 
//     public DBHelper(Context context) {
//         super(context, DATABASE_NAME, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS);
//         CHANNEL_TABLE_NAME = context.getString(R.string.channel_table_name);
//         MESSAGE_TABLE_NAME = context.getString(R.string.message_table_name);
//         USER_TABLE_NAME = context.getString(R.string.user_table_name);
//     }
// 
//     @Override
//     public void onCreate(SQLiteDatabase db) {
//         MessageTable.onCreate(db, MESSAGE_TABLE_NAME);
//         ChannelTable.onCreate(db, CHANNEL_TABLE_NAME);
//         UserTable.onCreate(db,USER_TABLE_NAME);
//     }
// 
//     @Override
//     public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//         MessageTable.onUpgrade(db, oldVersion, newVersion, MESSAGE_TABLE_NAME);
//         ChannelTable.onUpgrade(db, oldVersion, newVersion, CHANNEL_TABLE_NAME);
//         UserTable.onUpgrade(db, oldVersion, newVersion, USER_TABLE_NAME);
//     }
// }


import android.app.IntentService;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import io.xpush.chat.R;
import io.xpush.chat.persist.ChannelTable;
import io.xpush.chat.persist.DBHelper;
import me.leolin.shortcutbadger.ShortcutBadger;
/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * 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 io.xpush.chat.services;



public class BadgeIntentService extends IntentService {

    private static final String TAG = BadgeIntentService.class.getSimpleName();

    public BadgeIntentService() {
        super(TAG);
    }

    @Override
    protected void onHandleIntent(Intent intent) {

// Path: lib/src/main/java/io/xpush/chat/persist/ChannelTable.java
// public class ChannelTable {
// 
//     public static final String KEY_ROWID = "_id";
//     public static final String KEY_ID = "id";
//     public static final String KEY_NAME = "name";
//     public static final String KEY_USERS = "users";
//     public static final String KEY_IMAGE = "image";
//     public static final String KEY_COUNT = "count";
//     public static final String KEY_MESSAGE = "message";
//     public static final String KEY_MESSAGE_TYPE = "message_type";
//     public static final String KEY_UPDATED = "updated";
//     public static String SQLITE_TABLE;
// 
//     public static final String[] ALL_PROJECTION = {
//         KEY_ROWID,
//         KEY_ID,
//         KEY_NAME,
//         KEY_USERS,
//         KEY_IMAGE,
//         KEY_COUNT,
//         KEY_MESSAGE,
//         KEY_MESSAGE_TYPE,
//         KEY_UPDATED
//     };
// 
//     public static void onCreate(SQLiteDatabase db, String tableName) {
//         SQLITE_TABLE = tableName;
// 
//         db.execSQL("DROP TABLE IF EXISTS " + tableName);
// 
//         String DATABASE_CREATE =
//                 "CREATE TABLE if not exists " + tableName + " (" +
//                         KEY_ROWID + " integer PRIMARY KEY autoincrement," +
//                         KEY_ID + " unique ," +
//                         KEY_NAME + "," +
//                         KEY_USERS + "," +
//                         KEY_IMAGE + "," +
//                         KEY_COUNT + " integer ," +
//                         KEY_MESSAGE + "," +
//                         KEY_MESSAGE_TYPE + " integer ,"+
//                         KEY_UPDATED + " integer );";
// 
//         db.execSQL(DATABASE_CREATE);
//     }
// 
//     public static void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion, String tableName) {
//         SQLITE_TABLE = tableName;
// 
//         db.execSQL("DROP TABLE IF EXISTS " + tableName);
//         onCreate(db, tableName);
//     }
// }
// 
// Path: lib/src/main/java/io/xpush/chat/persist/DBHelper.java
// public class DBHelper extends SQLiteOpenHelper {
// 
//     private static final String DATABASE_NAME = "xpush.db";
//     private static final int DATABASE_VERSION = 2;
//     private String CHANNEL_TABLE_NAME;
//     private String MESSAGE_TABLE_NAME;
//     private String USER_TABLE_NAME;
// 
//     public DBHelper(Context context) {
//         super(context, DATABASE_NAME, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS);
//         CHANNEL_TABLE_NAME = context.getString(R.string.channel_table_name);
//         MESSAGE_TABLE_NAME = context.getString(R.string.message_table_name);
//         USER_TABLE_NAME = context.getString(R.string.user_table_name);
//     }
// 
//     @Override
//     public void onCreate(SQLiteDatabase db) {
//         MessageTable.onCreate(db, MESSAGE_TABLE_NAME);
//         ChannelTable.onCreate(db, CHANNEL_TABLE_NAME);
//         UserTable.onCreate(db,USER_TABLE_NAME);
//     }
// 
//     @Override
//     public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//         MessageTable.onUpgrade(db, oldVersion, newVersion, MESSAGE_TABLE_NAME);
//         ChannelTable.onUpgrade(db, oldVersion, newVersion, CHANNEL_TABLE_NAME);
//         UserTable.onUpgrade(db, oldVersion, newVersion, USER_TABLE_NAME);
//     }
// }


// Path: lib/src/main/java/io/xpush/chat/services/BadgeIntentService.java
import android.app.IntentService;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import io.xpush.chat.R;
import io.xpush.chat.persist.ChannelTable;
import io.xpush.chat.persist.DBHelper;
import me.leolin.shortcutbadger.ShortcutBadger;

/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * 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 io.xpush.chat.services;



public class BadgeIntentService extends IntentService {

    private static final String TAG = BadgeIntentService.class.getSimpleName();

    public BadgeIntentService() {
        super(TAG);
    }

    @Override
    protected void onHandleIntent(Intent intent) {

        DBHelper mDbHelper = new DBHelper(getApplicationContext());