Bug: 64458884
Test: runtest -c com.android.server.NightDisplayServiceTest \
frameworks-services and manually tested Hawaii and London
Change-Id: I052034a4c64eb73c42672215e8847c11e00efeb5
(cherry picked from commit 2ce862c3ed)
Bug: 64458884
Test: runtest -c com.android.server.NightDisplayServiceTest \
frameworks-services and manually tested Hawaii and London
Change-Id: I052034a4c64eb73c42672215e8847c11e00efeb5
This change add one secure settings which is a key value list consisting
of 7 individual settings; it also provides a class to get these settings
and use the default values specified in default.xml file when the settings
are missing.
This is the first part of a 2 part change. A subsequent change will use
these settings in backup service manger for setting up backup frequency.
Test: This change builds. Manual tests will be included in part 2 of the
change.
Bug: 63351792
Change-Id: I62baddbf3e0b96af6b7de3dfdeac3479e5b3ded8
This action puts the phone into the state where it can only be unlocked
via the user's primary knowledge factor. In the future this can also
evict keys and otherwise secure the device beyond the norm in a sketchy
situation.
This is currently controlled Settings.Secure.LOCKDOWN_IN_POWER_MENU, it
can be enabled for testing via
`adb shell settings put secure lockdown_in_power_menu 1`
Bug: 37221346
Test: Manual
Change-Id: I6197fadf655e5298cab1ab95153c316b87f3b718
This cl creates AlwaysOnDisplayPolicy, which get values for the
following knobs(go/aod-experiments) from Settings.Global:
1. screen_brightness_array
2. dimming_scrim_array
3. prox_screen_off_delay
4. prox_cooldown_trigger
5. prox_cooldown_period
Also update code to make sure AlwaysOnDisplayPolicy is used
everywhere.
Bug: 64899561
Test: runtest -x AlwaysOnDisplayPolicyTest
Change-Id: I2e83ff980771e67177e4964bd83aa68b2bdca65f
When a carrier provides an "anchor" of data usage at a specific
moment in time, augment the network statistics used by warning/limit
thresholds and Settings UI. For example, if the OS measured 500MB
of usage, but the carrier says only 400MB has been used, we "squish"
down the OS measured usage to match that anchor.
Callers using the hidden API will have their data augmented by
default, and the public API offers a way to opt-into augmentation.
Thorough testing to verify behavior.
Test: bit FrameworksNetTests:android.net.,com.android.server.net.
Test: cts-tradefed run commandAndExit cts-dev -m CtsUsageStatsTestCases -t android.app.usage.cts.NetworkUsageStatsTest
Bug: 64534190
Change-Id: Id3d4d7625bbf04f57643e51dbf376e3fa0ea8eca
Currently, spell checker component can process requests only from the
foreground user's account and requests from background users are always
ignored. However, in order to fully realize the multi-user nature of
Android, most system services will need to truly support multiple users
simultaneously. With multi-user aware TSMS implemented, apps from
background users (other accounts and their work profiles) can also run
their spell checking jobs in batch, without the external device user
having to switch accounts for the spell checker to be enabled in that
account.
Bug: 63041121
Test: Manually as follows
Setup: Create a work profile and a secondary user
1. adb shell pm create-user --profileOf 0 --managed workprofile (userId 10)
2. adb shell am create-user seconrdaryuser1 (userId 11)
3. Build SampleSpellCheckerService, which is by default
direct-boot unaware.
package name: com.example.android.samplespellcheckerservice
APK name: SampleSpellCheckerService_DBUnaware.apk
4. Also build a custom SampleSpellCheckerService by explicitly
making '.SampleSpellCheckerService' direct-boot aware.
package name: com.example.android.samplespellcheckerservice2
APK name: SampleSpellCheckerService_DBAware.apk
5. adb install --user 0 -r SampleSpellCheckerService_DBUnaware.apk
6. adb install --user 10 -r SampleSpellCheckerService_DBUnaware.apk
7. adb install --user 11 -r SampleSpellCheckerService_DBUnaware.apk
8. adb install --user 0 -r SampleSpellCheckerService_DBAware.apk
9. adb install --user 10 -r SampleSpellCheckerService_DBAware.apk
10. adb install --user 11 -r SampleSpellCheckerService_DBAware.apk
11. make -j ApiDemos
12. adb install --user 0 -r $ANDROID_PRODUCT_OUT/data/app/ApiDemos/ApiDemos.apk
13. adb install --user 10 -r $ANDROID_PRODUCT_OUT/data/app/ApiDemos/ApiDemos.apk
14. adb install --user 11 -r $ANDROID_PRODUCT_OUT/data/app/ApiDemos/ApiDemos.apk
15. Make sure AOSP Keyboard (com.android.inputmethod.latin) is installed
for all users.
Test 1: Settings correctly updated for each user (Work profile's SC is
not bound to account and can be individually updated)
0. Complete Setup
1. adb shell am start-user 0
2. adb shell am start-user 10
3. adb shell am start-user 11
4. adb shell settings put --user 0 secure selected_spell_checker com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
5. adb shell settings put --user 10 secure selected_spell_checker com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
6. adb shell settings put --user 11 secure selected_spell_checker com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
7. adb shell settings get --user 0 secure selected_spell_checker
-> com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
8. adb shell settings get --user 10 secure selected_spell_checker
-> com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
9. adb shell settings get --user 11 secure selected_spell_checker
-> com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
10. adb shell settings put --user 0 secure selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
11. adb shell settings get --user 0 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
12. Repeat 8 & 9. Results should be the same.
13. adb shell settings put --user 10 secure selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
14. adb shell settings get --user 10 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
15. adb shell settings get --user 0 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
16. adb shell settings get --user 11 secure selected_spell_checker
-> com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
17. adb shell settings put --user 11 secure selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
14. adb shell settings get --user 11 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
14. adb shell settings get --user 0 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
15. adb shell settings get --user 10 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
16. adb shell am start-user 0
17. adb shell am start-user 10
18. adb shell am start-user 11
19. adb shell settings put --user 0 secure selected_spell_checker com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
20. adb shell settings put --user 10 secure selected_spell_checker com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
21. adb shell settings put --user 11 secure selected_spell_checker com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
Test 2: Basic functionality works (each user can use SC when they're at
the foreground) & background connections aren't broken
0. Complete Setup
1. Open "Api Demos" app for user 0
2. Go to Views/Text/EditText
3. Focus into the first EditText then type "aaa"
4. Focus into the second EditText then type "aaa"
5. adb shell dumpsys textservices --user 0
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
6. adb shell dumpsys textservices --user 10
-> make sure there are no active spell checker sessions.
7. adb shell dumpsys textservices --user 10
-> make sure there are no active spell checker sessions.
8. Repeat 7-10 for the work profile (userId 10)
9. adb shell dumpsys textservices --user 10
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
10. adb shell am switch-user 11
11. Repeat 7-10 (userId 11)
12. adb shell dumpsys textservices --user 11
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
13. adb shell dumpsys textservices --user 0
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
14. adb shell dumpsys textservices --user 10
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
Test 3: Background user can also call spell checker APIs
0. Complete Setup
1. adb shell pm install -r TestApp.apk
2. adb shell am switch-user 11
3. adb shell am start --user 11 -n com.example.gulizseray.testapp/com.example.gulizseray.testapp.MainActivity
4. adb logcat | grep spellcheckerclient
-> Periodically calls spell checker APIs and prints results
5. adb shell dumpsys textservices --user 11
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
6. Adb shell am switch-user 0
7. adb logcat | grep spellcheckerclient
-> Continues to periodically call SC APIs and print results
8. Open "Api Demos" app for user 0
9. Go to Views/Text/EditText
10. Focus into the first EditText then type "aaa"
11. Focus into the second EditText then type "aaa"
12. adb shell dumpsys textservices --user 0
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
13. adb shell dumpsys textservices --user 11
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
Test 4: Package updates for all unlocked users (not just foreground user) are tracked properly (New package added/removed from owner, profile, secondary users)
0. Complete Setup
1. adb uninstall --user 0 com.example.android.samplespellcheckerservice
2. adb shell dumpsys textservices --user 0
-> Make sure com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
does not exist in the list
3. adb shell settings get --user 0 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
4. adb uninstall --user 10 com.example.android.samplespellcheckerservice
5. adb shell dumpsys textservices --user 10
-> Make sure com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
does not exist in the list
6. adb shell settings get --user 10 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
7. adb uninstall --user 11 com.example.android.samplespellcheckerservice
8. adb shell dumpsys textservices --user 11
-> Make sure com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
does not exist in the list
9. adb shell settings get --user 11 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
10. adb install --user 0 -r out/target/product/generic/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
11. adb shell dumpsys textservices --user 0
-> Make sure com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
is in the list
12. adb shell settings get --user 0 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
13. adb install --user 10 -r out/target/product/generic/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
14. adb shell dumpsys textservices --user 10
-> Make sure com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
is in the list
15. adb shell settings get --user 10 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
16. adb install --user 11 -r out/target/product/generic/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
17. adb shell dumpsys textservices --user 11
-> Make sure com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
is in the list
18. adb shell settings get --user 11 secure selected_spell_checker
-> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
Test 5: SpellCheckerBindGroups will be cleared when the corresponding
app is killed.
0. Complete Setup
1. Open "Api Demos" app for user 0
2. Go to Views/Text/EditText
3. Focus into the first EditText then type "aaa"
4. Focus into the second EditText then type "aaa"
5. adb shell dumpsys textservices --user 0
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
6. Kill Api Demos
7. adb shell dumpsys textservices --user 0
-> make sure there are no active spell checker sessions.
8. Repeat 1-7 for work profile (user 10)
9. adb shell am switch-user 11
10. Repeat 1-7 for secondary user (user 11)
12. adb shell pm install -r TestApp.apk
13. adb shell am start --user 11 -n com.example.gulizseray.testapp/com.example.gulizseray.testapp.MainActivity
14. adb shell dumpsys textservices --user 11
-> make sure 'com.example.android.samplespellcheckerservice'
is serving spell checker sessions.
15. adb shell am switch-user 0
16. adb shell am force-stop com.example.gulizseray.testapp
17. adb shell dumpsys textservices --user 11
-> make sure there are no active spell checker sessions.
Change-Id: I06c27ef834203a21cc445dc126602c799384527b
API council have requested a manifest constant be added
to the SystemApi directly in preference to an indirect
SystemApi constant here:
android.provider.TimeZoneRulesDataContract.READER_PERMISSION.
This is the third of three changes to (1) add the new constant,
(2) switch over code using the constant, (3) remove the old
constant.
Bug: 64568899
Test: None, build only
Change-Id: I75731b13ce2046556d6148aa5707cab6ed9cf9bf
(cherry picked from commit db57c03434)
API council have requested a manifest constant be added
to the SystemApi directly in preference to an indirect
SystemApi constant here:
android.provider.TimeZoneRulesDataContract.READER_PERMISSION.
This is the third of three changes to (1) add the new constant,
(2) switch over code using the constant, (3) remove the old
constant.
Bug: 64568899
Test: None, build only
Change-Id: I75731b13ce2046556d6148aa5707cab6ed9cf9bf
Performing the auto delete based on the PhoneAccount of the new entry.
This ensures no one CS can cause the removal of entries by another.
Test: Manual
Bug: 38196259
Merged-In: I382cb62a1b2b7e482c49ece05f90fc982b797add
Change-Id: I382cb62a1b2b7e482c49ece05f90fc982b797add