summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/ButtonSettings.java
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-02-23 15:19:00 -0800
committerAdnan Begovic <adnan@cyngn.com>2015-10-29 17:36:28 -0700
commitc978a553897f8525754fc11cfefbca3196a608dc (patch)
treee850dd2ddd2e56a8f71551edacc49cedeaf90b03 /src/com/android/settings/ButtonSettings.java
parent5f8bf98dc28d58becadf0bbbcd0ed8d359e68d39 (diff)
downloadpackages_apps_Settings-c978a553897f8525754fc11cfefbca3196a608dc.zip
packages_apps_Settings-c978a553897f8525754fc11cfefbca3196a608dc.tar.gz
packages_apps_Settings-c978a553897f8525754fc11cfefbca3196a608dc.tar.bz2
Settings: Clean up code style in ButtonSettings
Change-Id: I6df0ee12536dcca2b9734785bebe16a0fea7f0c2
Diffstat (limited to 'src/com/android/settings/ButtonSettings.java')
-rw-r--r--src/com/android/settings/ButtonSettings.java27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/com/android/settings/ButtonSettings.java b/src/com/android/settings/ButtonSettings.java
index 95bb3d9..ee81bcd 100644
--- a/src/com/android/settings/ButtonSettings.java
+++ b/src/com/android/settings/ButtonSettings.java
@@ -189,7 +189,8 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
mNavigationBarLeftPref = (SwitchPreference) findPreference(KEY_NAVIGATION_BAR_LEFT);
// Navigation bar recents long press activity needs custom setup
- mNavigationRecentsLongPressAction = initRecentsLongPressAction(KEY_NAVIGATION_RECENTS_LONG_PRESS);
+ mNavigationRecentsLongPressAction =
+ initRecentsLongPressAction(KEY_NAVIGATION_RECENTS_LONG_PRESS);
// Only visible on devices that does not have a navigation bar already,
// and don't even try unless the existing keys can be disabled
@@ -425,15 +426,17 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
targetComponent = ComponentName.unflattenFromString(componentString);
}
- // Dyanamically generate the list array, query PackageManager for all Activites that are registered for
- // ACTION_RECENTS_LONG_PRESS
+ // Dyanamically generate the list array,
+ // query PackageManager for all Activites that are registered for ACTION_RECENTS_LONG_PRESS
PackageManager pm = getPackageManager();
Intent intent = new Intent(Intent.ACTION_RECENTS_LONG_PRESS);
- List<ResolveInfo> recentsActivities = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
+ List<ResolveInfo> recentsActivities = pm.queryIntentActivities(intent,
+ PackageManager.MATCH_DEFAULT_ONLY);
if (recentsActivities.size() == 0) {
// No entries available, disable
list.setSummary(getString(R.string.hardware_keys_action_last_app));
- Settings.Secure.putString(getContentResolver(), Settings.Secure.RECENTS_LONG_PRESS_ACTIVITY, null);
+ Settings.Secure.putString(getContentResolver(),
+ Settings.Secure.RECENTS_LONG_PRESS_ACTIVITY, null);
list.setEnabled(false);
return list;
}
@@ -447,8 +450,8 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
int i = 1;
for (ResolveInfo info : recentsActivities) {
try {
- // Use pm.getApplicationInfo for the label, we cannot rely on ResolveInfo that comes back from
- // queryIntentActivities.
+ // Use pm.getApplicationInfo for the label,
+ // we cannot rely on ResolveInfo that comes back from queryIntentActivities.
entries[i] = pm.getApplicationInfo(info.activityInfo.packageName, 0).loadLabel(pm);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Error package not found: " + info.activityInfo.packageName, e);
@@ -457,7 +460,8 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
}
// Set the value to the ComponentName that will handle this intent
- ComponentName entryComponent = new ComponentName(info.activityInfo.packageName, info.activityInfo.name);
+ ComponentName entryComponent = new ComponentName(info.activityInfo.packageName,
+ info.activityInfo.name);
values[i] = entryComponent.flattenToString();
if (targetComponent != null) {
if (entryComponent.equals(targetComponent)) {
@@ -524,8 +528,8 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
Settings.System.VOLUME_KEY_CURSOR_CONTROL);
return true;
} else if (preference == mNavigationRecentsLongPressAction) {
- // RecentsLongPressAction is handled differently because it intentionally uses Settings.
- // Settings.System.
+ // RecentsLongPressAction is handled differently because it intentionally uses
+ // Settings.System
String putString = (String) newValue;
int index = mNavigationRecentsLongPressAction.findIndexOfValue(putString);
CharSequence summary = mNavigationRecentsLongPressAction.getEntries()[index];
@@ -534,7 +538,8 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
if (putString.length() == 0) {
putString = null;
}
- Settings.Secure.putString(getContentResolver(), Settings.Secure.RECENTS_LONG_PRESS_ACTIVITY, putString);
+ Settings.Secure.putString(getContentResolver(),
+ Settings.Secure.RECENTS_LONG_PRESS_ACTIVITY, putString);
return true;
}
return false;