Commit Graph

9007 Commits

Author SHA1 Message Date
Neil Fuller
68f666693a Add (disabled) time zone update system server impl
This commit builds on top of prior API commits. It
adds code to the system server, but in a disabled way.

The system server is responsible for monitoring two
(configured) package names: one for the "updater app"
(provided by the platform) and one for the "data app"
(provided by the OEM). When either package changes
the updater app is triggered via a privileged
intent.

The updater is then required to communicate with the
data app and report back to the system server.

Unit tests are included for the major components.

To run:
make -j30 FrameworksServicesTests
adb install -r -g "out/target/product/angler/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
adb shell am instrument -e package com.android.server.timezone -w com.android.frameworks.servicestests \
    "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Test: See above.
Bug: 31008728
Merged-In: I8f82cdcc2b574778a7e0d0184270f305b69ee17b
Change-Id: I8f82cdcc2b574778a7e0d0184270f305b69ee17b
2017-05-04 19:46:47 +01:00
Neil Fuller
bede17c216 Time zone update API classes
Time zone update API classes. Currently hidden but they
will go on to be unhidden in future.

This forms the basis of client and system server code to
support time zone updates.

Tests can be run with:

make -j30 FrameworksCoreTests
adb install out/target/product/angler/data/app/FrameworksCoreTests/FrameworksCoreTests.apk
adb shell am instrument -e package android.app.timezone \
    -w com.android.frameworks.coretests \
    "com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner"

Bug: 31008728
Test: See above.
Merged-In: I668bc8ac0cb78f3d4d9a4b7ad6ac1534b88af833
Change-Id: Icde574f8974152617a1f7ac9fa225bd5011dcce1
2017-05-04 12:32:53 +01:00
Nathan Harold
4fdc7d5ddd Merge commit 'ce073d70bedc' into stage-aosp-master
Change-Id: I319034a5b77de5cf71de0e110bb17819fb907f1b
2017-03-29 16:04:31 -07:00
Nathan Harold
1afbef40c6 Add a Skeleton IpSecService
-Add IpSecService with the necessary glue to connect to netd
-Add code to retrieve IpSecService from System Server

Bug: 34811227
Test: Service boots (and dumpsys works), more via b/34811227
Merged-In: I4cdcb643421141202f77a0e2f87a37012de0cd92
Change-Id: I4cdcb643421141202f77a0e2f87a37012de0cd92
2017-03-29 11:31:27 -07:00
Calin Juravle
8a4afd3dad Merge changes from topic 'dex'
am: f665781c74

Change-Id: I31c202a56d8f92634cc1d5d84106e27cb8c23bfd
2017-03-29 01:27:37 +00:00
Calin Juravle
a9f46f76af Register secondary dex files for JIT profiling
Test: boot, and check that profiles get recorded for secondary dex files

Bug: 32871170
Bug: 26719109

(cherry picked from commit f5a7bfc8d5)

Merged-In: I2de23ef44eee3f1783ae698821f1c6d88c66c9a6
Change-Id: Id9bbd630b8485dc17eeef846295458df5cfe446a
2017-03-28 16:00:21 -07:00
Calin Juravle
d9732c8dbb Move DexLoadReporter out of LoadedApk
The DexLoadReporter was part of LoadedApk in order to lazily initialize
it when the first class loader of the app was created. However there's
no real association between the two and doing the initialization in
LoadedApk buys us nothing.

Extract the reporter in its own class and set it to BaseDexClassLoader
during bindApplication stage.

Test: boot, and check that loaded dex files are reported

Bug: 32871170
Bug: 26719109

(cherry picked from commit 37dfc8ee3e)

Merged-In: I9a0e734ae4c16d5d0979aa6d0061fbc9b6e144f6
Change-Id: I9a0e734ae4c16d5d0979aa6d0061fbc9b6e144f6

# Conflicts:
#	core/java/android/app/LoadedApk.java
2017-03-28 13:37:15 -07:00
liangweikang
79e9f380e2 Merge "[BUG] fix NullPointerException in Notification.java"
am: c14d5db093

Change-Id: Ib1c17e2fe5f36e0230845ca123b0cd2cb7365154
2017-03-17 14:51:58 +00:00
liangweikang
63b03b573f [BUG] fix NullPointerException in Notification.java
https://code.google.com/p/android/issues/detail?id=252835

Test: null

Change-Id: I6c575686c75b02ac938f35622b522fff25403c29
Signed-off-by: liangweikang <liangweikang900911@gmail.com>
2017-03-17 02:59:49 +00:00
Calin Juravle
b1818b8a36 Merge "PackageManager: Clean up code related to foreign dex use"
am: eef66fd0c7

