Commit Graph

11903 Commits

Author SHA1 Message Date
David Brazdil
61c4d63c98 Merge "Show a warning toast/dialog when an app uses hidden APIs" am: fbef950d95
am: d750a7c68c

Change-Id: I9b62537d76e4ceb7ce03ca4de5ccf5a182c4439c
2018-01-25 22:32:28 +00:00
Andreas Gampe
d6e151c469 Merge "ActivityManager: Add support for agents on startup" am: d5cba89b98
am: ebc0afd811

Change-Id: Ie8b991014a43ca4fba83aeab3ba826996d2813df
2018-01-25 22:10:27 +00:00
David Brazdil
d750a7c68c Merge "Show a warning toast/dialog when an app uses hidden APIs"
am: fbef950d95

Change-Id: Icab7166bf83d2920c8d3f22774eafa4aea9fdaa4
2018-01-25 22:01:49 +00:00
Andreas Gampe
ebc0afd811 Merge "ActivityManager: Add support for agents on startup"
am: d5cba89b98

Change-Id: Iee82ac1a08183857ea4fcf2d67b99dede5d5a2ae
2018-01-25 21:50:42 +00:00
David Brazdil
fbef950d95 Merge "Show a warning toast/dialog when an app uses hidden APIs" 2018-01-25 19:53:13 +00:00
Andreas Gampe
5b495d54d3 ActivityManager: Add support for agents on startup
Add setAgentApp similar to setDebugApp. If given, attempt to attach the given
agent during handleBindApplication.

The flow needed a slight refactor. It is not possible to do a debuggability
check at setAgentApp time (without checking all installed apps). Instead,
when a ProfilerInfo contains an agent, perform a debuggability check then.
This is consistent with how setDebugApp works.

Expose through the shell command:

  cmd activity set-agent-app process agent

Add CTS coverage.

Bug: 69929492
Test: m
Test: m cts
Test: cts-tradefed run commandAndExit cts-dev -m CtsJvmtiAttachingHostTestCases
Change-Id: I65e869debd45e6073f9ab21cb9de9c9deb828a2e
2018-01-24 17:48:02 -08:00
David Brazdil
927d6de11f Show a warning toast/dialog when an app uses hidden APIs
Check VMRuntime.hasUsedHiddenApi() on each Activity start and show
a toast/dialog urging the user to check logcat.

Test: manual
Bug: 64382372
Change-Id: Ida8a6ed9ab9b56a76882501b2a3473a5f1448cb3
2018-01-24 19:57:18 +00:00
Felipe Leme
e14921216a Merge "DO NOT MERGE - fix AFM.getComponentNameFromContext()" into oc-mr1-dev
am: 2eeab61b4c

Change-Id: Idda0d7fbc0f63bcbad44da6a46cef786770a2851
2018-01-23 21:46:43 +00:00
TreeHugger Robot
2eeab61b4c Merge "DO NOT MERGE - fix AFM.getComponentNameFromContext()" into oc-mr1-dev 2018-01-23 21:39:09 +00:00
Lorenzo Colitti
ce9b009827 Merge changes from topic "multipath-datausage-backport" am: df984fae26
am: c46c21c702

Change-Id: I45f0c69e3440e9ec69c82e81c41bea682a359389
2018-01-23 19:43:13 +00:00
Lorenzo Colitti
424fbdbd1e Add getDefaultNetwork to the NetworkStats public API. am: d5876bc438
am: 66eab17abc

Change-Id: If0aa0a4522df0061645d34cb3af8a33f288ed46d
2018-01-23 19:28:14 +00:00
Lorenzo Colitti
c46c21c702 Merge changes from topic "multipath-datausage-backport"
am: df984fae26

Change-Id: Ic29d71ade161434b6dea796a887f60b5587ca1d5
2018-01-23 19:17:54 +00:00
Lorenzo Colitti
66eab17abc Add getDefaultNetwork to the NetworkStats public API.
am: d5876bc438

Change-Id: Ifbe3d8ede39c87d64eee20adcfbdd92479d09e69
2018-01-23 18:50:20 +00:00
Lorenzo Colitti
d15c937f97 Support passing a template to NetworkStatsManager queries.
Currently, NetworkStatsManager queries and callbacks only allow
selecting network traffic based on network identifiers:
networkType, subscriptionId and networkId.  The code ends up
converting these into a template under the hood.

Now that templates can express more fine-grained queries (e.g.,
select only roaming traffic, or select only traffic that's not
on the default network) add a hidden method to pass in a
template. This should have no security implications, as all the
access controls are performed in NetworkStatsService.

