Commit Graph

55 Commits

Author SHA1 Message Date
Julia Reynolds
d7faba5c25 Add null check when loading restricted profile apps.
In case the profile is being deleted.
Bug: 22235449

Change-Id: Ia67deb4e578edf79079ddc308b0750327c1ff85d
2015-08-17 13:09:47 -04:00
Fyodor Kupolov
2b2ab5a947 Support for nested bundles in setApplicationRestrictions
Replaced RestrictionUtils.restrictionsToBundle with RestrictionsManager.
convertRestrictionsToBundle.

Bug: 19540606
Change-Id: I32b264e04d5d177ea5b4c39a8ace5ee0ce907970
2015-04-03 10:19:24 -07:00
Chris Wren
8a963babe2 log visibility of views
Depends-On: I5b1dccb5d103ece3112acf38889bae16273b092f
Change-Id: I116aed2bb805f723a5bf2ec9eb94257de0b4a7b5
2015-03-27 13:39:07 -04:00
John Spurlock
9a23adf69d Settings: Remove all unused imports.
Change-Id: Iebfa52cb849d69974c94902b0b020893cf5618a3
2015-03-18 15:51:15 -04:00
Fyodor Kupolov
b0fc28cba5 Settings app should be available to restricted user
Fixed a regression, caused by collapsing location and settings entries
into a single preference. Now settings package is explicitly enabled.

Bug: 19434520
Change-Id: I05440d04c100b6a5ee5573ac116bfb4d66782aa8
2015-03-02 11:01:03 -08:00
Alex Klyubin
053f83d470 am e029b91c: am 1d33bca0: Merge "Hidden ApplicationInfo flags are now in privateFlags."
* commit 'e029b91c53323c27ea18a57c6af8c00ecab5576b':
  Hidden ApplicationInfo flags are now in privateFlags.
2015-02-11 19:58:03 +00:00
Alex Klyubin
e029b91c53 am 1d33bca0: Merge "Hidden ApplicationInfo flags are now in privateFlags."
* commit '1d33bca0e496f980ec1a364f58cccd457d40954a':
  Hidden ApplicationInfo flags are now in privateFlags.
2015-02-11 19:47:09 +00:00
Alex Klyubin
cc254f4da9 Hidden ApplicationInfo flags are now in privateFlags.
See b9f8a5204a1b0b3919fa921e858d04124c582828.

Change-Id: I98bbe4b1a5ac0939e0000e4da8b21a1964c75e8b
2015-02-11 11:10:12 -08:00
Zoltan Szatmary-Ban
273a6e7ffd Merge "Eliminate duplicated code for creating circled user icons in Settings." 2015-02-09 13:13:38 +00:00
Fyodor Kupolov
bc02b84cb5 Show Location restriction without the Settings item
In App & content access page for restricted profiles, Location restriction
should be shown without its parent element.

Also fixed an issue when app summary may be incomplete.

Bug:15761405,17182612
Change-Id: Ia298cf581413d124d25608f825f97a9e64baf479
2015-01-15 11:58:19 -08:00
Zoltan Szatmary-Ban
d7cadf3de2 Eliminate duplicated code for creating circled user icons in Settings.
Use Utils.getUserIcon instead.

Change-Id: Id653f8c89ac041e925464c88bbc0c7c43d3ce632
2014-12-19 15:23:16 +00:00
Amith Yamasani
0cc764beed Merge "Watch out for deleted user when exiting async task" into lmp-mr1-dev 2014-11-21 01:47:20 +00:00
Amith Yamasani
45f86236e4 Watch out for deleted user when exiting async task
Fixes a problem where the async task can take a while to execute
and in the meantime the user can be removed. On exiting the async
task and updating the UI, make sure the user hasn't been deleted.

Bug: 18411181
Change-Id: I1831f3e53084c49e27557cb7aacec78c753a611b
2014-11-20 13:19:18 -08:00
Fyodor Kupolov
07ab95c43e Added a check if a custom activity can be started
AppRestrictionsFragment starts an activity using an intent provided by the
receiver. A check was added to prevent an app from starting an activity that
it does not own.

Bug: 14441412
Change-Id: Ia6820b1daf3783d605b92976c78cb522b17dc8f2
2014-11-18 17:12:54 -08:00
Fabrice Di Meglio
daef2e2b06 Fix bug #15730311 Checkboxes on R side should update to Quantum/Material on/off switch
Per UX request, convert more CheckBoxes to Switches

