packages/apps/Settings
Revisão | ec25157ad840a4932c012f75eda1f239e6b4ef12 (tree) |
---|---|
Hora | 2015-12-02 10:41:41 |
Autor | Sanket Padawe <sanketpadawe@goog...> |
Commiter | The Android Automerger |
Uncheck checkbox for contact sharing by default for non carkit devices.
+ In BT pairing dialog, uncheck checkbox for contact sharing by default
for devices not recognized as carkits at pair time.
Bug: 23607427
Change-Id: I7f1d40d86e713e248d3c225459be4895c4f75d76
@@ -195,8 +195,14 @@ public final class BluetoothPairingDialog extends AlertActivity implements | ||
195 | 195 | } else if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_REJECTED){ |
196 | 196 | contactSharing.setChecked(false); |
197 | 197 | } else { |
198 | - contactSharing.setChecked(true); | |
199 | - mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); | |
198 | + if (mDevice.getBluetoothClass().getDeviceClass() | |
199 | + == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { | |
200 | + contactSharing.setChecked(true); | |
201 | + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); | |
202 | + } else { | |
203 | + contactSharing.setChecked(false); | |
204 | + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); | |
205 | + } | |
200 | 206 | } |
201 | 207 | |
202 | 208 | contactSharing.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
@@ -209,12 +215,7 @@ public final class BluetoothPairingDialog extends AlertActivity implements | ||
209 | 215 | } |
210 | 216 | } |
211 | 217 | }); |
212 | - if (mDevice.getBluetoothClass().getDeviceClass() | |
213 | - == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { | |
214 | - contactSharing.setVisibility(View.VISIBLE); | |
215 | - } else { | |
216 | - contactSharing.setVisibility(View.GONE); | |
217 | - } | |
218 | + | |
218 | 219 | mPairingView = (EditText) view.findViewById(R.id.text); |
219 | 220 | mPairingView.addTextChangedListener(this); |
220 | 221 | alphanumericPin.setOnCheckedChangeListener(this); |
@@ -267,8 +268,14 @@ public final class BluetoothPairingDialog extends AlertActivity implements | ||
267 | 268 | } else if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_REJECTED){ |
268 | 269 | contactSharing.setChecked(false); |
269 | 270 | } else { |
270 | - contactSharing.setChecked(true); | |
271 | - mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); | |
271 | + if (mDevice.getBluetoothClass().getDeviceClass() | |
272 | + == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { | |
273 | + contactSharing.setChecked(true); | |
274 | + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); | |
275 | + } else { | |
276 | + contactSharing.setChecked(false); | |
277 | + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); | |
278 | + } | |
272 | 279 | } |
273 | 280 | |
274 | 281 | contactSharing.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
@@ -281,12 +288,6 @@ public final class BluetoothPairingDialog extends AlertActivity implements | ||
281 | 288 | } |
282 | 289 | } |
283 | 290 | }); |
284 | - if (mDevice.getBluetoothClass().getDeviceClass() | |
285 | - == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { | |
286 | - contactSharing.setVisibility(View.VISIBLE); | |
287 | - } else { | |
288 | - contactSharing.setVisibility(View.GONE); | |
289 | - } | |
290 | 291 | |
291 | 292 | String messageCaption = null; |
292 | 293 | String pairingContent = null; |