package o; import android.content.SharedPreferences; import java.io.IOException; import okhttp3.Interceptor; import okhttp3.Request; import okhttp3.Response; /* loaded from: classes.dex */ public final class xWN implements Interceptor { private final SharedPreferences d; @InterfaceC13391fZD public xWN(SharedPreferences sharedPreferences) { C14957gcv.e(sharedPreferences, ""); this.d = sharedPreferences; } @Override // okhttp3.Interceptor public final Response intercept(Interceptor.Chain chain) throws IOException { C14957gcv.e(chain, ""); Request request = chain.request(); this.d.getString("BASE_URL", null); this.d.getBoolean("IS_AUTOMATE_TESTING", false); Request.Builder newBuilder = request.newBuilder(); if (C14957gcv.b((Object) this.d.getString("AUTOMATE_ENV", "prod"), (Object) "qa") && this.d.getBoolean("IS_AUTOMATE_TESTING", false)) { c(newBuilder, "automate-environment", this.d.getString("AUTOMATE_ENV", null)); c(newBuilder, "automate-device-id", this.d.getString("AUTOMATE_DEVICE_ID", null)); c(newBuilder, "automate-test-case-id", this.d.getString("AUTOMATE_TEST_CASE_ID", null)); c(newBuilder, "automate-tile-version", this.d.getString("AUTOMATE_TILE_VERSION", null)); c(newBuilder, "automate-language", this.d.getString("AUTOMATE_LANGUAGE", null)); c(newBuilder, "automate-expected-api", this.d.getString("AUTOMATE_EXPECTED_API", null)); } return chain.proceed(newBuilder.build()); } private static void c(Request.Builder builder, String str, String str2) { if (str2 != null) { if (str2.length() <= 0 || !(!gdZ.d((CharSequence) r0))) { return; } builder.addHeader(str, str2); } } /* loaded from: classes.dex */ public static final class RVV { private RVV() { } public /* synthetic */ RVV(byte b) { this(); } } static { new RVV((byte) 0); } }