content: package androidx.work.impl.background.systemalarm;
  
  import android.content.BroadcastReceiver;
  import android.content.ComponentName;
  import android.content.Context;
  import android.content.Intent;
  import androidx.work.Logger;
  import androidx.work.impl.WorkManagerImpl;
  import androidx.work.impl.background.systemalarm.ConstraintProxy;
  import androidx.work.impl.utils.PackageManagerHelper;
  import mt.Log1F380D;
  
  /* compiled from: 00BA */
  public class ConstraintProxyUpdateReceiver extends BroadcastReceiver {
      static final String ACTION = "androidx.work.impl.background.systemalarm.UpdateProxies";
      static final String KEY_BATTERY_CHARGING_PROXY_ENABLED = "KEY_BATTERY_CHARGING_PROXY_ENABLED";
      static final String KEY_BATTERY_NOT_LOW_PROXY_ENABLED = "KEY_BATTERY_NOT_LOW_PROXY_ENABLED";
      static final String KEY_NETWORK_STATE_PROXY_ENABLED = "KEY_NETWORK_STATE_PROXY_ENABLED";
      static final String KEY_STORAGE_NOT_LOW_PROXY_ENABLED = "KEY_STORAGE_NOT_LOW_PROXY_ENABLED";
      static final String TAG;
  
      static {
          String tagWithPrefix = Logger.tagWithPrefix("ConstrntProxyUpdtRecvr");
          Log1F380D.a((Object) tagWithPrefix);
          TAG = tagWithPrefix;
      }
  
      public static Intent newConstraintProxyUpdateIntent(Context context, boolean batteryNotLowProxyEnabled, boolean batteryChargingProxyEnabled, boolean storageNotLowProxyEnabled, boolean networkStateProxyEnabled) {
          Intent intent = new Intent(ACTION);
          intent.setComponent(new ComponentName(context, ConstraintProxyUpdateReceiver.class));
          intent.putExtra(KEY_BATTERY_NOT_LOW_PROXY_ENABLED, batteryNotLowProxyEnabled).putExtra(KEY_BATTERY_CHARGING_PROXY_ENABLED, batteryChargingProxyEnabled).putExtra(KEY_STORAGE_NOT_LOW_PROXY_ENABLED, storageNotLowProxyEnabled).putExtra(KEY_NETWORK_STATE_PROXY_ENABLED, networkStateProxyEnabled);
          return intent;
      }
  
      public void onReceive(final Context context, final Intent intent) {
          String action = intent != null ? intent.getAction() : null;
          if (!ACTION.equals(action)) {
              Logger logger = Logger.get();
              String str = TAG;
              String format = String.format("Ignoring unknown action %s", new Object[]{action});
              Log1F380D.a((Object) format);
              logger.debug(str, format, new Throwable[0]);
              return;
          }
          final BroadcastReceiver.PendingResult goAsync = goAsync();
          WorkManagerImpl.getInstance(context).getWorkTaskExecutor().executeOnBackgroundThread(new Runnable() {
              public void run() {
                  try {
                      boolean booleanExtra = intent.getBooleanExtra(ConstraintProxyUpdateReceiver.KEY_BATTERY_NOT_LOW_PROXY_ENABLED, false);
                      boolean booleanExtra2 = intent.getBooleanExtra(ConstraintProxyUpdateReceiver.KEY_BATTERY_CHARGING_PROXY_ENABLED, false);
                      boolean booleanExtra3 = intent.getBooleanExtra(ConstraintProxyUpdateReceiver.KEY_STORAGE_NOT_LOW_PROXY_ENABLED, false);
                      boolean booleanExtra4 = intent.getBooleanExtra(ConstraintProxyUpdateReceiver.KEY_NETWORK_STATE_PROXY_ENABLED, false);
                      Logger logger = Logger.get();
                      String str = ConstraintProxyUpdateReceiver.TAG;
                      String format = String.format("Updating proxies: BatteryNotLowProxy enabled (%s), BatteryChargingProxy enabled (%s), StorageNotLowProxy (%s), NetworkStateProxy enabled (%s)", new Object[]{Boolean.valueOf(booleanExtra), Boolean.valueOf(booleanExtra2), Boolean.valueOf(booleanExtra3), Boolean.valueOf(booleanExtra4)});
                      Log1F380D.a((Object) format);
                      logger.debug(str, format, new Throwable[0]);
                      PackageManagerHelper.setComponentEnabled(context, ConstraintProxy.BatteryNotLowProxy.class, booleanExtra);
                      PackageManagerHelper.setComponentEnabled(context, ConstraintProxy.BatteryChargingProxy.class, booleanExtra2);
                      PackageManagerHelper.setComponentEnabled(context, ConstraintProxy.StorageNotLowProxy.class, booleanExtra3);
                      PackageManagerHelper.setComponentEnabled(context, ConstraintProxy.NetworkStateProxy.class, booleanExtra4);
                  } finally {
                      goAsync.finish();
                  }
              }
          });
      }
  }
  