Allows auto dismissing of bluetooth activation dialogs

Create a new overlay boolean that allows products (like Android@Home
ones that have no or minimal display) to not bring up the bluetooth
activation confirmation dialog.

Change-Id: I23c2d1483a4d71b0025624c2e4aaacc688de3260
Signed-off-by: Mike J. Chen <mjchen@google.com>
This commit is contained in:
Mike J. Chen
2011-09-08 09:49:28 -07:00
committed by Mike Lockwood
parent bb16d168a1
commit ef4eb89d71
3 changed files with 14 additions and 0 deletions

View File

@@ -22,4 +22,7 @@
<!-- Whether the power control widget is enabled for this device. Should be overridden for
specific product builds. -->
<bool name="has_powercontrol_widget">true</bool>
<!-- Whether the bluetooth activation confirmation dialogs should be auto dismissed.
Can be overridden for specific product builds. -->
<bool name="auto_confirm_bluetooth_activation_dialog">false</bool>
</resources>

View File

@@ -173,6 +173,11 @@ public class RequestPermissionActivity extends Activity implements
mDialog = builder.create();
mDialog.show();
if (getResources().getBoolean(R.bool.auto_confirm_bluetooth_activation_dialog) == true) {
// dismiss dialog immediately if settings say so
onClick(null, DialogInterface.BUTTON_POSITIVE);
}
}
@Override

View File

@@ -62,6 +62,12 @@ public class RequestPermissionHelperActivity extends AlertActivity implements
}
createDialog();
if (getResources().getBoolean(R.bool.auto_confirm_bluetooth_activation_dialog) == true) {
// dismiss dialog immediately if settings say so
onClick(null, BUTTON_POSITIVE);
dismiss();
}
}
void createDialog() {