Change-Id: I04712bce4c0a54516d9ecedbb554f403fd6dd9e7
2014-10-15 19:00:35 -07:00
Amith Yamasani
3391321e2f Fix toggle button clickability in app restrictions
Also fix side padding

Bug: 17159406
Change-Id: Ic1d61d9a4a7ae6f3f7c451405a6e127791edbdaf
2014-08-25 15:20:34 -07:00
Alexandra Gherghina
fe47a8dc89 Toggle between primary and managed profile in Print Settings
This adds a spinner to the print settings screen which can be used to toggle
between the Settings app in the primary and managed profile so that the user
can edit settings belonging to both profiles.

Bug: 16369104
Change-Id: I2556a331d09379c2a501bc6b192ab1631b5215f5
2014-07-29 10:22:15 +01:00
Amith Yamasani
247520c369 More User Settings improvements
Add a menu checkbox to allow creation of users from lockscreen.
Add a delete icon in restricted profiles settings.
Other little fixes to icons.
Update some strings based on feedback.

Bug: 15761405
Bug: 16550371
Bug: 16298824

Change-Id: Ib876bd57f15c6ce2d71856f72571c6b8b0e3102d
2014-07-26 14:09:43 +00:00
Amith Yamasani
ee3987475e Refactor User Profile editor dialog for reuse
Move the dialog code into a separate class.
Use it from RestrictedProfileSettings
and UserSettings for the current user.

Bug: 15761405
Change-Id: I0b9a95ba8463304525e6a4b8cf3b4ca77b15796f
2014-07-24 23:13:34 +00:00
Amith Yamasani
fca31ca418 Follow API change from *Blocked to *Hidden
Bug: 16191518
Change-Id: I4cbe210e62d551e4d5246eb3a7523d03c41175be
2014-07-21 22:19:09 +00:00
Amith Yamasani
9e6ac3d25f Multiuser settings revamp for L, first pass
Include Guest settings
Ability to switch users from Settings
Manage user settings like telephony access

Bug: 15761405
Change-Id: I2cfdc7bc2703ed202aa8bf1261c304c51ce48b29
2014-07-01 13:19:35 +05:30
Amith Yamasani
38e7610512 Exit restrictions fragment if user was deleted
When resuming the restricted user fragment, make sure that the user still
exists, as it may have been deleted by the restricted user.

Bug: 11010340

Change-Id: I3360dbc42586c5bb28013844f8c788e641ad8b6a
2013-10-03 16:08:56 -07:00
Amith Yamasani
cb6ba728c5 Merge "Don't list apps that are disabled by the system" into klp-dev 2013-08-27 21:42:58 +00:00
Amith Yamasani
d760a61936 Fix custom restrictions launch mechanism
Instead of showing a separate entry for launching custom restrictions,
launch it directly when clicking on the settings icon.

Bug: 10388399
Change-Id: I327d6d4c2b9840ce5ba140746568c5561a1a8936
2013-08-20 16:26:48 -07:00
Amith Yamasani
928191881d Don't list apps that are disabled by the system
This is to make sure that apps that were disabled for some reason
such as inappropriateness for a locale or for a specific device, don't
show up as available to enable for a restricted profile.

But in the case that the app was already enabled for the target profile,
show it in the list so that it can be disabled if necessary.

Bug: 10229133
Change-Id: I3c19edb7364cea42d95b619781e0326543b9a1cf
2013-08-16 13:59:40 -07:00
Amith Yamasani
7eedcf4a50 Apply restrictions right away instead of on exit
Use usermanager to clear restrictions, as it needs to do a bunch of
book keeping.

Apply PIN restriction to master clear button.

Changing existing PIN now includes verifying the PIN, so it doesn't
need to be cleared here in Settings.

Removed automatic persisting of restrictions on receiving them unless
it is a restricted profile.

Make apps that are signed with platform certs immutable and ON.

Change-Id: Iffd1bf2eb0d18202fb66ddcf80668baa8e6b84ed
2013-07-18 11:37:32 -07:00
Amith Yamasani
9e9c77c130 Fix accidental creation of restriction entry for required apps
When entering Settings->Restrictions, don't automatically query restriction entries
for required apps.

Bug: 9681399
Change-Id: Idcc773bf4793b3e7e2b328a15881b7ecf930c6c3
2013-07-09 11:28:40 -07:00
Amith Yamasani
ab72687b15 Don't start the loader task if one is already running
This should appease the monkeys.

