Always save message permission choice

For current design, message sharing option only display when
mapPermisson != CachedBluetoothDevice.ACCESS_UNKNOWN. MAP permisson only
saved when user reject requset twice or accept request, if user just
reject once, permission will be ACCESS_UNKNOWN and message sharing
option will not display. This patch remove the check of
MessageRejectionCount and always save message permission choice.

Bug: 120291728
Test: reject message access request and check device details page
Change-Id: I071491d3c4134ed348e195f054b6557e397cdd6a
This commit is contained in:
Chienyuan
2018-12-06 19:19:21 +08:00
parent bd8374fb26
commit 10b21a605b

View File

@@ -199,20 +199,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements
private void onNegative() { private void onNegative() {
if (DEBUG) Log.d(TAG, "onNegative"); if (DEBUG) Log.d(TAG, "onNegative");
sendReplyIntentToReceiver(false, true);
boolean always = true;
if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) {
LocalBluetoothManager bluetoothManager = Utils.getLocalBtManager(this);
CachedBluetoothDeviceManager cachedDeviceManager =
bluetoothManager.getCachedDeviceManager();
CachedBluetoothDevice cachedDevice = cachedDeviceManager.findDevice(mDevice);
if (cachedDevice == null) {
cachedDevice = cachedDeviceManager.addDevice(mDevice);
}
always = cachedDevice.checkAndIncreaseMessageRejectionCount();
}
sendReplyIntentToReceiver(false, always);
} }
private void sendReplyIntentToReceiver(final boolean allowed, final boolean always) { private void sendReplyIntentToReceiver(final boolean allowed, final boolean always) {