Skip to content

Commit

Permalink
Name WakeLocks after class that acquires them.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schildbach committed Sep 30, 2017
1 parent 7c9db7e commit e3e2d8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ public void onCreate() {
final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
getPackageName() + " bluetooth transaction submission");
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());
wakeLock.acquire();

registerReceiver(bluetoothStateChangeReceiver, new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,8 @@ public void onCreate() {
nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

final String lockName = getPackageName() + " blockchain sync";

final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, lockName);
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());

application = (WalletApplication) getApplication();
config = application.getConfiguration();
Expand Down

0 comments on commit e3e2d8d

Please sign in to comment.