package com.tencent.mm.modelvoiceaddr.ui;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.modelvoiceaddr.f;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ap.a;

class VoiceSearchLayout$1 implements a {
    final /* synthetic */ VoiceSearchLayout gcj;

    VoiceSearchLayout$1(VoiceSearchLayout voiceSearchLayout) {
        this.gcj = voiceSearchLayout;
    }

    public final boolean BI() {
        AppMethodBeat.i(116764);
        if (VoiceSearchLayout.a(this.gcj) == null) {
            AppMethodBeat.o(116764);
        } else if (VoiceSearchLayout.b(this.gcj) < VoiceSearchLayout.amB().length) {
            VoiceSearchLayout.a(this.gcj, VoiceSearchLayout.amB()[VoiceSearchLayout.c(this.gcj)]);
            AppMethodBeat.o(116764);
        } else {
            f a = VoiceSearchLayout.a(this.gcj);
            ab.d("MicroMsg.SceneVoiceAddr", "cAmplitude " + a.gaS);
            int i = a.gaS;
            a.gaS = 0;
            if (i > f.cri) {
                f.cri = i;
            }
            ab.d("getMaxAmplitude", " map: " + i + " max:" + f.cri + " per:" + ((i * 100) / f.cri));
            int i2 = (i * 100) / f.cri;
            ab.d("MicroMsg.VoiceSearchLayout", "addr vol:".concat(String.valueOf(i2)));
            i = VoiceSearchLayout.d(this.gcj);
            if (VoiceSearchLayout.d(this.gcj) == VoiceSearchLayout.e(this.gcj)) {
                if (i2 <= 10) {
                    VoiceSearchLayout.f(this.gcj);
                    if (VoiceSearchLayout.g(this.gcj) >= VoiceSearchLayout.amC().length) {
                        VoiceSearchLayout.h(this.gcj);
                    }
                    VoiceSearchLayout.a(this.gcj, VoiceSearchLayout.amC()[VoiceSearchLayout.g(this.gcj)]);
                    AppMethodBeat.o(116764);
                } else {
                    i2 /= 5;
                    if (i2 >= VoiceSearchLayout.amD().length) {
                        i2 = VoiceSearchLayout.amD().length - 1;
                    }
                    ab.d("MicroMsg.VoiceSearchLayout", "addr mvol:".concat(String.valueOf(i2)));
                    VoiceSearchLayout.b(this.gcj, i2);
                }
            } else if (VoiceSearchLayout.d(this.gcj) > VoiceSearchLayout.e(this.gcj)) {
                VoiceSearchLayout.i(this.gcj);
            } else {
                VoiceSearchLayout.j(this.gcj);
            }
            VoiceSearchLayout.a(this.gcj, VoiceSearchLayout.amD()[i]);
            AppMethodBeat.o(116764);
        }
        return true;
    }
}
