diff options
author | Roman Birg <roman@cyngn.com> | 2016-04-29 15:55:32 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-05-02 15:56:05 -0700 |
commit | f5b69f336e058cf75683ab3681b01254827f140c (patch) | |
tree | 7056def183b20232788ff49f834bdc190731c17c /packages/SettingsLib/src/com/android/settingslib | |
parent | 9f7fc271dda8989fe5ad5786a2ab409385d6b78c (diff) | |
download | frameworks_base-f5b69f336e058cf75683ab3681b01254827f140c.zip frameworks_base-f5b69f336e058cf75683ab3681b01254827f140c.tar.gz frameworks_base-f5b69f336e058cf75683ab3681b01254827f140c.tar.bz2 |
Lockscreen shortcuts: don't allow specific activities
The picker allowed users to pick specific activities from an app that it
did not explicitly expose to the user.
This is not good UX as many activities are not meant to be user facing
and are expecting certain input. Users can pick apps themselves, or apps
can opt-in to shortcuts and publish things themselves.
Ticket: CYNGNOS-2684
Change-Id: I9199d442dbe9eaa4140a706166a6fde87bc8957c
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages/SettingsLib/src/com/android/settingslib')
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/cm/ShortcutPickHelper.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/cm/ShortcutPickHelper.java b/packages/SettingsLib/src/com/android/settingslib/cm/ShortcutPickHelper.java index a18a7e9..8aa5671 100644 --- a/packages/SettingsLib/src/com/android/settingslib/cm/ShortcutPickHelper.java +++ b/packages/SettingsLib/src/com/android/settingslib/cm/ShortcutPickHelper.java @@ -83,6 +83,11 @@ public class ShortcutPickHelper { } public void pickShortcut(String[] names, ShortcutIconResource[] icons, int fragmentId) { + pickShortcut(names, icons, fragmentId, true); + } + + public void pickShortcut(String[] names, ShortcutIconResource[] icons, int fragmentId, + boolean showActivityPicker) { Bundle bundle = new Bundle(); ArrayList<String> shortcutNames = new ArrayList<String>(); @@ -92,7 +97,9 @@ public class ShortcutPickHelper { } } shortcutNames.add(mParent.getString(R.string.profile_applist_title)); - shortcutNames.add(mParent.getString(R.string.picker_activities)); + if (showActivityPicker) { + shortcutNames.add(mParent.getString(R.string.picker_activities)); + } bundle.putStringArrayList(Intent.EXTRA_SHORTCUT_NAME, shortcutNames); ArrayList<ShortcutIconResource> shortcutIcons = new ArrayList<ShortcutIconResource>(); @@ -102,7 +109,10 @@ public class ShortcutPickHelper { } } shortcutIcons.add(ShortcutIconResource.fromContext(mParent, android.R.drawable.sym_def_app_icon)); - shortcutIcons.add(ShortcutIconResource.fromContext(mParent, R.drawable.activities_icon)); + if (showActivityPicker) { + shortcutIcons.add( + ShortcutIconResource.fromContext(mParent, R.drawable.activities_icon)); + } bundle.putParcelableArrayList(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, shortcutIcons); Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY); |