36 Commits

Author SHA1 Message Date
Sudheer Shanka
28537b6ae9 Don't limit RetailDemoModeService to start only during demo mode.
- Update RetailDemoModeService to not do anything outside demo mode.
- Add am command get-started-user-state which is needed for cts tests.
- Update unit tests for RetailDemoModeService.

Bug: 31342350
Test: adb shell am instrument -e class com.android.server.retaildemo.RetailDemoModeServiceTest -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: Idf50512facd27d47d7111e75cbc2f7b260f49740
2016-09-30 10:29:26 -07:00
Suprabh Shukla
cd47cec57d Added test for enabling wifi for demo user
Earlier change to resolve merge conflicts was breaking the current test
because mocked context was used to get wifi manager. Mocking wifi
manager to fix the test and added a check that setWifiEnabled is called
when wifi is not already on.

Test: adb shell am instrument -e class
com.android.server.retaildemo.RetailDemoModeServiceTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Bug: 31833031
Change-Id: Idd123d50df6ee6db51417645fc877abebe555dc0
2016-09-29 19:06:31 -07:00
Suprabh Shukla
d912d9357d resolve merge conflicts of eb0ac0b to master
Change-Id: Icf47e79b8635c17554957678626ceef6539e3ad7
2016-09-26 16:08:29 -07:00
Suprabh Shukla
7f6a7bc75a Enabling wifi on new demo session
A customer may switch off wifi in a retail environment, which will lead
to no internet connectivity in the following sessions, which is not
desirable. Fixing it by enabling wifi at the beginning of every new demo
session.

Bug: 31689469
Change-Id: Ie7eb17bfe8fbee185d5bfe6ac7a590ca5dabdc29
2016-09-23 14:14:41 -07:00
Sudheer Shanka
d9fcb69b81 Add unit tests for RetailDemoModeService.
Bug: 30571518
Change-Id: I33b1ae9f22a609088c0ad0cd247fe91ccc23bdaa
2016-08-18 18:49:29 -07:00
Suprabh Shukla
925a30e82b Changing user inactivity and warning dialog timeouts
am: cafdc2e50d

Change-Id: Iba74fd833ba00cbae39e09cf404f1877efd7a4d8
2016-08-16 00:32:55 +00:00
TreeHugger Robot
f5e51cf7a9 Merge "Changing user inactivity and warning dialog timeouts" into nyc-mr1-dev 2016-08-16 00:21:35 +00:00
Suprabh Shukla
cafdc2e50d Changing user inactivity and warning dialog timeouts
Increasing the inactivity timeout to 90 seconds to accomodate the longest
app. demo video for retail. Also, removing the warning dialog by setting
the countdown timeout to 0, so it can be re-enabled by overriding the value
through gservices if needed.

Bug: 30426773
Bug: 30866394
Change-Id: I6735943adfaf3d210ed9eb9163b5c7ce8dcf53ec
2016-08-15 15:48:48 -07:00
Fyodor Kupolov
4f4780f023 Count failed install as finished
Otherwise DEMO_USER_SETUP_COMPLETE will not be set.

Bug: 30445353
Change-Id: Id2a0c1b1643dd9846328a20f4c67e11e69b3bc84
2016-08-15 15:29:47 -07:00
TreeHugger Robot
a4b89c054c Merge "Correctly handle a case when there are no preloaded apps" into nyc-mr1-dev 2016-08-04 20:53:59 +00:00
Fyodor Kupolov
49726b1115 Use Settings.Global.putInt for PACKAGE_VERIFIER_ENABLE
Bug: 30644237
Change-Id: I891cd3b73e47c851cc512a8e768ebd7061c950d9
2016-08-03 19:05:25 -07:00
Fyodor Kupolov
28ba2898ce Correctly handle a case when there are no preloaded apps
Bug: 30415696
Change-Id: Ia1cff342ff7000da3fba580083116441f478491e
2016-08-03 13:50:37 -07:00
TreeHugger Robot
77faae7282 Merge "Cache package names after reboot" into nyc-mr1-dev 2016-07-29 20:23:44 +00:00
Fyodor Kupolov
773e997432 Cache package names after reboot
In case of a reboot mApkToPackageMap becomes empty, but packages can still
be installed in user 0. We need to repopulate the cache again.

Bug: 30280710
Change-Id: Ia18e93c351b5af80de434e8c5311b961b314a9fb
2016-07-28 19:53:19 -07:00
Suprabh Shukla
323d2bbc34 Ensuring KeyguardService has the correct user when it starts
Because RetailDemoModeService was switching user before KeyguardService
was started, KeyguardViewMediator was missing the call to setCurrentUser
on user switch. Setting the current user from keyguardState in
onServiceConnected, if there was a user switch that happened earlier.
Also changed RetailDemoModeService to switch user after it receives boot
phase BOOT_COMPLETE.

Bug: 30038980
Change-Id: I142570529097199ccc50849297ae67ca49d35534
2016-07-28 16:16:53 -07:00
Fyodor Kupolov
51ce8ee3b1 Set secure setting when all preloaded apps are installed
Bug: 30280710
Change-Id: Id87b51c53b1e553a6ab0a257be93baf7d31b6fe5
2016-07-28 13:22:26 -07:00
Amith Yamasani
8c8d752851 Merge "Allow calling in demo mode" into nyc-mr1-dev 2016-07-21 00:21:13 +00:00
Suprabh Shukla
707a9fc002 Setting a system property when device goes into demo mode
Need a system property so that init can listen to changes to
it and restrict the battery driver from charging the battery beyond
an optimal charge level when the device is in retail demo mode

