We used the system proterties as a shared memory mechanism
to propagate information to local settings caches when the
content has changed and the cache should be cleared. The
system properties are unfortunately updated asynchronously
leading to cases where clients may read stale data.
This change adds a simple int array data structure backed
by shared memory which guarantees individual values are
atomically read and updated without memory tear. Multi-
index opearations are not synchronized between each other.
The settings provider is using the new data structure to
propagate the settings generation which drives when caches
are purged.
We have a single memory array keeping the generation for
different settings tables per user. Since memory array is
not a compact data structure and the user space exceeds
the memory array size we use an in-memory map from keys
to indices in the memory array where the generation id of
a key is stored. A key is derived by the setting type in
the 4 most significant bits and the user id in the 28 least
significant bits.
The mapping from a key to an index is cleared if the user is
removed and the corresponding index in the memory arry is
reset to make it available for other users. The size of the
memory array is derived from the max user count that can be
created at the same time.
bug:18826179
Change-Id: I64009cc5105309ef9aa83aba90b82afc8ad8c659
We shouldn't profile *any* packages loaded by the system_server, not
just the system_servers own ("android") package.
bug: 28241500
Change-Id: I5f3f477b40c758030a5bdc8e97d17cab6e68e204
Changes the policy for selecting packages which will be pre-verified
during post-OTA boot animation.
For Nx to Ny, an app is pre-verified if used in the foreground in the
last 7 days, or if its APK was loaded by other apps.
For M to N (or early N builds without detailed stats), an app is
pre-verified if it has any recorded use in the last 7 days.
Bug: 27902702
Bug: 27350503
Change-Id: I2b38daf017ecd0e5aa5ed596ed9351cffa03dbcb
Data directories for all packages should be created and managed by
installd; if we create a Context and the data directory doesn't exist
yet, we're in trouble, since a later mkdirs() would end up creating
the directory with incorrect permissions, mode, and SELinux labels.
Bug: 28272737
Change-Id: Ie3bb884ab07748719378de5c792046a031a3f945
Place helper map for callback field names into a holder. This avoids
the reflective calls in static initialization of ConnectivityManager
in the common (non-debug) case, which means the class can be
compile-time initialized. Also saves the storage necessary (both
the storage array as well as the reflection metadata).
Follow-up to fcfa7d921a.
Bug: 27265238
Change-Id: Ib4bfaf27acd234a035a5d198458340099a156a4c
Currently the output is not very interesting, looking like:
ConnectivityMetricsEvent(1461591945223, 4, 5): Bundle[mParcelledData.dataSize=340]
ConnectivityMetricsEvent(1461591945289, 0, 2048): android.net.metrics.NetworkEvent@b76cd61
ConnectivityMetricsEvent(1461591945296, 4, 5): Bundle[mParcelledData.dataSize=340]
ConnectivityMetricsEvent(1461591945299, 0, 3072): android.net.metrics.DefaultNetworkEvent@e2f3086
ConnectivityMetricsEvent(1461591945527, 0, 2051): android.net.metrics.ValidationProbeEvent@884ad47
but at least it's better than nothing, and event logger users can
always implement a better toString method on their events.
This is only enabled if --events is passed into the dump.
Bug: 28204408
Change-Id: Ife96b8d54e5e91317d86b622d5efc29724969f63
To support moving DownloadManager, add new JobScheduler network type
constraint that matches "any network except roaming." Also add an
API to get a specific JobInfo by ID.
Since the default network can be different on a per-app basis, and
individual apps may be blocked due to app standby, evaluate job
connectivity constraints on a per-UID basis. To implement this
cleanly, add NetworkInfo.isMetered() to match the isRoaming() API.
Add new DownloadManager APIs to support charging and device idle
constraints, which are plumbed through to JobScheduler under the
hood when scheduled.
Add filtering to JobScheduler dumpsys to omit noisy details for
packages the caller isn't interested in.
Bug: 28098882, 26571724, 19821935
Change-Id: I09ca7184ef7ce6adba399f579d415a5fb2ea6110
The PackageInstaller app manages side-loading apps as well
as permission management. It should be updatable, hence
should rely on system APIs to talk to the platform. This
is the first step of defining an API boundary.
Change-Id: I9814eafd0b22ae03b4b847a7007cdbf14c9e5466
Prevent *any* WebView provider packages to be downgraded lower than MonoChrome
Stable on the system image.
Assuming that all (and future) WebView provider packages follow the same
versionCode scheme, we can compare the subsection of Chromium versionCode that
contains branch number, which is done by ignoring the least significant 5
digits.
Note this CL is a follow-up to go/ag/895502.
BUG: 27469181
Change-Id: Iffe3c4b7f912d48c034f107079e065e54130713f