diff options
Diffstat (limited to 'src/com/android/bluetooth/opp/BluetoothOppService.java')
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppService.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java index ec39e6e32..10437fb30 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppService.java +++ b/src/com/android/bluetooth/opp/BluetoothOppService.java @@ -459,6 +459,7 @@ public class BluetoothOppService extends Service { mPendingUpdate = true; if ((mUpdateThread == null) && (mAdapter != null) && mAdapter.isEnabled()) { + mPowerManager = (PowerManager)getSystemService(POWER_SERVICE); if (V) Log.v(TAG, "Starting a new thread"); mUpdateThread = new UpdateThread(); mUpdateThread.start(); @@ -494,6 +495,13 @@ public class BluetoothOppService extends Service { if (V) Log.v(TAG, "***returning from updatethread***"); return; } + try { + if (!mPowerManager.isInteractive()) + Thread.sleep(1000); + } catch (InterruptedException e) { + Log.e(TAG, "Interrupted", e); + } + mPendingUpdate = false; } Cursor cursor; |