Commit Graph

6357 Commits

Author SHA1 Message Date
Po-Chien Hsueh
2d204b3985 Merge changes from topic "dyn_system_ff"
* changes:
  Use setEnable() when there is an installed image
  Use gsid.isGsiEnabled to refine DynamicSystemService
  Use FeatureFlagPersistent to guard DynamicSystem
  Make feature flag settings_dynamic_system persistent
2019-04-03 07:55:55 +00:00
Howard Chen
72324e4eb1 Use gsid.isGsiEnabled to refine DynamicSystemService
* Add isEnabled
* Replace toggle with setEnable

Test: Compile passed
Bug: 125079548
Change-Id: I4931e6469388ea05194ba44ccb994f32c08ad40d
2019-04-03 07:53:50 +00:00
Amith Yamasani
282420fe7b Merge "Avoid elevating apps to high proc states on binding" 2019-04-03 05:50:28 +00:00
Po-Chien Hsueh
4167b42f89 Use FeatureFlagPersistent to guard DynamicSystem
Check persistent feature flag 'settings_dynamic_system' before
invoking the installation service. User can still use gsi_tool if
the device is unlocked.

Bug: 119647479
Test: Verified with 'adb shell am' and test app.
Change-Id: If2265d877bc7eedf9b7a107bba04d2e95cf1b89a
2019-04-03 10:29:31 +08:00
Joe Onorato
5da1b3dc05 Fix ConditionVariable.block to use elapsedRealtime.
System.currentTimeMillis() is NEVER okay to use to calculate a time delta.
The original spirit of this probably should have used SystemClock.uptimeMillis(),
but use SystemClock.elapsedRealtime because it's the same as
System.currentTimeMillis() in all the cases where System.currentTimeMillis() is
correct.

Test: Treehugger
Change-Id: Ib6e090425af83e7e822fb12814d87e8a37e2d2ac
2019-04-02 19:19:13 +00:00
Amith Yamasani
f235d0b53a Avoid elevating apps to high proc states on binding
For service and provider bindings from TOP and
FOREGROUND_SERVICE apps, don't elevate bound apps
to above BOUND_FOREGROUND_SERVICE.

For service bindings, it is possible to explicitly
request the binding to match the foreground app
such that the bound app can get similar privileges
of foreground permissions.

For instance, when a foreground service has a location
type, providers it binds to don't automatically get the
location privilege. On the other hand, sometimes apps
showing UI want to treat their dependencies also as if
they are showing UI.

This change does not affect the oom_adj calculation,
only the proc state calculation for bound processes.

New BIND_INCLUDE_CAPABILITIES flag can be used to restore old
behavior for bound services.

Introduces a new state PROCESS_STATE_BOUND_TOP

Bug: 128337543
Test: atest CtsAppTestCases:ActivityManagerProcessStateTest

Change-Id: I13733e7f43a78903299254bc110cd8f7a8db4c40
2019-04-02 10:27:03 -07:00
Cody Northrop
236b283b4e Merge "ANGLE: Allow libs from debug package" 2019-04-02 13:47:30 +00:00
Jeff Sharkey
68b3e186c2 Remove greylist of apps that gain legacy access.
Per design pivot, access to legacy behavior will be determined by
the new "allowExternalStorageSandbox" manifest flag.

Bug: 124818022, 129487770
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I169e5eb3612c23aad47204cde9ff263f9df6f8c1
2019-04-01 18:48:52 -06:00
Philip P. Moltmann
8f8cf3430b Merge "Remove dual storage permission model" 2019-04-01 23:45:23 +00:00
Philip P. Moltmann
129a0b0c5e Remove dual storage permission model
- Also remove typed media permissions
- Leave typed media app-ops