Bug: 9619255
Change-Id: Idbac0bd86acafbdb636b0b18e09fcbb9eea15cc4
2013-06-28 15:30:08 -07:00
Amith Yamasani
0ca80fe4cd Single-user restrictions
New restrictions panel for restricting list of available apps for the user.
Apps that support restrictions can also be configured here.
Restrictions screen is PIN protected and will ask you to create a PIN the
first time you use it.

Change-Id: I7a5267df4272521ad80e6a8b6a18932d07179eb8
2013-06-25 16:49:38 -07:00
Amith Yamasani
48b8b8fd18 Allow hidden apps to opt-out
When a system app doesn't have any UI, it wasn't being considered for
opt-out. Check for all system apps that want to opt-out and mark them
for uninstallation.

Bug: 8908632
Change-Id: Iad7ccbe544cc7c7ebf73f430fbab8d295eb40219
2013-06-06 14:48:07 -07:00
Amith Yamasani
0b2781ae53 Write restriction bundle right away for required apps.
User shouldn't have to go tap on the settings icon for an app that is ON by default
in a restricted profile. This way apps can write some defaults to the restricted
profile when it is created.

The app entry is also automatically removed from the list if there are no visible
restrictions.

Bug: 9074051

Also fix an incorrect dialog label. Bug: 9068877

Change-Id: I2a7ddc31fe695f58611d2ba36a8bf541b7817b10
2013-05-21 16:07:28 -07:00
Amith Yamasani
f88e6e5ae6 Don't mutate all instances of app icons in Settings
When adding color filters to an app icon in User Settings, don't
modify the original drawable state. Get a mutable drawable.

Bug: 9054675
Change-Id: I6ea374cb801abef3f5b597fda2e84b4e67cfa9d0
2013-05-20 16:05:22 -07:00
Amith Yamasani
76738fa651 Load the avatar icon if it's not yet in the activity view
Save any changes that weren't committed yet, but don't restore
earlier cancelled changes.

Bug: 9008014
Change-Id: I8faacc42a3600d1338ddedb1b59f7307903743b4
2013-05-17 15:09:47 -07:00
Amith Yamasani
7b56d115ba Save app toggle state as soon as possible
Delaying applying the states till onPause() sometimes results in the apps
disappearing slowly as the new user is booting up, causing failed queued up
broadcasts that result in crash dialogs. This happens mainly when the user
switch is initiated via QuickSettings->LockScreen->Switch while the App
restrictions screen is still showing. The onPause() gets called when
SetupWizard actually takes focus, which is quite late, as boot completed
and other events have already been queued.

Apply the initial toggles right away and apply any user changes when primary
is going to background, or onPause(), whichever comes first.

Bug: 8685927

Also ensure that apps with restrictions get a chance to persist their defaults
as soon as they are toggled on. The user may never actually click on the settings
icon for the app (which was the only way they were getting persisted before).

Some new strings for an upcoming change.

Change-Id: I96f453d066a91c6b15eafe9a6ce3f42d98bf5e33
2013-04-26 15:18:33 -07:00
Amith Yamasani
a7a93784d1 Always include default system IMEs for restricted profiles
Add default IMEs to an exclusion set so that we don't include them in the
list of toggleable system apps that we show the user.

Bug: 8724246

Unrevert the change to include disabled apps, as the above change fixes the
reason for the revert.

Bug: 8713202

Change-Id: Ifced841ad3bfbde33d2403356216dd1749b7fa9a
2013-04-25 23:02:50 -07:00
Amith Yamasani
39d0fd84ad Revert "Disabled apps should also be shown in restricted profiles app list"
This is breaking restricted profiles because the Google Keyboard suddenly
shows up in the list as disabled and InputMethodManagerService crashes
if the only available keyboard is not installed for the profile.

This reverts commit 90dcd7469b

Change-Id: Idd7c4f0f93a973b777889865e80c53caad759a63
2013-04-25 21:39:23 +00:00
Amith Yamasani
90dcd7469b Disabled apps should also be shown in restricted profiles app list
If we don't show disabled system apps for toggling, they'll end up
being automatically included in the restricted profile.

Make sure that we also list disabled apps.

Bug: 8713202
Change-Id: I8f2facf496f669dfe963cdabf3d29d393097a80b
2013-04-25 11:03:33 -07:00
Amith Yamasani
1bad7141b4 Fix repeating apps on pause/resume
Preference list was getting duplicated on pausing and resuming the activity.