Bug: 35142602
Test: android.app.usage.cts.NetworkUsageStatsTest passes
Change-Id: Iab4afa26b34544299d2a9c501c1b0feb470e90a9
Merged-In: Iab4afa26b34544299d2a9c501c1b0feb470e90a9
2018-01-23 18:38:48 +09:00
Lorenzo Colitti
d5876bc438 Add getDefaultNetwork to the NetworkStats public API.
This allows an app using the public API to know whether the
traffic in a particular bucket was on the default network
(i.e., the network was selected by the system), or not (i.e.,
the network was selected by the app).

Bug: 35142602
Test: builds, boots
Test: added coverage to NetworkUsageStatsTest CTS test, still passes
Change-Id: I9f6669908fa119743b9c0aa0c31a03e5ebafa7db
Merged-In: I9f6669908fa119743b9c0aa0c31a03e5ebafa7db
2018-01-23 18:28:07 +09:00
Felipe Leme
b25b4736db DO NOT MERGE - fix AFM.getComponentNameFromContext()
This method broke on O-MR1 when I3abf999eb6056c1df7982780bae43b58337c0668
was chery-picked from master.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases \
      -t android.autofillservice.cts.AttachedContextActivityTest#testAutofill
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Also individually ran tests that failed (due to flakiness) when ran in a suite:

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases \
-t android.autofillservice.cts.OptionalSaveActivityTest#testDontShowSaveUiWhenUserManuallyFilled_oneDatasetAllRequiredFields

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.PreSimpleSaveActivityTest #testTapLink_tapBack_thenStartOverBySayingYesAndManualRequest

Fixes: 71960322

Change-Id: Ia093dcefe6699dc9493c46d671e48c2000214b31
Merged-In: I3abf999eb6056c1df7982780bae43b58337c0668
2018-01-22 16:29:23 -08:00
Andreas Gampe
9853a65386 Merge "ActivityThread: Attempt to attach agent with app's classloader" am: f779d7e3be
am: 9f1f950c31

Change-Id: I0df113aff5a54c5a1dbc5f968679bb9d4f8ea158
2018-01-16 19:59:02 +00:00
Andreas Gampe
9f1f950c31 Merge "ActivityThread: Attempt to attach agent with app's classloader"
am: f779d7e3be

Change-Id: Id5ae3b90ca4b75046419fb1a6c02ef556d225f77
2018-01-16 19:46:36 +00:00
Andreas Gampe
ab8a63be6a ActivityThread: Attempt to attach agent with app's classloader
Try to use the app's (main) classloader when an attach-agent request
is handled. If that fails, retry without a classloader.

Add bind-application-time flag to ProfilerInfo. Use the flag to have
a second attach-agent point on app startup. Add --attach-agent-bind
to cmd activity start to expose the difference between pre-bind and
bind-time attaching.

Bug: 70901841
Test: m
Test: cts-tradefed run commandAndExit cts-dev -m CtsJvmtiAttachingHostTestCases
Change-Id: I21698ec3be43a6d095d577100b2adfb22daca7d5
2018-01-15 13:04:25 -08:00
Jeff Hamilton
2fd131b492 Merge "Minor LoadedApk refactoring." am: 6ca155f8c2
am: e6fee297a2

Change-Id: I919f7e7e11b64f6155919f7ea631f3f6fd84ce03
2018-01-12 21:43:44 +00:00
Jeff Hamilton
e6fee297a2 Merge "Minor LoadedApk refactoring."
am: 6ca155f8c2

Change-Id: I96fb0215bc09e2c190900be47dcca4de2c752d47
2018-01-12 21:30:13 +00:00
Jeff Hamilton
caf728ea26 Minor LoadedApk refactoring.
- Rename varaibles holding LoadedApk to make the code easier to read.
- Move resource creation into LoadedApk, consolidating the logic.

(cherry picked from commit 7541ca4d1a)

Test: manual
Merged-In: I6bdc70482fbbb346ff694ada528ded18d3a63ef7
Change-Id: I6bdc70482fbbb346ff694ada528ded18d3a63ef7
2018-01-12 11:05:50 -08:00
Andreas Gampe
07903b8ded Merge "Frameworks: Move SharedPreferencesImpl to tristate" am: 5edae415b0
am: 75dc3e9cf4

Change-Id: Ifbe406bda739b3689ca9ed95493a8eca7a9276ae
2018-01-12 02:42:43 +00:00
Andreas Gampe
75dc3e9cf4 Merge "Frameworks: Move SharedPreferencesImpl to tristate"
am: 5edae415b0