Bug: 129716569
Test: Used apps, looked at permissions in the UI
Change-Id: If7714fb1a6955584157e1a60ab72b09e35287827
2019-04-01 16:30:11 -07:00
TreeHugger Robot
ddc438d13d Merge "Update javadoc on BatterySaverPolicyConfig" 2019-04-01 22:09:19 +00:00
Makoto Onuki
c458c07dd3 Update javadoc on BatterySaverPolicyConfig
Change-Id: I21a536a603174ee859b49689f4a16184adab6813
Fix: 129473934
Test: Treehugger
2019-04-01 12:56:27 -07:00
TreeHugger Robot
cb91b276f3 Merge "Making Battery Saver policy setting more defensive." 2019-03-29 23:30:16 +00:00
Cody Northrop
dc2fd94628 ANGLE: Allow libs from debug package
Add a new setting that allows a developer to specify where
to load ANGLE libraries from, rather than the default location.
This is only allowed for apps that are dumpable, i.e. can have
libraries injected.  That includes debuggable, profileable,
and root.

To use the new setting:

  adb shell settings put global angle_debug_package <package>

This allows a developer to build an APK directly from Chromium
and use it with a production build of Android. It will override
pre-installed system packages and updates.

Note: Use of ANGLE Developer Options UI will cease to function
until the debug package is uninstalled.

Bug: 80239516
Test: Apply setting, see new ANGLE used
Test: cts-tradefed run singleCommand cts -m CtsAngleIntegrationHostTestCases

Change-Id: Ib3b1fb52c0eb669e7ea931959a73aba2bd15bedf
2019-03-29 15:50:06 -06:00
Kweku Adams
c1d844a52b Making Battery Saver policy setting more defensive.
1. Making a full copy of the config Builder's map so that changing
the map in the builder doesn't change the config's map.

2. Ensuring that location mode and brightness adjustment factors are
within valid ranges.

Bug: 129474588
Test: manual
Change-Id: I6117b7857afa10d71c1fc3de818c51d8719a281b
2019-03-29 13:28:45 -07:00
Jeff Sharkey
65e18e43a2 Merge "Manifest flag for apps to request sandboxing." 2019-03-29 19:31:33 +00:00
Luke Huang
6764eff395 Merge "Use IDnsResolver instead of INetd for resolver related binder commands" am: b9ef4dd299 am: 1711278ce2
am: ceb74821a3

Change-Id: I2d642b71df25934fddd8a1476b5d27457628b8e2
2019-03-29 02:24:24 -07:00
Luke Huang
ceb74821a3 Merge "Use IDnsResolver instead of INetd for resolver related binder commands" am: b9ef4dd299
am: 1711278ce2

Change-Id: I80ae047bd65b654e01061a9f218be23e1e3ef2ed
2019-03-29 02:10:55 -07:00
Luke Huang
1711278ce2 Merge "Use IDnsResolver instead of INetd for resolver related binder commands"
am: b9ef4dd299

Change-Id: Icca07604bc8f922c51493e72fde8c7377105bf8b
2019-03-29 01:57:44 -07:00
Jeff Sharkey
bcff13c657 Manifest flag for apps to request sandboxing.
We're iterating on the design to let apps request via a manifest
flag if they'd like to opt-in or opt-out of storage sandboxing.  The
default is to assume that P apps don't allow sandboxing, and that
Q apps do allow sandboxing.

Bug: 129487770
Test: manual
Change-Id: I8fddb35eed412c78622be4ccae57c7b7d2aa1286
2019-03-28 14:34:47 -06:00
Jeff Hamilton
38d503fe46 Merge "Add an API to read experiment IDs." 2019-03-28 11:44:52 +00:00
Michael Wachenschwanz
2da219096a Merge "Limit broadcast rate for low priority DropBox entries" 2019-03-28 01:56:18 +00:00
Michael Wachenschwanz
fd6523ec54 Limit broadcast rate for low priority DropBox entries
DropBox entry spamming can negatively impact system and apps listening
to the ACTION_DROPBOX_ENTRY_ADDED broadcast.
Global settings with the DropBox tag prefix can now mark low priority
tags. Low priority tagged entries will have their
ACTION_DROPBOX_ENTRY_ADDED broadcast delayed and the broad cast will be
dropped in spammy situations.

Bug: 119132031
Test: atest CtsDropBoxManagerTestCases

Change-Id: I56554a15e0afb6e1686a33c59b3d6a8d426c2fc6
2019-03-27 13:58:20 -07:00
Jeff Sharkey
53b7e93cc3 Merge "Apps using storage must have runtime permission." 2019-03-27 19:56:51 +00:00
Jeff Hamilton
fa2f91c2fe Add an API to read experiment IDs.
Change the file format to store the
experiment IDs direclty so we don't
need to parse the proto when reading
the values out.

