/*
 * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
 */
package kr.co.zumo.app.lifeplus.util;

import android.content.Context;
import android.support.annotation.RequiresPermission;
import android.telephony.TelephonyManager;

import java.util.UUID;

import kr.co.zumo.app.BuildConfig;

/**
 * App util
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018. 9. 5.]   [최초 작성]
 * @since 2018. 9. 5.
 */
public class AppUtil {

  /**
   * Debug 모드 인지 확인
   *
   * @return BuildConfig.DEBUG
   */
  public static boolean isDebug() {
    return BuildConfig.DEBUG;
  }

  /**
   * Release 모드 인지 확인
   *
   * @return BuildConfig.DEBUG == false;
   */
  public static boolean isRelease() {
    return BuildConfig.DEBUG == false;
  }

  /**
   * UUID 가져오기
   *
   * @param context
   * @return
   */
  @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
  public static String getDeviceUUID(Context context) {
//    final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
//    final String tmDevice, tmSerial, androidId;
//
//    tmDevice = "" + tm.getImei();
//    tmSerial = "" + tm.getSimSerialNumber();
//    androidId = "" + android.provider.Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
//    UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
//    String deviceId = deviceUuid.toString();
    String deviceId = "UUID-fake";
    return deviceId;
  }

}
