mirror of
https://github.com/adolfintel/OpenPods.git
synced 2026-09-15 15:16:12 -04:00
Reformat code
This commit is contained in:
@@ -5,27 +5,31 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class ScreenReceiver extends BroadcastReceiver {
|
||||
public abstract void onStart();
|
||||
|
||||
public abstract void onStart ();
|
||||
public abstract void onStop();
|
||||
|
||||
public abstract void onStop ();
|
||||
|
||||
public static IntentFilter buildFilter () {
|
||||
public static IntentFilter buildFilter() {
|
||||
IntentFilter screenIntentFilter = new IntentFilter();
|
||||
|
||||
screenIntentFilter.addAction(Intent.ACTION_SCREEN_ON);
|
||||
screenIntentFilter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
|
||||
return screenIntentFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive (Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case Intent.ACTION_SCREEN_OFF: onStop();
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (Objects.requireNonNull(intent.getAction())) {
|
||||
case Intent.ACTION_SCREEN_OFF:
|
||||
onStop();
|
||||
break;
|
||||
case Intent.ACTION_SCREEN_ON: onStart();
|
||||
case Intent.ACTION_SCREEN_ON:
|
||||
onStart();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user