Change-Id: I443f001c15daddd63a17685c2e82fc9a619c45ee
2017-03-07 21:23:03 +00:00
Calin Juravle
4c06f55f14 PackageManager: Clean up code related to foreign dex use
We simplified the way we track whether or not a dex file is used by
other apps. DexManager in the framework keeps track of the data and we
no longer need file markers on disk.

Test: device boots, foreign dex markers are not created anymore

Bug: 32871170

(cherry picked from commit 74f0a3450c)

Change-Id: I2a9daca15e5120518852584fa17aa94012af8f1a
Merged-In: I3660e2f3913a73904181449c2d910af0a0477950
2017-03-07 11:39:24 -08:00
Dimitry Ivanov
029170ee2b Merge "Add isBundled argument to LoadedApk.makePaths call"
am: 0743d56e2b

Change-Id: I74deae8126109555bbbe57983ffd6a22ab50e303
2017-02-23 23:30:16 +00:00
Dimitry Ivanov
484fbe9273 Add isBundled argument to LoadedApk.makePaths call
There is a disconnect between the way webview created
classloader and the way makePaths decides if paths are
intended for bundled app.

This change moves decision making out of makePaths method
which allows WebViewZygote to pass correct argument and
have makePath omit java.library.path for libPaths

Bug: http://b/35426785
Test: manual
Change-Id: Iab5a18c0091d0193dafa750498eb00f378411ba0
(cherry picked from commit 638d810099)
2017-02-23 14:16:45 -08:00
Leonard Mosescu
5d2af16008 Merge "Add missing break statement." am: 7a4b88de49
am: 080456edd6

Change-Id: I2acd644f0bb5916f9c90a1103b023544a7eebddb
2017-02-17 20:34:48 +00:00
Leonard Mosescu
456d5fc159 Add missing break statement.
It was caught in the code review after the merge (thanks Narayan!).
This is already fixed and tested in the internal branch (see Merged-In)

Test: manual, CTS in internal

Change-Id: I9f6f72995e9ab633564b6bc22846fbe99eb65105
Merged-In: If14126e645b2d0a1307404e2f50088b3994abce2
2017-02-17 10:10:55 -08:00
Leonard Mosescu
de021d8162 Merge "Adding "attach-agent" to ActivityManagerShellCommand" am: 05dfd10254 am: db0803b4e8
am: 7bf598cbd9

Change-Id: If7b73860cc8249b997d5e9a7a4d149732b08449b
2017-02-16 23:37:48 +00:00
Leonard Mosescu
7bf598cbd9 Merge "Adding "attach-agent" to ActivityManagerShellCommand" am: 05dfd10254
am: db0803b4e8

Change-Id: I4493e6b3bd2cf8447e8c3043878ad0f531c0e677
2017-02-16 23:29:16 +00:00
Leonard Mosescu
02758a9a80 Adding "attach-agent" to ActivityManagerShellCommand
This new command is used to attach runtime agents to a running application:

attach-agent <PROCESS> <FILE>
   Attach an agent to the specified <PROCESS>,
   which may be either a process name or a PID.

Test: m test-art-host, manual testing:
    . invalid syntax, missing arguments
    . invalid syntax, extra arguments
    . invalid numeric PID
    . invalid process name
    . valid process, not debuggable
    . valid process, missing agent
    . valid process, valid agent

Bug: 31682382

Change-Id: I61cc8bf20addb1702acc8e7aae65b2f9ed7c5ca0
Merged-In: Ife88dbf23991dde7945d9208e54cd014bb7ecdc6
2017-02-16 13:19:41 -08:00
Philip P. Moltmann
b02f8eb241 resolve merge conflicts of d043a840f7 to nyc-mr2-dev-plus-aosp
Test: Clean merge
Change-Id: Ib2420ff793fdf22fd80cfaed7848ff6b8be8d382
2017-02-14 09:51:16 -08:00
Philip P. Moltmann
d043a840f7 Merge "[DO NOT MERGE] Revert "[DO NOT MERGE] Delay SharedPreferences.apply() by 50 ms"" into nyc-mr2-dev 2017-02-14 16:03:32 +00:00
Philip P. Moltmann
755d78dbd9 [DO NOT MERGE] Revert "[DO NOT MERGE] Delay SharedPreferences.apply() by 50 ms"
This reverts commit 2fc44947dd.

Bug: 30662828
Change-Id: Ia22343c19e155555dff3b0cb58f7b58df0ce6301
2017-02-13 23:44:31 +00:00
Rubin Xu
6ee5a0c8a5 Merge "Fix uri permission grant on remote bug report uri" into nyc-dev am: 42f2e80293 am: 824c8284ce am: 72074e3ab9 am: f85a20702a
am: 060cde9802

Change-Id: Ic591b48e298823b46f8d1fc25b0e01a82cc263b5
2017-02-10 12:32:48 +00:00
Rubin Xu
060cde9802 Merge "Fix uri permission grant on remote bug report uri" into nyc-dev am: 42f2e80293 am: 824c8284ce am: 72074e3ab9
am: f85a20702a

