From 819dff1c18d3e83a277a8e461ad3397e8b3ded52 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Wed, 8 Dec 2010 17:12:11 -0800 Subject: [PATCH 1/6] Show quick launch settings always. Since external keyboards can be connected, we should always show the quick launch settings. Unfortunately they still need to be fragmentized. Change-Id: I1342ef3892a8b1b465ecc5c1346049f8b1ff73cd --- src/com/android/settings/ApplicationSettings.java | 7 ------- .../android/settings/quicklaunch/QuickLaunchSettings.java | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/com/android/settings/ApplicationSettings.java b/src/com/android/settings/ApplicationSettings.java index ed7c7a085fe..da417ec5636 100644 --- a/src/com/android/settings/ApplicationSettings.java +++ b/src/com/android/settings/ApplicationSettings.java @@ -32,7 +32,6 @@ public class ApplicationSettings extends SettingsPreferenceFragment implements private static final String KEY_TOGGLE_INSTALL_APPLICATIONS = "toggle_install_applications"; private static final String KEY_APP_INSTALL_LOCATION = "app_install_location"; - private static final String KEY_QUICK_LAUNCH = "quick_launch"; // App installation location. Default is ask the user. private static final int APP_INSTALL_AUTO = 0; @@ -74,12 +73,6 @@ public class ApplicationSettings extends SettingsPreferenceFragment implements } }); } - - if (getResources().getConfiguration().keyboard == Configuration.KEYBOARD_NOKEYS) { - // No hard keyboard, remove the setting for quick launch - Preference quickLaunchSetting = findPreference(KEY_QUICK_LAUNCH); - getPreferenceScreen().removePreference(quickLaunchSetting); - } } protected void handleUpdateAppInstallLocation(final String value) { diff --git a/src/com/android/settings/quicklaunch/QuickLaunchSettings.java b/src/com/android/settings/quicklaunch/QuickLaunchSettings.java index 2d2b01cd72f..47fa34a2e22 100644 --- a/src/com/android/settings/quicklaunch/QuickLaunchSettings.java +++ b/src/com/android/settings/quicklaunch/QuickLaunchSettings.java @@ -263,7 +263,7 @@ public class QuickLaunchSettings extends PreferenceActivity implements /** Whether the shortcut has been seen already. The array index is the shortcut. */ SparseBooleanArray shortcutSeen = new SparseBooleanArray(); - KeyCharacterMap keyMap = KeyCharacterMap.load(KeyCharacterMap.BUILT_IN_KEYBOARD); + KeyCharacterMap keyMap = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD); // Go through all the key codes and create a preference for the appropriate keys for (int keyCode = KeyEvent.getMaxKeyCode() - 1; keyCode >= 0; keyCode--) { From c681e939dd6df2cdb39ab8a0edb4eb7027d33f13 Mon Sep 17 00:00:00 2001 From: Jake Hamby Date: Fri, 3 Dec 2010 17:02:02 -0800 Subject: [PATCH 2/6] Reduce max BT device length to 246 bytes due to Bluez bug. (DO NOT MERGE) The maximum Bluetooth device name length is 248 bytes. There are bugs in Bluez and D-Bus that can cause the Bluetooth service to go into a reboot loop when the device name is set to the maximum length. Changed Settings app to limit the device name length to 246 bytes. Bug: 3246147 Change-Id: I2f46303cf44951f0b3907c43d4b096736f08765b --- .../android/settings/bluetooth/BluetoothNamePreference.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothNamePreference.java b/src/com/android/settings/bluetooth/BluetoothNamePreference.java index c99ab4c9982..ad425fccf88 100644 --- a/src/com/android/settings/bluetooth/BluetoothNamePreference.java +++ b/src/com/android/settings/bluetooth/BluetoothNamePreference.java @@ -40,7 +40,8 @@ import android.widget.EditText; */ public class BluetoothNamePreference extends EditTextPreference implements TextWatcher { private static final String TAG = "BluetoothNamePreference"; - private static final int BLUETOOTH_NAME_MAX_LENGTH_BYTES = 248; + // max. length reduced from 248 to 246 bytes to work around Bluez bug + private static final int BLUETOOTH_NAME_MAX_LENGTH_BYTES = 246; private LocalBluetoothManager mLocalManager; From 5cc0e4152b3c75b41c0116c167e2bb5d8d1053cf Mon Sep 17 00:00:00 2001 From: Andy Stadler Date: Wed, 8 Dec 2010 15:57:18 -0800 Subject: [PATCH 3/6] Allow Device Admins to refresh (re-request) activation * ACTION_ADD_DEVICE_ADMIN now works on already-added admins Bug: 3253179 Change-Id: I2090339c1fb61295e728bc61ca977ff6028a68dd --- src/com/android/settings/DeviceAdminAdd.java | 46 ++++++++++++-------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/src/com/android/settings/DeviceAdminAdd.java b/src/com/android/settings/DeviceAdminAdd.java index 005196e2f29..93814af0332 100644 --- a/src/com/android/settings/DeviceAdminAdd.java +++ b/src/com/android/settings/DeviceAdminAdd.java @@ -81,6 +81,7 @@ public class DeviceAdminAdd extends Activity { final ArrayList mActivePolicies = new ArrayList(); boolean mAdding; + boolean mRefreshing; @Override protected void onCreate(Bundle icicle) { @@ -91,7 +92,7 @@ public class DeviceAdminAdd extends Activity { mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE); if ((getIntent().getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) != 0) { - Log.w(TAG, "Can now start ADD_DEVICE_ADMIN as a new task"); + Log.w(TAG, "Cannot start ADD_DEVICE_ADMIN as a new task"); finish(); return; } @@ -103,20 +104,10 @@ public class DeviceAdminAdd extends Activity { finish(); return; } - if (DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN.equals(getIntent().getAction())) { - // If this was an add request, then just exit immediately if the - // given component is already added. - if (mDPM.isAdminActive(cn)) { - setResult(Activity.RESULT_OK); - finish(); - return; - } - } ActivityInfo ai; try { - ai = getPackageManager().getReceiverInfo(cn, - PackageManager.GET_META_DATA); + ai = getPackageManager().getReceiverInfo(cn, PackageManager.GET_META_DATA); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "Unable to retrieve device policy " + cn, e); finish(); @@ -126,7 +117,7 @@ public class DeviceAdminAdd extends Activity { ResolveInfo ri = new ResolveInfo(); ri.activityInfo = ai; try { - mDeviceAdmin= new DeviceAdminInfo(this, ri); + mDeviceAdmin = new DeviceAdminInfo(this, ri); } catch (XmlPullParserException e) { Log.w(TAG, "Unable to retrieve device policy " + cn, e); finish(); @@ -137,8 +128,29 @@ public class DeviceAdminAdd extends Activity { return; } - mAddMsgText = getIntent().getCharSequenceExtra( - DevicePolicyManager.EXTRA_ADD_EXPLANATION); + // This admin already exists, an we have two options at this point. If new policy + // bits are set, show the user the new list. If nothing has changed, simply return + // "OK" immediately. + if (DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN.equals(getIntent().getAction())) { + mRefreshing = false; + if (mDPM.isAdminActive(cn)) { + ArrayList newPolicies = mDeviceAdmin.getUsedPolicies(); + for (int i = 0; i < newPolicies.size(); i++) { + DeviceAdminInfo.PolicyInfo pi = newPolicies.get(i); + if (!mDPM.hasGrantedPolicy(cn, pi.ident)) { + mRefreshing = true; + break; + } + } + if (!mRefreshing) { + // Nothing changed (or policies were removed) - return immediately + setResult(Activity.RESULT_OK); + finish(); + return; + } + } + } + mAddMsgText = getIntent().getCharSequenceExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION); setContentView(R.layout.device_admin_add); @@ -170,7 +182,7 @@ public class DeviceAdminAdd extends Activity { public void onClick(View v) { if (mAdding) { try { - mDPM.setActiveAdmin(mDeviceAdmin.getComponent()); + mDPM.setActiveAdmin(mDeviceAdmin.getComponent(), mRefreshing); setResult(Activity.RESULT_OK); } catch (RuntimeException e) { // Something bad happened... could be that it was @@ -260,7 +272,7 @@ public class DeviceAdminAdd extends Activity { } else { mAddMsg.setVisibility(View.GONE); } - if (mDPM.isAdminActive(mDeviceAdmin.getComponent())) { + if (!mRefreshing && mDPM.isAdminActive(mDeviceAdmin.getComponent())) { if (mActivePolicies.size() == 0) { ArrayList policies = mDeviceAdmin.getUsedPolicies(); for (int i=0; i Date: Wed, 8 Dec 2010 18:46:38 -0800 Subject: [PATCH 4/6] Add backup configuration action to Privacy settings Settings now queries the backup manager for a configuration Intent and text descriptive of the state of the currently-active transport. These are used by a new Intent PreferenceScreen within the backup section of the Privacy settings UI. When touched, the Configure item launches the Intent supplied by the transport; when no such Intent is available, the item is disabled. The summary text describing the current backup state is also supplied by the transport. Bug: 2753632 Change-Id: I3d8fb3d4b08a2b6fa8d3ad8f9e02a66430948423 --- res/values/strings.xml | 4 +++ res/xml/privacy_settings.xml | 8 +++++ src/com/android/settings/PrivacySettings.java | 36 +++++++++++++++---- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 5df08d7d1a0..36046c49d1e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2906,6 +2906,10 @@ found in the list of installed applications. Back up my data Back up application data, Wi-Fi passwords, and other settings to Google servers + + Configure backup + + No backup destination is available. Automatic restore diff --git a/res/xml/privacy_settings.xml b/res/xml/privacy_settings.xml index 86fc30658a6..c28dbc1901e 100644 --- a/res/xml/privacy_settings.xml +++ b/res/xml/privacy_settings.xml @@ -25,6 +25,14 @@ android:title="@string/backup_data_title" android:summary="@string/backup_data_summary" android:persistent="false" /> + + + Date: Tue, 7 Dec 2010 16:27:21 -0800 Subject: [PATCH 5/6] Implement BT settings functionality for new UI. - Removed context menu logic for long press (no longer used). - Converted device picker to run in its own Activity, using a dialog theme on large screen devices and full-screen on phones. - Removed unused resources. - Add device to "Paired devices" list when pairing is initiated by the remote device. - Return to Bluetooth settings pane after successfully pairing a new device from the "Find nearby device" pane. - Add support for renaming devices (TODO: persist the custom name and update the "bread crumb" in the action bar to the new device name). - Add support for incoming file transfer and auto connect checkboxes in DeviceProfilesSettings. - Show available and connected device profiles as icons instead of summary text. Available but disconnected profiles are drawn in gray. - Fixed bluetooth_notif_message to include the device name as a parameter instead of appending the name to the end of the localized string. - Changed some fields from private to package scope for more efficient access from inner classes. Bug: 3137982 Change-Id: Ic2d6ee5be60c9c5b3f3a8a58846d58efedfa5c93 --- AndroidManifest.xml | 14 +- res/layout/bluetooth.xml | 51 ------ res/layout/bluetooth_device_picker.xml | 28 +++ res/values/strings.xml | 19 +- src/com/android/settings/DeviceAdminAdd.java | 2 - .../bluetooth/BluetoothDevicePreference.java | 25 ++- .../settings/bluetooth/BluetoothEnabler.java | 4 +- .../bluetooth/BluetoothEventRedirector.java | 6 +- .../bluetooth/BluetoothPairingRequest.java | 5 +- .../settings/bluetooth/BluetoothSettings.java | 80 +++------ .../bluetooth/CachedBluetoothDevice.java | 170 +++--------------- .../CachedBluetoothDeviceManager.java | 12 +- .../bluetooth/DevicePickerActivity.java | 35 ++++ .../bluetooth/DeviceProfilesSettings.java | 49 +++-- .../bluetooth/LocalBluetoothManager.java | 3 + .../LocalBluetoothProfileManager.java | 1 - 16 files changed, 195 insertions(+), 309 deletions(-) delete mode 100644 res/layout/bluetooth.xml create mode 100644 res/layout/bluetooth_device_picker.xml create mode 100644 src/com/android/settings/bluetooth/DevicePickerActivity.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 926f6f87f4a..15dc279cf3f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -206,16 +206,22 @@ - - - - + + + + + + + diff --git a/res/layout/bluetooth.xml b/res/layout/bluetooth.xml deleted file mode 100644 index a4ac1ca9351..00000000000 --- a/res/layout/bluetooth.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - -