@Test @SmallTest public void testGetIntentFilter() { IntentFilter intentFilter = mTracker.getIntentFilter(); assertThat(intentFilter.hasAction(Intent.ACTION_BATTERY_OKAY), is(true)); assertThat(intentFilter.hasAction(Intent.ACTION_BATTERY_LOW), is(true)); assertThat(intentFilter.countActions(), is(2)); }
@Override public IntentFilter getIntentFilter() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_BATTERY_OKAY); intentFilter.addAction(Intent.ACTION_BATTERY_LOW); return intentFilter; }
BatteryNotLowTracker extends BroadcastReceiverConstraintTracker<Boolean> { @Override public IntentFilter getIntentFilter() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_BATTERY_OKAY); intentFilter.addAction(Intent.ACTION_BATTERY_LOW); return intentFilter; } }
BatteryNotLowTracker extends BroadcastReceiverConstraintTracker<Boolean> { @Override public IntentFilter getIntentFilter() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_BATTERY_OKAY); intentFilter.addAction(Intent.ACTION_BATTERY_LOW); return intentFilter; } BatteryNotLowTracker(Context context); }
BatteryNotLowTracker extends BroadcastReceiverConstraintTracker<Boolean> { @Override public IntentFilter getIntentFilter() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_BATTERY_OKAY); intentFilter.addAction(Intent.ACTION_BATTERY_LOW); return intentFilter; } BatteryNotLowTracker(Context context); @Override Boolean getInitialState(); @Override IntentFilter getIntentFilter(); @Override void onBroadcastReceive(Context context, @NonNull Intent intent); }
BatteryNotLowTracker extends BroadcastReceiverConstraintTracker<Boolean> { @Override public IntentFilter getIntentFilter() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_BATTERY_OKAY); intentFilter.addAction(Intent.ACTION_BATTERY_LOW); return intentFilter; } BatteryNotLowTracker(Context context); @Override Boolean getInitialState(); @Override IntentFilter getIntentFilter(); @Override void onBroadcastReceive(Context context, @NonNull Intent intent);  }