Bug: 129099771
Test: bit statsd_test:* && adb shell cmd stats pull-source 10051
Change-Id: I0dc1fd118f4d9ba597c2f0959648136bbafb5aab
2019-03-27 14:24:49 -04:00
Luke Huang
6591477a5b Use IDnsResolver instead of INetd for resolver related binder commands
migrate resolver related commands from INetd to IDnsResolver

Bug: 126141549
Test: atest FrameworksNetTests ConnectivityServiceTest Nat464XlatTest
      atest DnsManagerTest
Change-Id: I559c0c1304d53dde408c062e1a52e742595e7cbe
2019-03-27 17:39:07 +08:00
Joe Onorato
1c33a64705 Merge "incidentd can now handle multiple callers asking it for incident reports" 2019-03-27 04:06:06 +00:00
Po-Chien Hsueh
43037e40e7 Merge "Add a permission, INSTALL_DYNAMIC_SYSTEM" 2019-03-27 03:21:19 +00:00
Po-Chien Hsueh
f906e0e331 Merge "Improve javadoc for DynamicSystemClient" 2019-03-27 03:20:54 +00:00
Po-Chien Hsueh
244e560c09 Merge "Send URL using Uri instead of String" 2019-03-27 03:20:25 +00:00
TreeHugger Robot
dbc7083c06 Merge "GraphicsEnvironment: Allow profileable apps to load layers" 2019-03-27 00:47:21 +00:00
Jeff Sharkey
6fd6994cfc Apps using storage must have runtime permission.
A major goal of the Q release is to promote user transparency around
permission usage, and to also give user controls over those
permissions.  To further this goal, all apps requesting the
internal WRITE_MEDIA_STORAGE permission must also request (and be
granted) the "Storage" runtime permission in order to gain the
associated access.

If the user revokes the "Storage" runtime permission, then the app
must lose all access granted to it via WRITE_MEDIA_STORAGE.

Bug: 129144016
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I0e685136d2b823e618bbc85cc79e656c9d4aad38
2019-03-26 17:55:28 -06:00
Jeff Sharkey
02aefee533 Merge "Unify media permissions enforcement in framework." 2019-03-26 23:54:22 +00:00
Jeff Sharkey
859856d8d6 Unify media permissions enforcement in framework.
This opens the door to the same consistent logic being shared by
anyone across the OS who wants to enforce storage permissions.

Bug: 126788266
Test: atest --test-mapping packages/apps/MediaProvider
Exempted-From-Owner-Approval: Trivial permissions refactoring
Change-Id: I3107425f8dafa6ba05918bb67c3c0cb5d3899657
2019-03-26 23:54:08 +00:00
Cody Northrop
3832aa9906 GraphicsEnvironment: Allow profileable apps to load layers
Apps that allow themselves to be profiled locally are also eligible
to load layers, since they are set dumpable. They can opt in by
setting the following in AndroidManifest.xml:

    <!-- App opts-in to being profiled by the shell -->
    <application>
        ...
        <profileable shell=”true”/>
    </application>

Bug: 128637647
Test: atest CtsGpuToolsHostTestCases
Test: Modify CtsGpuToolsHostTestCases to use profileable="true"
      and ensure loading from external works.

Change-Id: Ib072d07408c2abd8fee7179fec3a0d28d72d6398
2019-03-26 15:42:54 -06:00
Joe Onorato
99598ee6ee incidentd can now handle multiple callers asking it for incident reports
Test: bit incident_test:* GtsIncidentManagerTestCases:*
Bug: 123543706
Change-Id: I9f671dd5d8b2ad139f952a23e575c2be16120459
2019-03-26 11:20:48 -07:00
Po-Chien Hsueh
d0f5ee6cef Merge "Pass exception detail to API user" 2019-03-26 06:54:19 +00:00
Daniel Rosenberg
3111cff3c7 Merge changes Iba026321,I31690e0b,If991c5b7
* changes:
  Make RescueParty not wipe if checkpointing
  Add Checkpoint's abortChanges
  Add needsCheckpoint
