NetMirror.apk
Download file
package com.facebook.react.modules.vibration;
import D2.h;
import G1.d;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.os.VibratorManager;
import com.facebook.fbreact.specs.NativeVibrationSpec;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableArray;
import kotlin.jvm.internal.DefaultConstructorMarker;
import v1.InterfaceC0756a;
/* JADX INFO: loaded from: classes.dex */
@InterfaceC0756a(name = "Vibration")
public final class VibrationModule extends NativeVibrationSpec {
public static final a Companion = new a(null);
public static final String NAME = "Vibration";
public static final class a {
public /* synthetic */ a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private a() {
}
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public VibrationModule(ReactApplicationContext reactApplicationContext) {
super(reactApplicationContext);
h.f(reactApplicationContext, "reactContext");
}
private final Vibrator getVibrator() {
if (Build.VERSION.SDK_INT < 31) {
return (Vibrator) getReactApplicationContext().getSystemService("vibrator");
}
VibratorManager vibratorManagerA = d.a(getReactApplicationContext().getSystemService("vibrator_manager"));
if (vibratorManagerA != null) {
return vibratorManagerA.getDefaultVibrator();
}
return null;
}
@Override // com.facebook.fbreact.specs.NativeVibrationSpec
public void cancel() {
Vibrator vibrator = getVibrator();
if (vibrator != null) {
vibrator.cancel();
}
}
@Override // com.facebook.fbreact.specs.NativeVibrationSpec
public void vibrate(double d4) {
int i3 = (int) d4;
Vibrator vibrator = getVibrator();
if (vibrator == null) {
return;
}
if (Build.VERSION.SDK_INT >= 26) {
vibrator.vibrate(VibrationEffect.createOneShot(i3, -1));
} else {
vibrator.vibrate(i3);
}
}
@Override // com.facebook.fbreact.specs.NativeVibrationSpec
public void vibrateByPattern(ReadableArray readableArray, double d4) {
h.f(readableArray, "pattern");
int i3 = (int) d4;
Vibrator vibrator = getVibrator();
if (vibrator == null) {
return;
}
long[] jArr = new long[readableArray.size()];
int size = readableArray.size();
for (int i4 = 0; i4 < size; i4++) {
jArr[i4] = readableArray.getInt(i4);
}
if (Build.VERSION.SDK_INT >= 26) {
vibrator.vibrate(VibrationEffect.createWaveform(jArr, i3));
} else {
vibrator.vibrate(jArr, i3);
}
}
}
⚠️ This content was hidden by an advertisement filtering extension in your browser. Please disable it and reload the page to access the decompiled content.
We only display one small text ad to keep this service free. Here's what it looks like:
Read the Docs for Business: You write the docs. We do the rest.
Try it today!Ad by EthicalAds
Download file