// Path: app/src/main/java/in/blogspot/anselmbros/torchie/main/manager/device/Device.java
// public abstract class Device {
// 
//     public static final String TYPE = Constants.ID_DEVICE;
// 
//     protected final Context mContext;
//     protected String deviceType;
//     protected boolean isEnabled;
// 
//     public Device(Context context) {
//         this.mContext = context;
//         this.deviceType = TYPE;
//         isEnabled = false;
//     }
// 
//     public final String getDeviceType() {
//         return this.deviceType;
//     }
// 
// 
//     public boolean isEnabled() {
//         return isEnabled;
//     }
// 
//     public void setEnabled(boolean enabled) {
//         isEnabled = enabled;
//     }
// }
// 
// Path: app/src/main/java/in/blogspot/anselmbros/torchie/utils/Constants.java
// public class Constants {
//     public final static String ID_DEVICE = "0";
// 
//     public final static String ID_DEVICE_OUTPUT = "1";
//     public final static String ID_DEVICE_OUTPUT_TORCH = "10";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH = "11";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH_LEGACY = "12";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH_NEW = "13";
//     public final static String ID_DEVICE_OUTPUT_TORCH_SCREEN = "14";
//     public final static String ID_DEVICE_OUTPUT_VIBRATOR = "15";
// 
//     public final static String ID_DEVICE_INPUT = "2";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY = "20";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY_NATIVE = "21";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY_ROCKER = "22";
//     public final static String ID_DEVICE_INPUT_PROXIMITY = "23";
// 
//     public final static String PLAY_URI = "https://play.google.com/store/apps/details?id=in.blogspot.anselmbros.torchie";
//     public final static String WEB_URI = "https://torchieapp.wordpress.com";
//     public final static String ABOUTANSELM_URI = "https://anselm.in";
//     public final static String FACEBOOK_URI = "https://facebook.com/torchieapp";
//     public final static String WEB_DONATE_URI = "https://torchieapp.wordpress.com/donate/";
// }


import android.content.Context;
import in.blogspot.anselmbros.torchie.main.manager.device.Device;
import in.blogspot.anselmbros.torchie.utils.Constants;
/*
 *     Copyright (C) 2016  Merbin J Anselm <merbinjanselm@gmail.com>
 *
 *     This program is free software; you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation; either version 2 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License along
 *     with this program; if not, write to the Free Software Foundation, Inc.,
 *     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

package in.blogspot.anselmbros.torchie.main.manager.device.output;



/**
 * Created by Merbin J Anselm on 04-Feb-17.
 */

public abstract class OutputDevice extends Device {

    public static final String TYPE = Constants.ID_DEVICE_OUTPUT;

    private boolean mStatus;
    private OutputDeviceListener mListener;

    public OutputDevice(Context context) {
        super(context);
        this.deviceType = TYPE;
        this.mStatus = false;
    }

    protected abstract void turnOn();

    protected abstract void turnOff();

    public final void start(boolean status) {
        if (this.isEnabled) {
// Path: app/src/main/java/in/blogspot/anselmbros/torchie/main/manager/device/Device.java
// public abstract class Device {
// 
//     public static final String TYPE = Constants.ID_DEVICE;
// 
//     protected final Context mContext;
//     protected String deviceType;
//     protected boolean isEnabled;
// 
//     public Device(Context context) {
//         this.mContext = context;
//         this.deviceType = TYPE;
//         isEnabled = false;
//     }
// 
//     public final String getDeviceType() {
//         return this.deviceType;
//     }
// 
// 
//     public boolean isEnabled() {
//         return isEnabled;
//     }
// 
//     public void setEnabled(boolean enabled) {
//         isEnabled = enabled;
//     }
// }
// 
// Path: app/src/main/java/in/blogspot/anselmbros/torchie/utils/Constants.java
// public class Constants {
//     public final static String ID_DEVICE = "0";
// 
//     public final static String ID_DEVICE_OUTPUT = "1";
//     public final static String ID_DEVICE_OUTPUT_TORCH = "10";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH = "11";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH_LEGACY = "12";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH_NEW = "13";
//     public final static String ID_DEVICE_OUTPUT_TORCH_SCREEN = "14";
//     public final static String ID_DEVICE_OUTPUT_VIBRATOR = "15";
// 
//     public final static String ID_DEVICE_INPUT = "2";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY = "20";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY_NATIVE = "21";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY_ROCKER = "22";
//     public final static String ID_DEVICE_INPUT_PROXIMITY = "23";
// 
//     public final static String PLAY_URI = "https://play.google.com/store/apps/details?id=in.blogspot.anselmbros.torchie";
//     public final static String WEB_URI = "https://torchieapp.wordpress.com";
//     public final static String ABOUTANSELM_URI = "https://anselm.in";
//     public final static String FACEBOOK_URI = "https://facebook.com/torchieapp";
//     public final static String WEB_DONATE_URI = "https://torchieapp.wordpress.com/donate/";
// }


// Path: app/src/main/java/in/blogspot/anselmbros/torchie/main/manager/device/output/OutputDevice.java
import android.content.Context;
import in.blogspot.anselmbros.torchie.main.manager.device.Device;
import in.blogspot.anselmbros.torchie.utils.Constants;

/*
 *     Copyright (C) 2016  Merbin J Anselm <merbinjanselm@gmail.com>
 *
 *     This program is free software; you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation; either version 2 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License along
 *     with this program; if not, write to the Free Software Foundation, Inc.,
 *     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

package in.blogspot.anselmbros.torchie.main.manager.device.output;



/**
 * Created by Merbin J Anselm on 04-Feb-17.
 */

public abstract class OutputDevice extends Device {

    public static final String TYPE = Constants.ID_DEVICE_OUTPUT;

    private boolean mStatus;
    private OutputDeviceListener mListener;

    public OutputDevice(Context context) {
        super(context);
        this.deviceType = TYPE;
        this.mStatus = false;
    }

    protected abstract void turnOn();

    protected abstract void turnOff();

    public final void start(boolean status) {
        if (this.isEnabled) {
            if (status && !this.mStatus)