2019-03-25 21:17:09 +00:00
Daniel Rosenberg
8cbd24dda2 Make RescueParty not wipe if checkpointing
If we're checkpointing, we can roll back instead of wiping. If the
update was the problem, we will succeed. Otherwise, RescueParty will
catch the issue again and prompt the wipe later

Test: setprop persist.sys.enable_rescue 1
      Set device to not commit checkpoints
      vdc checkpoint StartCheckpoint 3
      reboot
      adb shell setprop debug.crash_system 1
      adb shell stop
      adb shell start
      Rescue Party causes reboot instead of wipe
      repeat without checkpointing to get wipe
Change-Id: Iba0263214baa7a0c3d5565b4393d03f975d8000a
2019-03-25 21:16:13 +00:00
Daniel Rosenberg
600799b8b4 Add Checkpoint's abortChanges
Test: Call abortChanges from the java side
Change-Id: I31690e0baa11b28fddcb5dd454a77067a60d2590
2019-03-25 21:16:01 +00:00
Po-Chien Hsueh
6762e2b661 Add a permission, INSTALL_DYNAMIC_SYSTEM
We already have a permission, MANAGE_DYNAMIC_SYSTEM, whose protection
level is signature. Only platform applications holding it can interact
directly with DynamicSystemService, a wrapper of native GsiService. In
our design, DynamicSystemInstallationService is the sole platform app
holding it.

Then we need another permission for non-platform but privileged apps.
This new permission doesn't give apps access to DynamicSystemService,
but only to system API DynamicSystemClient. DynamicSystemClient works
with underneath DynamicSystemInstallationService and allows privileged
apps to install DynamicSystem images and get status updates in our
designed manner.


Bug: 128982216
Test: verified using DynamicSystemClient.
Change-Id: I3e67322511e3ab08db87bfad40d8c3d3cf6fdfe5
2019-03-25 15:55:39 +00:00
TreeHugger Robot
4b58630ef2 Merge "Fixed a property naming mismatch." 2019-03-23 09:55:19 +00:00
TreeHugger Robot
66837a62b9 Merge "Code cleanup in ZygoteProcess.java." 2019-03-23 01:18:00 +00:00
Chris Wailes
da5b64e7f2 Fixed a property naming mismatch.
Device configuration properties in ZygoteConfig.java used old names for
certain values.  These name strings have been updated to the correct
values and additional logging has been added to help catch future
issues.

Test: m
Test: boot and check log for USAP messages
Change-Id: I2fb92afe7edd9b1254dd3be659ec5063aa0b8e16
2019-03-22 17:45:28 -07:00
Chris Wailes
6a17f8393e Code cleanup in ZygoteProcess.java.
Generic code cleanup.  Changed access scopes, replaced code with utility
functions, and outlined some code.

Test: m
Test: treehugger
Change-Id: I6d9a827abf88dc30eac611642723d69cb75bb351
2019-03-22 16:13:47 -07:00
Salvador Martinez
13bfe4a789 Merge "Update names of dynamic power saver mode APIs" 2019-03-22 20:52:13 +00:00
TreeHugger Robot
c396d6738c Merge "API review followup: DynamicAndroidClient" 2019-03-22 17:21:39 +00:00
Salvador Martinez
b85a9f8db4 Update names of dynamic power saver mode APIs
There was some confusion caused by the names so this CL
changes them to make the differentiation more clear hopefully.

Test: robotests pass, build runs, functionality of clients intact
Bug: 126944845
Change-Id: I626dd8e38c59fb5c061e4d0fdcf8c81701c459a3
2019-03-22 10:12:42 -07:00
Michael Wright
950bd77fb7 Move TEXT_HANDLE_MOVE and CLOCK_TICK to TEXTURE_TICK.
TEXTURE_TICK is a new constant that is expected to be called repeatedly
in order to simulate a texture effect when a user is interacting with
the device, like with TEXT_HANDLE_MOVE.

Bug: 111461797
Test: Manual
Change-Id: Ia21de3ce1755a908b4bd4fcbdda411864e5b9fe9
2019-03-22 14:38:01 +00:00
Michael Wachenschwanz
6fbea1744a Merge "Add EXTRA_DROPPED_COUNT for ACTION_DROPBOX_ENTRY_ADDED" 2019-03-22 03:20:37 +00:00