Remember user choice for phone book access permission dialog

Change the always-allowed checkbox to be don't-ask-again checkbox to remember
user's decision so that user will not be bothered agian if he/she checks
the don't-ask-again checkbox
bug 5099661

Change-Id: If32ab8e93313bbd33ff040553083f0cf9359b69e
This commit is contained in:
Matthew Xie
2011-08-08 20:29:18 -07:00
parent 9403d8b239
commit b707255a44
7 changed files with 212 additions and 53 deletions

View File

@@ -17,6 +17,8 @@
package com.android.settings.bluetooth;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.util.Log;
import java.util.ArrayList;
import java.util.Collection;
@@ -26,10 +28,17 @@ import java.util.List;
* CachedBluetoothDeviceManager manages the set of remote Bluetooth devices.
*/
final class CachedBluetoothDeviceManager {
private static final String TAG = "CachedBluetoothDeviceManager";
private static final boolean DEBUG = Utils.D;
private Context mContext;
private final List<CachedBluetoothDevice> mCachedDevices =
new ArrayList<CachedBluetoothDevice>();
CachedBluetoothDeviceManager(Context context) {
mContext = context;
}
public synchronized Collection<CachedBluetoothDevice> getCachedDevicesCopy() {
return new ArrayList<CachedBluetoothDevice>(mCachedDevices);
}
@@ -74,8 +83,8 @@ final class CachedBluetoothDeviceManager {
CachedBluetoothDevice addDevice(LocalBluetoothAdapter adapter,
LocalBluetoothProfileManager profileManager,
BluetoothDevice device) {
CachedBluetoothDevice newDevice = new CachedBluetoothDevice(adapter, profileManager,
device);
CachedBluetoothDevice newDevice = new CachedBluetoothDevice(mContext, adapter,
profileManager, device);
mCachedDevices.add(newDevice);
return newDevice;
}
@@ -124,4 +133,10 @@ final class CachedBluetoothDeviceManager {
cachedDevice.onUuidChanged();
}
}
private void log(String msg) {
if (DEBUG) {
Log.d(TAG, msg);
}
}
}