Change-Id: I3861a5229fdb55f7dc7fd57e1706b34f9847d492
2017-02-10 12:28:56 +00:00
Rubin Xu
0f2c853889 Merge "Fix uri permission grant on remote bug report uri" into nyc-dev am: 42f2e80293 am: 824c8284ce am: 72074e3ab9
am: f85a20702a

Change-Id: If9e569ba66dc9e5876fab5ffd2a6c9b0a9fb923b
2017-02-10 12:28:47 +00:00
Rubin Xu
f85a20702a Merge "Fix uri permission grant on remote bug report uri" into nyc-dev am: 42f2e80293 am: 824c8284ce
am: 72074e3ab9

Change-Id: I1cd4db65e0fe8c92628f22f94fe937cf64f2da04
2017-02-10 12:24:43 +00:00
Rubin Xu
72074e3ab9 Merge "Fix uri permission grant on remote bug report uri" into nyc-dev am: 42f2e80293
am: 824c8284ce

Change-Id: If4dfa2d7af980c91ec3d3f8faa7e7f4a39350c82
2017-02-10 12:20:18 +00:00
Rubin Xu
824c8284ce Merge "Fix uri permission grant on remote bug report uri" into nyc-dev
am: 42f2e80293

Change-Id: Ic167e10a205b5c8f9df81cd20a6f08359d3807f4
2017-02-10 12:16:19 +00:00
TreeHugger Robot
42f2e80293 Merge "Fix uri permission grant on remote bug report uri" into nyc-dev 2017-02-10 12:11:00 +00:00
Jeff Sharkey
78f2e38a12 DO NOT MERGE. Grant MMS Uri permissions as the calling UID.
A recent security fix prevents the system UID from handing out Uri
permission grants directly from itself.  Instead, services need to
issue grants as the original calling UID to ensure that the caller
actually has access to the Uris.

Test: builds, boots, send/recv MMS works in primary/secondary users
Bug: 33231106
Change-Id: Ia9fe19843b52977c8a94ee5349b907beda1882fc
Merged-In: Ia9fe19843b52977c8a94ee5349b907beda1882fc
(cherry picked from commit 7ff418d9a9)
2017-02-09 18:03:18 +00:00
Jeff Sharkey
d94624347f DO NOT MERGE. Grant MMS Uri permissions as the calling UID. am: 3eddf40675 am: 14b308de91
am: 473b52eb62

Change-Id: Ic9afb12547b271de6e423601131605b0d930e10b
2017-02-09 17:42:09 +00:00
Jeff Sharkey
19fd8e3f06 DO NOT MERGE. Grant MMS Uri permissions as the calling UID. am: 3eddf40675
am: 14b308de91

Change-Id: I3ae65230058cd51b4efb06358dae35dce419c04b
2017-02-09 17:39:14 +00:00
Jeff Sharkey
473b52eb62 DO NOT MERGE. Grant MMS Uri permissions as the calling UID. am: 3eddf40675
am: 14b308de91

Change-Id: I428dcaa5e44364d30a51392c224ad68a6e455e2b
2017-02-09 17:37:44 +00:00
Jeff Sharkey
14b308de91 DO NOT MERGE. Grant MMS Uri permissions as the calling UID.
am: 3eddf40675

Change-Id: Ied7f446ac2e539654b9f7d5e1ab7cce8aec7390e
2017-02-09 17:33:43 +00:00
Rubin Xu
ca53b27c34 Fix uri permission grant on remote bug report uri
System server is no longer allowed to grant uri permission directly. As a result
we use grantUriPermissionFromIntent() to grant permission from the shell UID,
who is the owner of the bug report content.

Also fix a security bug where the broadcast to notify user consent of remote
bug report mismatches the <protected-broadcast> definition, causing it to be
sendable by anyone.

Bug: 34159108
Test: manual - Install TestDPC and request bugreport, try accept and decline
      once the report is ready (Bullhead).

Merged-In: I66e3f2a16d4547549f09d3c96d52aed2330caedf
Change-Id: I66e3f2a16d4547549f09d3c96d52aed2330caedf
2017-02-08 10:15:48 +00:00
Jeff Sharkey
a78841ebd4 DO NOT MERGE. Grant MMS Uri permissions as the calling UID.
A recent security fix prevents the system UID from handing out Uri
permission grants directly from itself.  Instead, services need to
issue grants as the original calling UID to ensure that the caller
actually has access to the Uris.

Test: builds, boots, send/recv MMS works in primary/secondary users
Bug: 33231106
Change-Id: Ia9fe19843b52977c8a94ee5349b907beda1882fc
(cherry picked from commit 7ff418d9a9)
2017-02-07 04:04:15 +00:00
Jeff Sharkey
3eddf40675 DO NOT MERGE. Grant MMS Uri permissions as the calling UID.
A recent security fix prevents the system UID from handing out Uri
permission grants directly from itself.  Instead, services need to
issue grants as the original calling UID to ensure that the caller
actually has access to the Uris.

