Reformat and add/remove some final keywords
This commit is contained in:
parent
2ee69cb1f9
commit
a15710ba44
@ -32,10 +32,11 @@ import androidx.media3.common.util.Log;
|
||||
|
||||
private static final String TAG = "WakeLockManager";
|
||||
private static final String WAKE_LOCK_TAG = "ExoPlayer:WakeLockManager";
|
||||
|
||||
private final Context applicationContext;
|
||||
@Nullable private WakeLock wakeLock;
|
||||
private boolean enabled;
|
||||
private boolean stayAwake;
|
||||
private final Context applicationContext;
|
||||
|
||||
public WakeLockManager(Context context) {
|
||||
applicationContext = context.getApplicationContext();
|
||||
@ -54,7 +55,7 @@ import androidx.media3.common.util.Log;
|
||||
public void setEnabled(boolean enabled) {
|
||||
if (enabled) {
|
||||
if (wakeLock == null) {
|
||||
final PowerManager powerManager =
|
||||
PowerManager powerManager =
|
||||
(PowerManager) applicationContext.getSystemService(Context.POWER_SERVICE);
|
||||
if (powerManager == null) {
|
||||
Log.w(TAG, "PowerManager is null, therefore not creating the WakeLock.");
|
||||
|
@ -31,10 +31,11 @@ import androidx.media3.common.util.Log;
|
||||
|
||||
private static final String TAG = "WifiLockManager";
|
||||
private static final String WIFI_LOCK_TAG = "ExoPlayer:WifiLockManager";
|
||||
|
||||
private final Context applicationContext;
|
||||
@Nullable private WifiLock wifiLock;
|
||||
private boolean enabled;
|
||||
private boolean stayAwake;
|
||||
private Context applicationContext;
|
||||
|
||||
public WifiLockManager(Context context) {
|
||||
applicationContext = context.getApplicationContext();
|
||||
@ -52,9 +53,9 @@ import androidx.media3.common.util.Log;
|
||||
*/
|
||||
public void setEnabled(boolean enabled) {
|
||||
if (enabled && wifiLock == null) {
|
||||
final WifiManager wifiManager =
|
||||
(WifiManager) applicationContext.getApplicationContext()
|
||||
.getSystemService(Context.WIFI_SERVICE);
|
||||
WifiManager wifiManager =
|
||||
(WifiManager)
|
||||
applicationContext.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||
if (wifiManager == null) {
|
||||
Log.w(TAG, "WifiManager is null, therefore not creating the WifiLock.");
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user