package com.seewo.vcommons.system.onoffsetting;

import android.database.Cursor;
import android.provider.BaseColumns;
import java.io.Serializable;
import java.util.Calendar;

/* JADX INFO: loaded from: classes.dex */
public class Task implements Serializable {
    private static final String DEFAULT_INVALID_DAYS = "0000000";
    public static final int INVALID_TIME = -1;
    private static final long serialVersionUID = 1;
    public boolean autoPlay;
    public String command;
    public String daysOfWeek;
    public boolean enabled;
    public String forceChannel;
    public int groupId;
    public int id;
    public String message;
    public boolean openApp;
    public String shutdownDays;
    public int shutdownHour;
    public int shutdownMinute;
    public String startupDays;
    public int startupHour;
    public int startupMinute;

    public Task(Cursor cursor) {
        this.id = cursor.getInt(0);
        this.groupId = cursor.getInt(1);
        this.startupHour = cursor.getInt(5);
        this.startupMinute = cursor.getInt(6);
        this.shutdownHour = cursor.getInt(7);
        this.shutdownMinute = cursor.getInt(8);
        this.daysOfWeek = cursor.getString(2);
        this.startupDays = cursor.getString(3);
        this.shutdownDays = cursor.getString(4);
        this.enabled = cursor.getInt(11) == 1;
        this.message = cursor.getString(9);
        this.command = cursor.getString(10);
        this.forceChannel = cursor.getString(12);
        this.autoPlay = cursor.getInt(13) == 1;
        this.openApp = cursor.getInt(14) == 1;
    }

    public Task(int i) {
        this.id = -1;
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        this.groupId = i;
        this.startupHour = calendar.get(11);
        this.startupMinute = calendar.get(12);
        this.shutdownHour = -1;
        this.shutdownMinute = -1;
        this.daysOfWeek = DEFAULT_INVALID_DAYS;
        this.startupDays = DEFAULT_INVALID_DAYS;
        this.shutdownDays = DEFAULT_INVALID_DAYS;
        this.enabled = true;
        this.message = "";
        this.command = "";
        this.forceChannel = "";
        this.autoPlay = false;
        this.openApp = false;
    }

    public Task() {
        this.id = -1;
        this.groupId = -1;
        this.startupHour = -1;
        this.startupMinute = -1;
        this.shutdownHour = -1;
        this.shutdownMinute = -1;
        this.daysOfWeek = DEFAULT_INVALID_DAYS;
        this.startupDays = DEFAULT_INVALID_DAYS;
        this.shutdownDays = DEFAULT_INVALID_DAYS;
        this.enabled = false;
        this.message = "";
        this.command = "";
        this.forceChannel = "";
        this.autoPlay = false;
        this.openApp = false;
    }

    public String toString() {
        return "ID: " + this.id + " GROUP_ID: " + this.groupId + " DAYS: " + this.daysOfWeek + " STARTUP_DAYS: " + this.startupDays + " SHUTDOWN_DAYS: " + this.shutdownDays + " STARTUP_HOUR: " + this.startupHour + " STARTUP_MINUTE: " + this.startupMinute + " SHUTDOWN_HOUR: " + this.shutdownHour + " SHUTDOWN_MINUTE: " + this.shutdownMinute + " ENABLED: " + this.enabled + " MESSAGE: " + this.message + " COMMAND: " + this.command + " FORCE_CHANNEL_NAME: " + this.forceChannel + " AUTO_PLAY" + this.autoPlay + " OPEN_APP" + this.openApp;
    }

    public static class TaskColumns implements BaseColumns {
        public static final int COLUMN_COUNT = 14;
        public static final String COMMAND = "command";
        public static final String DEFAULT_SORT_ORDER = "group_id ASC";
        public static final int TASK_COMMAND_INDEX = 10;
        public static final int TASK_CUSTOM_AUTO_PLAY_INDEX = 13;
        public static final int TASK_CUSTOM_CLOUMN_FORCE_CHANNEL_INDEX = 12;
        public static final int TASK_CUSTOM_OPEN_APP_INDEX = 14;
        public static final int TASK_DAYS_OF_WEEK_INDEX = 2;
        public static final int TASK_ENABLED_INDEX = 11;
        public static final int TASK_GROUP_ID_INDEX = 1;
        public static final int TASK_ID_INDEX = 0;
        public static final int TASK_MESSAGE_INDEX = 9;
        public static final int TASK_SHUTDOWN_DAYS_INDEX = 4;
        public static final int TASK_SHUTDOWN_HOUR_INDEX = 7;
        public static final int TASK_SHUTDOWN_MINUTES_INDEX = 8;
        public static final int TASK_STARTUP_DAYS_INDEX = 3;
        public static final int TASK_STARTUP_HOUR_INDEX = 5;
        public static final int TASK_STARTUP_MINUTES_INDEX = 6;
        public static final String WHERE_ENABLED = "enabled = 1 ";
        public static final String GROUP_ID = "group_id";
        public static final String DAYS_OF_WEEK = "daysofweek";
        public static final String STARTUP_DAYS = "startup_days";
        public static final String SHUTDOWN_DAYS = "shutdown_days";
        public static final String STARTUP_HOUR = "startup_hour";
        public static final String STARTUP_MINUTES = "startup_minutes";
        public static final String SHUTDOWN_HOUR = "shutdown_hour";
        public static final String SHUTDOWN_MINUTES = "shutdown_minutes";
        public static final String MESSAGE = "message";
        public static final String ENABLED = "enabled";
        public static final String CUSTOM_CLOUMN_FORCE_CHANNEL = "custom_force_channel";
        public static final String CUSTOM_AUTO_PLEY = "custom_auto_play";
        public static final String CUSTOM_OPEN_APP = "custom_open_app";
        static final String[] TASK_QUERY_COLUMNS = {"_id", GROUP_ID, DAYS_OF_WEEK, STARTUP_DAYS, SHUTDOWN_DAYS, STARTUP_HOUR, STARTUP_MINUTES, SHUTDOWN_HOUR, SHUTDOWN_MINUTES, MESSAGE, "command", ENABLED, CUSTOM_CLOUMN_FORCE_CHANNEL, CUSTOM_AUTO_PLEY, CUSTOM_OPEN_APP};

        private TaskColumns() {
        }
    }
}