Pull the user info out of the preference list and make it a static header
so that it stays fixed. Can now remove all entries before re-adding.

Disable location by default and disable ability to change Unknown sources
 toggle.

Bug: 8685561
Bug: 8688400

Change-Id: I64ce728d5369e03ddaba562bcd66bb0720a037d2
2013-04-22 17:03:30 -07:00
Svetoslav
bf3391f19b Adding UI for editing the name and the picture of a limited user.
A limited user may not have access to contacts, thus the settings
app has to be able to show UI for selecting a user photo from
gallery or via camera.

bug:8566861

Change-Id: I1974b1a19b0fee8c737d1345302e1b2fba108379
2013-04-22 12:12:05 -07:00
Amith Yamasani
a98c402e44 Several improvements and fixes in restrictions UI
Bug: 8668906 : Add string indicating that the app has opted-in
Bug: 8663558 : Fix a crash in settings when EXTRA_RESTRICTIONS_LIST is empty
               Also accept EXTRA_RESTRICTIONS_BUNDLE as a result from custom
               restrictions activity
Bug: 8653389 : Some apps show up twice in the limited user config screen
Bug: 8653915 : Jank when adding a new limited user

Change-Id: I293148000be70850f565dbddb4c942d69142ae17
2013-04-19 16:27:09 -07:00
Amith Yamasani
5ee1750519 Changes to deal with restrictions API change
Bug: 8633967
Change-Id: I5d8e843c850ad3eff900409a9006666ddf91b061
2013-04-17 10:47:34 -07:00
Amith Yamasani
e11a346f1f Remove wifi/bt restrictions choice for limited users
Bug: 8631653

Make "Unknown sources" visible but disabled if restricted for limited user.
Bug: 8629605

Also show the restriction name as the dialog title in the picker.

Change-Id: I8d6ea3571bcc4372347cad6a2c982f35afa7cc09
2013-04-16 15:39:47 -07:00
Amith Yamasani
9517b02d43 Disable apps that require an account on a limited user
If an app is marked as requiring an account to work, disable that app
and show a message in the summary.

Also, implement graying out of icons for deselected apps.

Bug: 8600261
Change-Id: I9cf48832675c24257e09addad4316249082c30fb
2013-04-12 17:56:34 -07:00
Amith Yamasani
35f0237871 Merge "Embed the app restrictions fragment in the dual-pane settings." into jb-mr2-dev 2013-04-12 17:58:03 +00:00
Amith Yamasani
cc395695fc Embed the app restrictions fragment in the dual-pane settings.
Change the limited user creation flow to show the usual message before
actually adding the user. Might need to customize the message for limited
users.

Removed the old activity wrapper and moved the logic to UserSettings.

Removed the finish button.

Bug: 8566751
Change-Id: Ie9e1a03736c41758b0bb6e79d004ad662a5af7f4
2013-04-11 18:21:07 -07:00
Amith Yamasani
d8b0d0ed8e Make sure Settings app restrictions show up
Inadvertently disabled that in the previous change where we would
skip apps that were required but had no restrictions entries.

Bug: 8520185
Change-Id: Idc1808e489f7b6da267f68a2c7cef81cc351d2d0
2013-04-11 11:12:35 -07:00
Amith Yamasani
d81a3f7368 Improve app list for limited users
Show all activities in the same package with a master/slave relationship,
toggling all when the master is toggled.
Don't show required apps that have no restrictions.
Show apps that are only installed on the target user.

Bug: 8520813 lowercase app names
Bug: 8520185 apps installed only in limited user
Bug: 8567000 strange behavior with apps that have two launcher icons
Change-Id: Id8ab296c13202735a9534f918bd81ea4b4c14b46
2013-04-10 21:59:18 -07:00
Amith Yamasani
80b1dfe46a Merge "Select text in user name dialog" into jb-mr2-dev 2013-04-10 00:29:12 +00:00
Amith Yamasani
583757908b Select text in user name dialog
Enables quickly changing the name without moving the cursor.
Also use cap words style.

Bug: 8518507
Change-Id: I6841cad221b56bb4c3d51c21d30b3858d1ee3e1c
2013-04-09 17:26:43 -07:00
Amith Yamasani
872d4fba77 Send app restrictions broadcast to stopped apps as well
Otherwise the restrictions won't be shown for apps that haven't been
launched yet.

Bug: 8577600
Change-Id: I1d0d93553456dfedfb749e3d8262911af4362a80
2013-04-09 11:05:18 -07:00