diff options
author | fredc <fredc@broadcom.com> | 2012-04-12 00:02:00 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-07-16 21:20:54 -0700 |
commit | 0f42037eb7b5118015c2caca635538324ccf0ccf (patch) | |
tree | 46a7ba36216a2cb617541ec68f18b413419e148f /services/java/com/android/server/power/ShutdownThread.java | |
parent | 919a4c6264b733585152ce1dc6f868c1093d368b (diff) | |
download | frameworks_base-0f42037eb7b5118015c2caca635538324ccf0ccf.zip frameworks_base-0f42037eb7b5118015c2caca635538324ccf0ccf.tar.gz frameworks_base-0f42037eb7b5118015c2caca635538324ccf0ccf.tar.bz2 |
Non persistent adapter service
Change-Id: Ib13d5c77416e58161df0e04d7a15ec0dddbde8b5
Conflicts:
core/java/android/bluetooth/BluetoothInputDevice.java
Conflicts:
core/java/com/android/internal/app/ShutdownThread.java
services/java/com/android/server/SystemServer.java
Conflicts:
services/java/com/android/server/SystemServer.java
services/java/com/android/server/pm/ShutdownThread.java
Diffstat (limited to 'services/java/com/android/server/power/ShutdownThread.java')
-rw-r--r-- | services/java/com/android/server/power/ShutdownThread.java | 63 |
1 files changed, 1 insertions, 62 deletions
diff --git a/services/java/com/android/server/power/ShutdownThread.java b/services/java/com/android/server/power/ShutdownThread.java index d5b266a..5715151 100644 --- a/services/java/com/android/server/power/ShutdownThread.java +++ b/services/java/com/android/server/power/ShutdownThread.java @@ -23,7 +23,7 @@ import android.app.Dialog; import android.app.IActivityManager; import android.app.ProgressDialog; import android.bluetooth.BluetoothAdapter; -import android.bluetooth.IBluetooth; +import android.bluetooth.IBluetoothManager; import android.nfc.NfcAdapter; import android.nfc.INfcAdapter; import android.content.BroadcastReceiver; @@ -324,67 +324,6 @@ public final class ShutdownThread extends Thread { } catch (RemoteException e) { } } - - final ITelephony phone = - ITelephony.Stub.asInterface(ServiceManager.checkService("phone")); - final IBluetooth bluetooth = - IBluetooth.Stub.asInterface(ServiceManager.checkService( - BluetoothAdapter.BLUETOOTH_SERVICE)); - - final IMountService mount = - IMountService.Stub.asInterface( - ServiceManager.checkService("mount")); - - try { - bluetoothOff = bluetooth == null || - bluetooth.getState() == BluetoothAdapter.STATE_OFF; - if (!bluetoothOff) { - Log.w(TAG, "Disabling Bluetooth..."); - bluetooth.disable(false); // disable but don't persist new state - } - } catch (RemoteException ex) { - Log.e(TAG, "RemoteException during bluetooth shutdown", ex); - bluetoothOff = true; - } - - try { - radioOff = phone == null || !phone.isRadioOn(); - if (!radioOff) { - Log.w(TAG, "Turning off radio..."); - phone.setRadio(false); - } - } catch (RemoteException ex) { - Log.e(TAG, "RemoteException during radio shutdown", ex); - radioOff = true; - } - - Log.i(TAG, "Waiting for Bluetooth and Radio..."); - - // Wait a max of 32 seconds for clean shutdown - for (int i = 0; i < MAX_NUM_PHONE_STATE_READS; i++) { - if (!bluetoothOff) { - try { - bluetoothOff = - bluetooth.getState() == BluetoothAdapter.STATE_OFF; - } catch (RemoteException ex) { - Log.e(TAG, "RemoteException during bluetooth shutdown", ex); - bluetoothOff = true; - } - } - if (!radioOff) { - try { - radioOff = !phone.isRadioOn(); - } catch (RemoteException ex) { - Log.e(TAG, "RemoteException during radio shutdown", ex); - radioOff = true; - } - } - if (radioOff && bluetoothOff) { - Log.i(TAG, "Radio and Bluetooth shutdown complete."); - break; - } - SystemClock.sleep(PHONE_STATE_POLL_SLEEP_MSEC); - } // Shutdown MountService to ensure media is in a safe state IMountShutdownObserver observer = new IMountShutdownObserver.Stub() { |