package com.appsflyer.internal;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.facebook.internal.AnalyticsEvents;

public final class c {

    /* renamed from: ˊ  reason: contains not printable characters */
    public IntentFilter f2056 = new IntentFilter("android.intent.action.BATTERY_CHANGED");

    /* renamed from: com.appsflyer.internal.c$c  reason: collision with other inner class name */
    public static final class C0328c {

        /* renamed from: ॱ  reason: contains not printable characters */
        public static final c f2059 = new c();
    }

    /* renamed from: ˏ  reason: contains not printable characters */
    public final b m1209(Context context) {
        String str = null;
        float f = 0.0f;
        try {
            Intent registerReceiver = context.registerReceiver(null, this.f2056);
            if (registerReceiver != null) {
                if (2 == registerReceiver.getIntExtra(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS, -1)) {
                    int intExtra = registerReceiver.getIntExtra("plugged", -1);
                    str = intExtra != 1 ? intExtra != 2 ? intExtra != 4 ? "other" : "wireless" : "usb" : "ac";
                } else {
                    str = "no";
                }
                int intExtra2 = registerReceiver.getIntExtra("level", -1);
                int intExtra3 = registerReceiver.getIntExtra("scale", -1);
                if (!(-1 == intExtra2 || -1 == intExtra3)) {
                    f = (((float) intExtra2) * 100.0f) / ((float) intExtra3);
                }
            }
        } catch (Throwable unused) {
        }
        return new b(f, str);
    }

    public static final class b {

        /* renamed from: ˊ  reason: contains not printable characters */
        public final float f2057;

        /* renamed from: ˎ  reason: contains not printable characters */
        public final String f2058;

        public b(float f, String str) {
            this.f2057 = f;
            this.f2058 = str;
        }

        public b() {
        }
    }
}