Change-Id: Idef313e1a0c1a69434783da2441a84aa6e12409e
2018-01-12 02:32:15 +00:00
Treehugger Robot
5edae415b0 Merge "Frameworks: Move SharedPreferencesImpl to tristate" 2018-01-11 23:52:46 +00:00
Jerry Zhang
68ad3d119c Merge "DO NOT MERGE: Add ScreenObserver" 2018-01-11 23:50:34 +00:00
Holly Jiuyu Sun
613e01227b Merge "Add EuiccCardManager and EuiccCardController." am: ec25ea1520
am: edc14bd3c4

Change-Id: I5ac16981ac7ca4d492387a340f10a34b8ab1d804
2018-01-11 23:11:05 +00:00
Jerry Zhang
1b4b3c4e9b DO NOT MERGE: Add ScreenObserver
ScreenObserver allows system components to
monitor the screen lock state.

Bug: 68054513
Test: manual
Change-Id: I50f4690f68443f676d17e93efb1b7cb0857abd9e
2018-01-11 19:38:27 +00:00
Holly Jiuyu Sun
3d6b53c075 Add EuiccCardManager and EuiccCardController.
EuiccCardManager is in the same path with EuiccManager.
EuiccCardController is in the same path with EuiccController.
Use getAllProfiles() as an example interface.
The implementation of EuiccCard and its content will be added in a
follow up CL.
The new API is marked as @hide and TODO for @SystemApi.

Bug: 38206971
Test: test on phone
Change-Id: I153937c0f79bdd1a00b06b234a6e254a3f43072c
Merged-In: I153937c0f79bdd1a00b06b234a6e254a3f43072c
2018-01-11 10:30:43 -08:00
Andreas Gampe
1aa0d01cc8 Frameworks: Move SharedPreferencesImpl to tristate
The code loading shared preferences from disk may throw in other
ways then a missing file, for example during an out-of-memory
situation. Ensure that waiters will be woken up, and propagate
the exception to the getters.

Bug: 67986472
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I56e47342111f1cb53c5817c0429af4a6787475a9
2018-01-05 18:02:30 -08:00
Andreas Gampe
3fcce9f251 Merge changes I872a81ae,I0b9e72d2 am: f30c2c02f0
am: 34445736d8

Change-Id: I506b0e29977f0fbb410066dea46c99f264e01028
2018-01-05 01:39:13 +00:00
Andreas Gampe
158bde462e Revert "Frameworks: Move SharedPreferencesImpl to Future"
This reverts commit 70b600d456.

In preparation for a different fix. There are too many loopholes
with updates vs commits.

Bug: 67986472
Bug: 71533447
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I872a81ae1a26e1f77aad2a52daf88e093a686ec6
2018-01-03 17:58:44 -08:00
Andreas Gampe
383f4f397b Revert "Frameworks: Silently ignore InterruptedException"
This reverts commit c8d5fc8572.

In preparation for different fix.

Bug: 67986472
Bug: 70122540
Bug: 71533447
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I0b9e72d271725e15c20b68de981303c96ac1bd2a
2018-01-03 17:58:39 -08:00
susanta.patra
acbb9830c1 Merge "Fixed create app shortcut text and icon alignment in RTL Language" am: 29f61c21f4
am: c1a2cd2175

Change-Id: Id0fc2be3255620089a632236af2997213a9d6003
2017-12-15 22:16:02 +00:00
Treehugger Robot
29f61c21f4 Merge "Fixed create app shortcut text and icon alignment in RTL Language" 2017-12-15 21:58:07 +00:00
Felipe Leme
a30443b141 Merge "Proper autofill fix to let phone process autofill Settings activity." into oc-mr1-dev
am: f2eddf8df9

Change-Id: I7603e96214ca4e97985b6678cb0e75b7e36d0880
2017-12-14 01:43:23 +00:00
Felipe Leme
92b5d2783a Proper autofill fix to let phone process autofill Settings activity.
Test: adb shell am start com.android.settings/.RadioInfo
Bug: 69981710
Fixes: 70506888

Change-Id: Id29bad2d20b621f7379eb6144c95dcc819949b3d
Merged-In: Id29bad2d20b621f7379eb6144c95dcc819949b3d
(cherry picked from commit 97f16a76db29269619d9a1b45d4cea49026a5b6a)
2017-12-12 19:36:07 +00:00
Felipe Leme
7c3716792a Merge "Make sure apps cannot forge package name on AssistStructure used for Autofill." into oc-mr1-dev
am: 613d0cd8fb

