package com.tencent.mm.plugin.appbrand.jsapi.p;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.jsapi.c;
import com.tencent.mm.plugin.appbrand.jsapi.u;
import com.tencent.mm.plugin.appbrand.s.t;
import com.tencent.mm.plugin.appbrand.s.t$b;
import org.json.JSONObject;

public final class e extends u {
    public static final int CTRL_INDEX = 472;
    public static final String NAME = "enableDeviceOrientationChangeListening";
    private boolean hVI = false;
    protected t hVJ;
    private t$b hVK = new 1(this);

    public e() {
        AppMethodBeat.i(126380);
        AppMethodBeat.o(126380);
    }

    public final String b(c cVar, JSONObject jSONObject) {
        AppMethodBeat.i(126381);
        if (jSONObject.optBoolean("enable", false)) {
            h.s(cVar);
            if (!this.hVI) {
                this.hVJ = new t(cVar.getContext(), this.hVK);
                this.hVJ.enable();
                this.hVI = true;
            }
        } else {
            h.t(cVar);
            if (this.hVI) {
                this.hVJ.disable();
                this.hVJ = null;
                this.hVI = false;
            }
        }
        String j = j("ok", null);
        AppMethodBeat.o(126381);
        return j;
    }
}
