am bd704c74: BT connection notification in not updated in status bar for second user It is due to the system UI is always running as the first user. It can\'t receive broadcast intent ACTION_CONNECTION_STATE_CHANGED and ACTION_BOND_STATE_CHANGED from bluetooth service
* commit 'bd704c741b8c523ad747214f6f0520ac3e2caf8f':
BT connection notification in not updated in status bar for second user It is due to the system UI is always running as the first user. It can't receive broadcast intent ACTION_CONNECTION_STATE_CHANGED and ACTION_BOND_STATE_CHANGED from bluetooth service when We switch to second user. Also the system UI also is running as uid 10055, which will also call function isEnabled, getState, getBondedDevices, getAdapterConnectionState and getBondState in bluetooth service. I allow these functions to be called by all the users. I forget remove check for getBondState in my first patch set
diff --git a/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivity.java b/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivity.java
index 029c4f8..d01c033 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivity.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppBtEnableActivity.java
@@ -56,7 +56,7 @@
// Set up the "dialog"
final AlertController.AlertParams p = mAlertParams;
- p.mIconId = android.R.drawable.ic_dialog_alert;
+ p.mIconAttrId = android.R.attr.alertDialogIcon;
p.mTitle = getString(R.string.bt_enable_title);
p.mView = createView();
p.mPositiveButtonText = getString(R.string.bt_enable_ok);
diff --git a/src/com/android/bluetooth/opp/BluetoothOppBtErrorActivity.java b/src/com/android/bluetooth/opp/BluetoothOppBtErrorActivity.java
index 9fa6e12..d2380f6 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppBtErrorActivity.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppBtErrorActivity.java
@@ -61,7 +61,7 @@
// Set up the "dialog"
final AlertController.AlertParams p = mAlertParams;
- p.mIconId = android.R.drawable.ic_dialog_alert;
+ p.mIconAttrId = android.R.attr.alertDialogIcon;
p.mTitle = mErrorTitle;
p.mView = createView();
p.mPositiveButtonText = getString(R.string.bt_error_btn_ok);
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java b/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java
index 87a695d..23c9cb8 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java
@@ -223,14 +223,14 @@
mPara.mPositiveButtonText = getString(R.string.download_succ_ok);
mPara.mPositiveButtonListener = this;
} else if (mWhichDialog == DIALOG_RECEIVE_COMPLETE_FAIL) {
- mPara.mIconId = android.R.drawable.ic_dialog_alert;
+ mPara.mIconAttrId = android.R.attr.alertDialogIcon;
mPara.mPositiveButtonText = getString(R.string.download_fail_ok);
mPara.mPositiveButtonListener = this;
} else if (mWhichDialog == DIALOG_SEND_COMPLETE_SUCCESS) {
mPara.mPositiveButtonText = getString(R.string.upload_succ_ok);
mPara.mPositiveButtonListener = this;
} else if (mWhichDialog == DIALOG_SEND_COMPLETE_FAIL) {
- mPara.mIconId = android.R.drawable.ic_dialog_alert;
+ mPara.mIconAttrId = android.R.attr.alertDialogIcon;
mPara.mPositiveButtonText = getString(R.string.upload_fail_ok);
mPara.mPositiveButtonListener = this;
mPara.mNegativeButtonText = getString(R.string.upload_fail_cancel);
@@ -458,7 +458,7 @@
mAlert.getButton(DialogInterface.BUTTON_POSITIVE).setText(
getString(R.string.download_succ_ok));
} else if (mWhichDialog == DIALOG_RECEIVE_COMPLETE_FAIL) {
- mAlert.setIcon(android.R.drawable.ic_dialog_alert);
+ mAlert.setIcon(mAlert.getIconAttributeResId(android.R.attr.alertDialogIcon));
mAlert.getButton(DialogInterface.BUTTON_NEGATIVE).setVisibility(View.GONE);
mAlert.getButton(DialogInterface.BUTTON_POSITIVE).setText(
getString(R.string.download_fail_ok));
@@ -467,7 +467,7 @@
mAlert.getButton(DialogInterface.BUTTON_POSITIVE).setText(
getString(R.string.upload_succ_ok));
} else if (mWhichDialog == DIALOG_SEND_COMPLETE_FAIL) {
- mAlert.setIcon(android.R.drawable.ic_dialog_alert);
+ mAlert.setIcon(mAlert.getIconAttributeResId(android.R.attr.alertDialogIcon));
mAlert.getButton(DialogInterface.BUTTON_POSITIVE).setText(
getString(R.string.upload_fail_ok));
mAlert.getButton(DialogInterface.BUTTON_NEGATIVE).setText(