Change-Id: Iee0adf135a684e5338250628f35b754a3e69b3d0
2017-12-08 18:18:49 +00:00
Felipe Leme
23e61a9086 Make sure apps cannot forge package name on AssistStructure used for Autofill.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.VirtualContainerActivityTest#testAppCannotFakePackageName
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 69981710

Change-Id: Id6036cddb51dd8dd0c9128b7212d573f630d693f
Merged-In: Id6036cddb51dd8dd0c9128b7212d573f630d693f
2017-12-07 10:04:56 -08:00
susanta.patra
63c4f3318c Fixed create app shortcut text and icon alignment in RTL Language
The icon and text alignment was inconsistent in create app shortcut.

Test: 1. RTL language
      2. adb shell am start -n com.android.settings/com.android.settings.CreateShortcut
      3. Check the alignment
Bug: 70201173

Change-Id: Ib2be99fd6b5da5853acf34ade8e3b407164383aa
Signed-off-by: susanta.patra <susanta.patra@lge.com>
2017-12-05 15:44:26 +05:30
Andreas Gampe
d52c7c9206 Merge "Frameworks: Silently ignore InterruptedException" am: 7e717e09cd
am: a6c6c4f5d3

Change-Id: I737474738fa688d5bc651390409cbd792ffa7282
2017-12-05 02:43:53 +00:00
Andreas Gampe
a6c6c4f5d3 Merge "Frameworks: Silently ignore InterruptedException"
am: 7e717e09cd

Change-Id: I75da071918e7fc2e547df4e4d75121806c730ca2
2017-12-05 02:34:41 +00:00
Andreas Gampe
c8d5fc8572 Frameworks: Silently ignore InterruptedException
Apps seem to rely on this undocumented behavior so that the
threaded sync adapter doesn't crash an app. That's really
bad on the app side, but we will have to live with it.

Bug: 67986472
Bug: 70122540
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I1ee4dfba4ad29c4f66fa60d3c8f8a99900b3447a
2017-12-04 15:00:24 -08:00
Andreas Gampe
06bc6945df Merge "Frameworks: Move SharedPreferencesImpl to Future" am: aa3e9d351e
am: bd4b1bad48

Change-Id: I43c8231293f5e4349eaab6f4a8242892b3b2c726
2017-12-02 23:54:49 +00:00
Andreas Gampe
bd4b1bad48 Merge "Frameworks: Move SharedPreferencesImpl to Future"
am: aa3e9d351e

Change-Id: I2a47400d1e584aef1a16e05840ab964ca5735110
2017-12-02 23:45:54 +00:00
Andreas Gampe
9a612c734e Merge "Frameworks: Clean up SharedPreferencesImpl" am: 572f46a3ef
am: 70da38960c

Change-Id: Ia4c24c8cd6fbeb58a90d56319558fc3c78474c2b
2017-11-29 19:38:11 +00:00
Andreas Gampe
70da38960c Merge "Frameworks: Clean up SharedPreferencesImpl"
am: 572f46a3ef

Change-Id: I7b922f795283cefabf661e999e5a9897889fa287
2017-11-29 19:25:13 +00:00
Andreas Gampe
70b600d456 Frameworks: Move SharedPreferencesImpl to Future
The asynchronous loading code is not safe wrt/ exceptions. Instead
of adding a tri-state for loading, move the code to use a Future
for the map. This encapsulates the required wait & synchronization,
as well as propagating any exceptions.

Bug: 67986472
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I6616e8a05e64eb1cfe024cc3239a05847dfe1fab
2017-11-21 15:59:02 -08:00
Andreas Gampe
f78a51759b Frameworks: Clean up SharedPreferencesImpl
Clean up in preparation for an implementation change. Add missing
annotations. Rename inner lock to be uniquely named. Use the local
map instead of mMap in the commit logic.

Test: m
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: Id3a798732c83a4aa6487225e2375ade4985852e2
2017-11-21 15:34:05 -08:00
Philip P. Moltmann
7e37d48b0a Make SharedPreferences check with higher precision
When two processes modify shared preferences we use the timestamp to
figure out if the file was changes underneath. Do this with the highest
precision available (instead of sec) as before.

It would be possible to make the check more reliable by writing a unique
id to the shared pref file, but this would make this check much more
expensive in the common case that nothing changed. Considering that this
has not been a problem and we don't officially give any guarantee for
this sounds like a good middle-ground.

(cherry picked from commit ffe74357ae)

Merged-In: I04c96b6a946618d5599c26410c88d7cd654d31fb
Change-Id: I04c96b6a946618d5599c26410c88d7cd654d31fb
Test: SharedPreferencesTest
Fixes: 62949739
2017-11-20 10:01:08 -08:00