Bug: 30230924
Change-Id: I277acf27a442ec8f37aac2b01a1a8e0164947a45
2016-07-19 18:30:29 -07:00
Amith Yamasani
bc26f5fb6a Allow calling in demo mode
Allow outgoing calls, but clear the call log when
the next demo session starts so that the next
customer doesn't see any residue.

Fixes: 30220132
Change-Id: Ice71ba750f43fb31bf657d6ae31da62abbd72cfc
2016-07-19 18:20:12 -07:00
TreeHugger Robot
f61eb922f9 Merge "Disallow safe boot when in demo mode" into nyc-mr1-dev 2016-07-13 23:45:39 +00:00
TreeHugger Robot
55c7c9c2d4 Merge "Fix disabling lockscreen for demo users." into nyc-mr1-dev 2016-07-13 22:00:38 +00:00
Fyodor Kupolov
4e416e9f0c Disallow safe boot when in demo mode
Bug: 30038636
Change-Id: I70624bff85f5fb012772422f0fff523dab6e9be1
2016-07-13 14:08:30 -07:00
TreeHugger Robot
0ce03e77bc Merge "Disallowing bluetooth config for demo users" into nyc-mr1-dev 2016-07-13 20:15:31 +00:00
Sudheer Shanka
b6ed667f04 Fix disabling lockscreen for demo users.
LockSettingsService cleans up data for an user on receiving
ACTION_USER_ADDED. As a result, the value set by the
RetailDemoModeService was getting lost.

Bug: 29912660
Change-Id: I2414a5586ab0187bc003cd6ee8b9f1645406235f
2016-07-13 11:58:37 -07:00
Suprabh Shukla
db8c1dbc5e Disallowing bluetooth config for demo users
Bluetooth is currently not multi-user aware, so bluetooth pairings are
carrying across demo users. Have to disable bluetooth config to prevent
security risks in retail environments.

Bug: 30039481
Change-Id: I28ad0d9585a4e6e22af8772132d585c01b33abc9
2016-07-12 15:35:47 -07:00
Fyodor Kupolov
33dc61f50e Cleanup whole preloads directory
When leaving SUW, cleanup preloads directory, not just demo dir.

Bug: 29908713
Change-Id: Id94e6df619f5ca6585b2a0edb0f1028364431f95
2016-07-11 14:40:29 -07:00
TreeHugger Robot
33fa5dfa1d Merge "Making timeouts configurable through Settings" into nyc-mr1-dev 2016-07-08 14:36:34 +00:00
Suprabh Shukla
dbbc7af063 Making timeouts configurable through Settings
Adding a global setting for timeouts used in retail demo mode.
Also renaming the protected intent ACTION_RESET_DEMO to reflect proper
owner package.

Bug: 29917613
Change-Id: I9a174503626ab28cceb5024a8e63d27612439b92
2016-07-07 14:12:14 -07:00
Fyodor Kupolov
56d32190e0 Install preloaded apps into the demo user
Apks preloaded in /data/preloads/apps are now automatically installed when
device is running in demo mode.

Apps are also installed into system user, so that they can be cached for
the next demo user session.

Bug: 29908713
Change-Id: If0fb45bb31c169a1e3020621a173867b8530532d
2016-07-06 18:36:31 -07:00
Amith Yamasani
0f6c2bfe30 Merge "Log as histogram instead of counter" into nyc-mr1-dev 2016-07-06 18:09:55 +00:00
Sudheer Shanka
c46098b243 Grant location permission to camera app.
Change-Id: I9c73a0232e9fdc7043321b35a2721603dced8789
Fixes: 29911953
2016-07-01 18:19:00 -07:00
Amith Yamasani
48e819bfd8 Log as histogram instead of counter
Log the demo session duration as a histogram.

Bug: 29540372
Change-Id: Ie4b1bd5586316213d0ae9167f30d6d551e3e0fe8
2016-06-30 16:42:09 -07:00
Suprabh Shukla
408e0d50bd Disabling account modification on demo users
Added user restriction DISALLOW_MODIFY_ACCOUNTS on demo users

Bug: 29910166
Change-Id: I21c9534a3ae66dc3ab650e2d1a45a65cc8ffbd2a
2016-06-30 16:38:08 -07:00
Suprabh Shukla
0271fd661d Improving the Reset Demo Warning dialog
Removing explicit call to setView which was distorting the layout
of a standard AlertDialog. Used the correct unicode characted for
apostrophe. Also removed calls to enable demo mode launcher for user 0.

Bug: 29520255
Change-Id: Id876f01f8e51c02634c03fce1ea93a15b111fc27
2016-06-28 16:48:34 -07:00
Amith Yamasani
b75fc2b2b7 Add tron logging for retail demo session counters
Count each demo user creation and time between
first touch (to dismiss the video) and the start
of inactivity timeout.

Fixed an NPE in SysUI when user switcher is missing.

Bug: 29540372
Change-Id: I7bc0e0dde75e7b213a025683c15c9b3e750643a9
2016-06-27 11:15:38 -07:00
Suprabh Shukla
6472501f2e Resetting some settings on starting a new demo session
Muting ringer and media volume and turning off the flashlight
before starting a new session. Also, resetting the configuration of any
new demo user to the configuration of user 0 on the device. Moved
RetailDemoModeService and RetailDemoModeServiceInternal to more
appropriate new packages

Bug: 29519612
Change-Id: Ib65f89ce61afab2d2f1b2dd0c761f5d35a466181
2016-06-23 17:36:19 -07:00