// Path: imsdk/src/main/java/com/beetle/im/Timer.java
// public abstract class Timer {
//     private static final int WHAT = 0;
// 
//     private long start;
//     private long interval;
//     private boolean active = false;
// 
//     class TimerHandler extends Handler {
//         @Override
//         public void handleMessage(Message msg) {
//             if (!active) {
//                 return;
//             }
// 
//             Timer.this.fire();
//             if (Timer.this.interval != -1) {
//                 long t = uptimeMillis() + Timer.this.interval;
//                 boolean b = this.sendEmptyMessageAtTime(WHAT, t);
//             }
//         }
//     }
//     private Handler handler = new TimerHandler();
// 
//     public void setTimer(long start, long interval) {
//         this.start = start;
//         this.interval = interval;
//         if (active) {
//             handler.removeMessages(WHAT);
//             handler.sendEmptyMessageAtTime(WHAT, start);
//         }
//     }
// 
//     public void setTimer(long start) {
//         this.start = start;
//         this.interval = -1;
//         if (active) {
//             handler.removeMessages(WHAT);
//             handler.sendEmptyMessageAtTime(WHAT, start);
//         }
//     }
// 
//     public void resume() {
//         active = true;
//         handler.sendEmptyMessageAtTime(WHAT, start);
//     }
// 
//     public void suspend() {
//         active = false;
//         handler.removeMessages(WHAT);
//     }
// 
//     protected abstract void fire();
// }


import android.Manifest;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.media.AudioManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.beetle.im.Timer;
import com.squareup.picasso.Picasso;
import org.webrtc.EglBase;
import org.webrtc.RendererCommon;
import org.webrtc.SurfaceViewRenderer;
import java.util.UUID;
import static android.os.SystemClock.uptimeMillis;
package com.beetle.voip;










/**
 * Created by houxh on 15/9/8.
 */
public class VOIPVideoActivity extends CallActivity  {
    private static final int PERMISSIONS_REQUEST_CAMERA = 1;
    private static final int PERMISSIONS_REQUEST_RECORD_AUDIO = 2;
    private static final int PERMISSIONS_REQUEST_MEDIA = 3;

    // Local preview screen position before call is connected.
    private static final int LOCAL_X_CONNECTING = 0;
    private static final int LOCAL_Y_CONNECTING = 0;
    private static final int LOCAL_WIDTH_CONNECTING = 100;
    private static final int LOCAL_HEIGHT_CONNECTING = 100;
    // Local preview screen position after call is connected.
    private static final int LOCAL_X_CONNECTED = 72;
    private static final int LOCAL_Y_CONNECTED = 72;
    private static final int LOCAL_WIDTH_CONNECTED = 25;
    private static final int LOCAL_HEIGHT_CONNECTED = 25;
    // Remote video screen position
    private static final int REMOTE_X = 0;
    private static final int REMOTE_Y = 0;
    private static final int REMOTE_WIDTH = 100;
    private static final int REMOTE_HEIGHT = 100;


    protected String peerName;
    protected String peerAvatar;


    protected int duration;
// Path: imsdk/src/main/java/com/beetle/im/Timer.java
// public abstract class Timer {
//     private static final int WHAT = 0;
// 
//     private long start;
//     private long interval;
//     private boolean active = false;
// 
//     class TimerHandler extends Handler {
//         @Override
//         public void handleMessage(Message msg) {
//             if (!active) {
//                 return;
//             }
// 
//             Timer.this.fire();
//             if (Timer.this.interval != -1) {
//                 long t = uptimeMillis() + Timer.this.interval;
//                 boolean b = this.sendEmptyMessageAtTime(WHAT, t);
//             }
//         }
//     }
//     private Handler handler = new TimerHandler();
// 
//     public void setTimer(long start, long interval) {
//         this.start = start;
//         this.interval = interval;
//         if (active) {
//             handler.removeMessages(WHAT);
//             handler.sendEmptyMessageAtTime(WHAT, start);
//         }
//     }
// 
//     public void setTimer(long start) {
//         this.start = start;
//         this.interval = -1;
//         if (active) {
//             handler.removeMessages(WHAT);
//             handler.sendEmptyMessageAtTime(WHAT, start);
//         }
//     }
// 
//     public void resume() {
//         active = true;
//         handler.sendEmptyMessageAtTime(WHAT, start);
//     }
// 
//     public void suspend() {
//         active = false;
//         handler.removeMessages(WHAT);
//     }
// 
//     protected abstract void fire();
// }


// Path: voip/src/main/java/com/beetle/voip/VOIPVideoActivity.java
import android.Manifest;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.media.AudioManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.beetle.im.Timer;
import com.squareup.picasso.Picasso;
import org.webrtc.EglBase;
import org.webrtc.RendererCommon;
import org.webrtc.SurfaceViewRenderer;
import java.util.UUID;
import static android.os.SystemClock.uptimeMillis;

package com.beetle.voip;










/**
 * Created by houxh on 15/9/8.
 */
public class VOIPVideoActivity extends CallActivity  {
    private static final int PERMISSIONS_REQUEST_CAMERA = 1;
    private static final int PERMISSIONS_REQUEST_RECORD_AUDIO = 2;
    private static final int PERMISSIONS_REQUEST_MEDIA = 3;

    // Local preview screen position before call is connected.
    private static final int LOCAL_X_CONNECTING = 0;
    private static final int LOCAL_Y_CONNECTING = 0;
    private static final int LOCAL_WIDTH_CONNECTING = 100;
    private static final int LOCAL_HEIGHT_CONNECTING = 100;
    // Local preview screen position after call is connected.
    private static final int LOCAL_X_CONNECTED = 72;
    private static final int LOCAL_Y_CONNECTED = 72;
    private static final int LOCAL_WIDTH_CONNECTED = 25;
    private static final int LOCAL_HEIGHT_CONNECTED = 25;
    // Remote video screen position
    private static final int REMOTE_X = 0;
    private static final int REMOTE_Y = 0;
    private static final int REMOTE_WIDTH = 100;
    private static final int REMOTE_HEIGHT = 100;


    protected String peerName;
    protected String peerAvatar;


    protected int duration;
    protected Timer durationTimer;