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

import android.app.Activity;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.jsapi.a;
import com.tencent.mm.plugin.appbrand.jsapi.c;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import org.json.JSONObject;

public final class k extends a {
    public static final int CTRL_INDEX = 229;
    public static final String NAME = "setScreenBrightness";
    float hXJ = Float.NaN;
    float hXK;

    public final void a(c cVar, JSONObject jSONObject, int i) {
        AppMethodBeat.i(126432);
        ab.d("MicroMsg.JsApiSetScreenBrightness", "JsApiSetScreenBrightness!");
        if (jSONObject == null) {
            cVar.M(i, j("fail:data is null", null));
            ab.e("MicroMsg.JsApiSetScreenBrightness", "data is null");
            AppMethodBeat.o(126432);
        } else if (cVar.getContext() instanceof Activity) {
            al.d(new 1(this, jSONObject, cVar, i));
            AppMethodBeat.o(126432);
        } else {
            ab.e("MicroMsg.JsApiSetScreenBrightness", "setScreenBrightness, server context is not activity, don't do invoke");
            cVar.M(i, j("fail:context is not activity", null));
            AppMethodBeat.o(126432);
        }
    }
}