Test: builds, boots, send/recv MMS works in primary/secondary users
Bug: 33231106
Change-Id: Ia9fe19843b52977c8a94ee5349b907beda1882fc
(cherry picked from commit 7ff418d9a9)
2017-02-07 01:23:32 +00:00
Pavel Grafov
c3beac34f6 Fix the documentation for SecurityLog.SecurityEvent.getData(). am: 739cda8f31 am: fca679ff74
am: 5a474b4930

Change-Id: If1731db386157b1f53c3a7bbe379299c1ada0ca9
2017-02-06 17:52:37 +00:00
Pavel Grafov
5a474b4930 Fix the documentation for SecurityLog.SecurityEvent.getData(). am: 739cda8f31
am: fca679ff74

Change-Id: Ic6e2aab590583c501fa74317ee614ab1ebaea378
2017-02-06 17:46:11 +00:00
Pavel Grafov
1bb00e0849 Fix the documentation for SecurityLog.SecurityEvent.getData(). am: 739cda8f31
am: fca679ff74

Change-Id: I9f02c30450e56b8f25bbbe4b1baa2381c84437c8
2017-02-06 17:46:09 +00:00
Pavel Grafov
fca679ff74 Fix the documentation for SecurityLog.SecurityEvent.getData().
am: 739cda8f31

Change-Id: I0c6f1271392bfc9cc8d253d5fa5e029213492b48
2017-02-06 17:41:08 +00:00
Philip P. Moltmann
416a36a83b [DO NOT MERGE] Delay SharedPreferences.apply() by 50 ms
am: 2fc44947dd

Change-Id: Ie0bb1c0c23928318cbaf3dc22ca0aa6761bbfa75
2017-02-02 19:21:40 +00:00
Pavel Grafov
739cda8f31 Fix the documentation for SecurityLog.SecurityEvent.getData().
If the payload contains more than one object, it is passed in Object[].

Change-Id: I28ca2ec35d920c644bdea13f15b2787ef3170310
Fixes: 34871284
Test: Read aloud, sounds good.
2017-02-02 12:47:53 +00:00
Philip P. Moltmann
2fc44947dd [DO NOT MERGE] Delay SharedPreferences.apply() by 50 ms
... so that multiple applies can be combined into a single write.

Do do this I replaces the executor in the QueuedWork by a more Android-y
handler.

Test: Ran shared preferences CTS tests. Looked at log and saw a lot of
      skipped writes

Bug: 33385963
Bug: 30662828

Change-Id: I8f33df717be7091532930ccf6ca8c48940e4edd4
(cherry picked from commit 3349644872)
2017-01-31 02:50:24 +00:00
Shukang Zhou
bb44e42de9 [Frameworks] Add an 'am' cmd option to enable streaming in profiling.
Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
    sampling/instrumention
    streaming/non-streaming
    'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Merged-In: I8a5136a1c7330c8260b7c6c8da63f42a73aee275

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
2017-01-30 13:07:40 -08:00
John Reck
6e4f930457 Merge "Fix a bunch of repeated reads of a ro.* property" am: 4265991701 am: e4c2e8f303
am: 3c2837e77e

Change-Id: Idbcb9dfeac57036d3621474ee65ba967cc7bc499
2017-01-27 23:05:52 +00:00
John Reck
3c2837e77e Merge "Fix a bunch of repeated reads of a ro.* property" am: 4265991701
am: e4c2e8f303

Change-Id: Id6af451556fde8eefac8076735e625911f8bf272
2017-01-27 23:02:41 +00:00
Treehugger Robot
4265991701 Merge "Fix a bunch of repeated reads of a ro.* property" 2017-01-27 22:49:04 +00:00
John Reck
ed065024a5 Fix a bunch of repeated reads of a ro.* property
SystemProperties.get() is not particularly fast,
especially if a string is returned. Since ro.* values
are unable to be changed, there's no need to
continously re-query them. Cache the value at
static init time to trivially fix this.

Test: refactoring CL.
Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec
(cherry picked from commit aa67f684ff)
2017-01-27 11:04:39 -08:00
Shukang Zhou
221e58fe95 Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling." am: e924640c4b
am: b0f03a64ea

Change-Id: I35fa80e43cd4f6af76099848714f838f217b7989
2017-01-27 19:01:44 +00:00
Paul Navin
dd91db5515 Add hidden API for whether permission review mode is on. am: 7b89a7b1f7
am: 7c230c6f3c

Change-Id: I89c9a580a96d0f69ed30cad9ec2e4f9c215a403b
2017-01-27 16:59:33 +00:00