package com.tencent.mm.pluginsdk.i;

import android.annotation.TargetApi;
import android.hardware.Camera;
import android.hardware.Camera.Parameters;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.tencent.matrix.trace.core.AppMethodBeat;

class b$a extends Handler {
    boolean faH = false;
    int hzv = 0;

    public b$a(Looper looper) {
        super(looper);
    }

    @TargetApi(8)
    public final void handleMessage(Message message) {
        AppMethodBeat.i(27464);
        Camera camera = (Camera) message.obj;
        Parameters parameters = camera.getParameters();
        int zoom = parameters.getZoom() + this.hzv;
        if (this.faH) {
            if (zoom >= parameters.getMaxZoom() / 2) {
                zoom = parameters.getMaxZoom() / 2;
            } else {
                sendMessageDelayed(Message.obtain(this, 4353, 0, 0, message.obj), 20);
            }
        } else if (zoom <= 0) {
            zoom = 0;
        } else {
            sendMessageDelayed(Message.obtain(this, 4353, 0, 0, message.obj), 20);
        }
        parameters.setZoom(zoom);
        camera.setParameters(parameters);
        AppMethodBeat.o(27464);
    }
}
