• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisãofa14d8ff4741499f30fe4a16b4a9627750dede86 (tree)
Hora2011-09-03 09:15:33
AutorJaikumar Ganesh <jaikumar@goog...>
CommiterThe Android Automerger

Mensagem de Log

DO NOT MERGE Fix crash when device is null in Connection Access Cancel.

Bug: 5203970
Change-Id: Ic0604174c0ac9b40685e883f37e1a54070ee0463

Mudança Sumário

Diff

--- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
+++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
@@ -36,6 +36,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
3636
3737 private static final String TAG = "BluetoothPermissionRequest";
3838 private static final boolean DEBUG = false;
39+ private BluetoothDevice mDevice;
3940
4041 public static final int NOTIFICATION_ID = android.R.drawable.stat_sys_data_bluetooth;
4142
@@ -48,15 +49,14 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
4849 if (action.equals(BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST)) {
4950 LocalBluetoothManager localManager = LocalBluetoothManager.getInstance(context);
5051 // convert broadcast intent into activity intent (same action string)
51- BluetoothDevice device =
52- intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
52+ mDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
5353
5454 Intent connectionAccessIntent = new Intent(action);
5555 connectionAccessIntent.setClass(context, BluetoothPermissionActivity.class);
5656 connectionAccessIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
57- connectionAccessIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
57+ connectionAccessIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice);
5858
59- String deviceAddress = device != null ? device.getAddress() : null;
59+ String deviceAddress = mDevice != null ? mDevice.getAddress() : null;
6060
6161 PowerManager powerManager =
6262 (PowerManager) context.getSystemService(Context.POWER_SERVICE);
@@ -71,12 +71,13 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
7171 // "Clear All Notifications" button
7272
7373 Intent deleteIntent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY);
74+ deleteIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice);
7475 deleteIntent.putExtra(BluetoothDevice.EXTRA_CONNECTION_ACCESS_RESULT,
7576 BluetoothDevice.CONNECTION_ACCESS_NO);
7677
7778 Notification notification = new Notification(android.R.drawable.stat_sys_data_bluetooth,
7879 context.getString(R.string.bluetooth_connection_permission_request), System.currentTimeMillis());
79- String deviceName = device != null ? device.getName() : null;
80+ String deviceName = mDevice != null ? mDevice.getName() : null;
8081 notification.setLatestEventInfo(context,
8182 context.getString(R.string.bluetooth_connection_permission_request),
8283 context.getString(R.string.bluetooth_connection_notif_message, deviceName),