Commit Graph

5685 Commits

Author SHA1 Message Date
Cody Northrop
2653e624dc Revert "Rootless GPU Debug for GLES"
This reverts commit f41625936f.

Exempt-From-Owner-Approval: Reverting
Bug: 110883880
Test: Chrome no longer crashes
Change-Id: I70c9d4a0376b27059e7759e1b6283903c0cf168b
2018-10-12 21:34:15 +00:00
Nandana Dutt
d1773d6459 Merge "Add DumpstateOptions java implementation" am: 52502ef1a1 am: 8a9f23c8a1
am: 1d1184cf83

Change-Id: I556407ee455b92e3bae34dfa603e159b99f45080
2018-10-12 11:21:26 -07:00
Nandana Dutt
1d1184cf83 Merge "Add DumpstateOptions java implementation" am: 52502ef1a1
am: 8a9f23c8a1

Change-Id: I392c2c6bdb522efa708b82174debf3a18167c0bc
2018-10-12 11:07:59 -07:00
Marcin Oczeretko
4427272533 LooperStats - track time to message dispatch
Test: UT and manual
atest .../LooperStatsTest.java
Verified that adb shell cmd looper_stats dump produces data
with dispatch delay

Bug: 113651685

Change-Id: I44550f8c5d71848932733bd02016aa65ce7b75b3
2018-10-12 13:17:01 +01:00
Nandana Dutt
b3f7168136 Add DumpstateOptions java implementation
DumpstateOptions will be used to pass options to Dumpstate service
for specifying arguments for taking bugreports.

Test: m
Test: adb bugreport

Change-Id: I4dc9511f0be2f86239ea9094a3c527b6ce0d1d41
2018-10-11 17:05:35 +01:00
Anton Hansson
b32cb2a7d3 Merge "Tweak the getPartitions API" 2018-10-11 09:54:51 +00:00
Anton Hansson
81f76a0812 Tweak the getPartitions API
- Rename methods
- Annotate public APIs with @NonNull
- implement equals/hashcode

Bug: 117146036
Bug: 112584519
Test: atest BuildVersionTest
Change-Id: I0b55e7f8e240948e674a981b280d8c8c94de6f8e
2018-10-11 07:52:41 +00:00
Tor Norbye
757cc2cded Merge "Fix incorrect javadoc links" am: 0d954557a1 am: cd1c75ae4c
am: f2183961a9

Change-Id: Icf157b65308e7de18b51aec837b8c29baa5a1918
2018-10-10 23:22:18 -07:00
Tor Norbye
f2183961a9 Merge "Fix incorrect javadoc links" am: 0d954557a1
am: cd1c75ae4c

Change-Id: I6d8c44be9d156ac2b6a20d3d13972371ee4d741e
2018-10-10 17:20:42 -07:00
Cody Northrop
616d4f5697 Merge "Rootless GPU Debug for GLES" 2018-10-10 23:20:18 +00:00
Sudheer Shanka
dcd0b0abde Merge "Delete package sandbox data when it is uninstalled." 2018-10-10 21:00:04 +00:00
Cody Northrop
f41625936f Rootless GPU Debug for GLES
This commit adds the ability to enable debug layers for OpenGL ES.

Similar to Rootless Debug for Vulkan, layers can be loaded from the
APK or base directory of selected debuggable applications.

Layers will only be loaded when developers opt-in via settings for a
target application.

A separate application can now be specified as an additional location
for layer discovery.

Example usage:

  adb shell settings put global enable_gpu_debug_layers 1
  adb shell settings put global gpu_debug_app <target_app>
  adb shell settings put global gpu_debug_layers layer1.so:layer2.so
  adb shell settings put global gpu_debug_layer_app <layer_app>

Test: cts-tradefed run singleCommand cts -m CtsGpuToolsHostTestCases
Bug: 110883880
Change-Id: I16df1951be0c06c80a445991e3e6d1636222b17b
2018-10-10 14:50:25 -06:00
Philip P. Moltmann
e5e217dac2 Merge "Change DevicePolicyManager APIs as requested" 2018-10-10 19:50:06 +00:00
Irina Dumitrescu
c6426b0e41 Merge "Fix incorrect javadoc links" 2018-10-10 19:07:59 +00:00
Michael Groover
a28ad42768 Merge "Protect Device Identifiers behind priv permission and DO/PO checks" 2018-10-10 18:05:23 +00:00
Cody Northrop
70687b7783 Merge "Add ANGLE_ENABLED_APP to CoreSettings" 2018-10-09 21:43:59 +00:00
Michael Groover
6d20d75e9e Protect Device Identifiers behind priv permission and DO/PO checks
Bug: 110099294
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases \
      -t com.android.cts.devicepolicy.DeviceOwnerTest.testDeviceOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases \
      -t com.android.cts.devicepolicy.ManagedProfileTest#testGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsTelephonyTestCases -t android.telephony.cts.TelephonyManagerTest
Test: cts-tradefed run cts -m CtsPermissionTestCases -t android.permission.cts.TelephonyManagerPermissionTest

Change-Id: I3c82c53ec89cd17b34a61166ccc9e9747388efac
2018-10-09 13:44:02 -07:00
Philip P. Moltmann
0ada0a6044 Change DevicePolicyManager APIs as requested
This requires RestrictedLockUtils to change which then causes further
changes.

I left the old APIs available for non-system-api customers.

Test: RunSettingsLibRoboTests
Bug: 116798569
Change-Id: Id5384ee074bb245e615012b7e0d5298b8bf27ba4
2018-10-09 12:38:23 -07:00
Sudheer Shanka
584b068125 Delete package sandbox data when it is uninstalled.
Bug: 111890351
Test: manual
Change-Id: Ic4347744e849e6d7dbc026ebc2e8656b3f2d2ed0
2018-10-09 11:12:44 -07:00
Tor Norbye
33ca9122da Fix incorrect javadoc links
Test: make offline-sdk-docs
Bug: b/116163454
Change-Id: I579649fdef931f369f67d5208ee5a8fc92deb1b1
2018-10-08 21:58:58 +02:00
Tor Norbye
f8dc2d204c Fix incorrect javadoc links
Test: make offline-sdk-docs
Bug: b/116163454
Change-Id: I55de1f71d443713b033ee63fd191bd34b3a52fd2
2018-10-08 19:58:17 +00:00
Cody Northrop
deb432823c Add ANGLE_ENABLED_APP to CoreSettings
The way we were checking Settings was invoking a 2ms hit.

Move ANGLE_ENABLED_APP to CoreSettings, which are already
available to the ActivityThread, eliminating the hit.

Test: Verify developer option works as expected
Test: atest google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test
Bug: 117107368
Bug: 80239516
Change-Id: I3df4c3c43489a338b3631484a8811b38c4eff2e6
2018-10-04 23:05:26 +00:00
Chenjie Yu
e388e27e19 Merge "pull PowerProfile into statsd" 2018-10-03 23:28:10 +00:00
Jeff Sharkey
9bf8ba3c69 Merge "Improve docs for CE/DE usages." 2018-10-03 17:55:10 +00:00
Chenjie Yu
ab53020345 pull PowerProfile into statsd
pull constants from PowerProfile into statsd for power model
calculations. The data is mostly from power_profile.xml

power_profile {
  power_profile_proto {
    cpu_suspend: 5.734
    cpu_idle: 1.389
    cpu_active: 18.76
    wifi_controller_idle: 2.0
    wifi_controller_rx: 107.0
    wifi_controller_tx: 371.0
    wifi_controller_operating_voltage: 3700.0
    bluetooth_controller_idle: 0.01
    bluetooth_controller_rx: 8.0
    bluetooth_controller_tx: 7.0
    bluetooth_controller_operating_voltage: 3300.0
    modem_controller_idle: 105.0
    modem_controller_rx: 175.0
    modem_controller_tx: 176.0
    modem_controller_tx: 216.0
    modem_controller_tx: 300.0
    modem_controller_tx: 427.0
    modem_controller_tx: 604.0
    modem_controller_operating_voltage: 3700.0
    gps_signal_quality_based: 49.0
    gps_signal_quality_based: 11.0
    gps_operating_voltage: 3700.0
    screen_on: 178.708
    screen_full: 240.79
    audio: 75.6
    video: 50.93
    flashlight: 298.498
    camera: 1152.292
    battery_capacity: 3450.0
    cpu_cluster {
      cores: 2
      speed: 307200
      speed: 384000
      speed: 460800
      speed: 537600
      speed: 614400
      speed: 691200
      speed: 768000
      speed: 844800
      speed: 902600
      speed: 979200
      speed: 1056000
      speed: 1132800
      speed: 1209600
      speed: 1286400
      speed: 1363200
      speed: 1440000
      speed: 1516800
      speed: 1593600
      core_power: 11.272
      core_power: 14.842
      core_power: 18.497
      core_power: 22.518
      core_power: 25.967
      core_power: 31.694
      core_power: 37.673
      core_power: 42.859
      core_power: 46.872
      core_power: 57.92
      core_power: 67.561
      core_power: 76.303
      core_power: 87.613
      core_power: 97.045
      core_power: 109.544
      core_power: 122.054
      core_power: 136.345
      core_power: 154.435
    }
    cpu_cluster {
      id: 1
      cores: 2
      speed: 307200
      speed: 384000
      speed: 460800
      speed: 537600
      speed: 614400
      speed: 691200
      speed: 748800
      speed: 825600
      speed: 902400
      speed: 979200
      speed: 1056000
      speed: 1132800
      speed: 1209600
      speed: 1286400
      speed: 1363200
      speed: 1440000
      speed: 1516800
      speed: 1593600
      speed: 1670400
      speed: 1747200
      speed: 1824000
      speed: 1900800
      speed: 1977600
      speed: 2054400
      speed: 2150400
      core_power: 7.055
      core_power: 11.483
      core_power: 14.979
      core_power: 19.642
      core_power: 23.167
      core_power: 27.479
      core_power: 31.632
      core_power: 39.192
      core_power: 47.817
      core_power: 55.659
      core_power: 64.908
      core_power: 73.824
      core_power: 85.299
      core_power: 96.036
      core_power: 109.233
      core_power: 118.56
      core_power: 132.959
      core_power: 143.692
      core_power: 161.378
      core_power: 180.616
      core_power: 193.897
      core_power: 214.361
      core_power: 238.338
      core_power: 265.759
      core_power: 297.918
    }
  }
}

Bug: 113353350
Test: manual test on statsd
Change-Id: I1edd4db255c0440ddbff1d40e1515caaccbc73f8
2018-10-03 10:39:49 -07:00
Jeff Sharkey
3a6a61ef7e Improve docs for CE/DE usages.
Bug: 113343632
Test: none
Change-Id: Ia8bada986fdd69b20a574e2bf1e050f322ae56ec
2018-10-03 10:45:54 -06:00
Makoto Onuki
393253730a Merge "Clear calling identity before calling SysProp callbacks" 2018-10-03 15:50:01 +00:00
Makoto Onuki
f0cc59d695 Clear calling identity before calling SysProp callbacks
Test: boot, run any "setprop" on adb shell
Change-Id: I4aa16b60bfad9dfe3a64fa5a629caf83dce1c8bd
Fixes: 117105159
2018-10-02 16:00:56 -07:00
Salvador Martinez
bbd22043e0 Merge "Add new POWER_SAVER permission & update api" 2018-10-02 16:24:04 +00:00
TreeHugger Robot
e1251df8eb Merge "Device-wide unknown sources block option for DPC." 2018-10-02 13:07:25 +00:00
Irina Dumitrescu
4638edd79f Device-wide unknown sources block option for DPC.
This adds a new framework user restriction that can be used by the DPC
to block installs from unknown sources on all profiles of a device.

Test: Manual test, disallowing installs in TestDPC disables installing
unknown sources apps.
Bug: 111335021
Change-Id: Ib9fb672c5e5dea2ac63bf8cbd1b04484b12b4056
2018-10-01 21:45:00 +01:00
TreeHugger Robot
1ec3af056e Merge "Allow specifying ANGLE in manifest via meta-data" 2018-10-01 15:46:51 +00:00
Anton Hansson
acdc1133d6 Merge "Add per-partition build constants to Build class." 2018-10-01 15:42:55 +00:00
Courtney Goeltzenleuchter
f9151368ce Merge "Pass more ANGLE info from runtime" 2018-10-01 13:16:48 +00:00
Anton Hansson
91b54f17c6 Add per-partition build constants to Build class.
Expose the ro.<x>.build.fingerprint & time.utc constants.

Bug: 112584519
Test: manual test app calling getPartitions().
Test: atest BuildVersionTest
Change-Id: Ibec0012d5893e3eb325f46a04379718a11067fa1
2018-10-01 11:41:33 +01:00
Salvador Martinez
a80bbab54c Add new POWER_SAVER permission & update api
This CL adds a new privileged permission called POWER_SAVER that
will allow whitelisted packages to toggle battery saver on the
device. This can be done via PowerManager, where the API for
setting battery saver has been updated to accept calls from apps
with either DEVICE_POWER or the POWER_SAVER permission.
Additionally, we whitelist Turbo for the permission.

Test: Framework builds, Turbo can toggle EBS
Bug: 115524274
Change-Id: I49d9747b2d42f792a2f3ba90a15aa23c47e489b3
2018-09-28 14:25:25 -07:00
Sudheer Shanka
3bc4ab482b Merge "Bind mount pkg specific dirs in the zygote child namespaces." 2018-09-28 20:34:02 +00:00
Cody Northrop
841c3d9baa Allow specifying ANGLE in manifest via meta-data
This CL allows the application's manifest to specify whether
to use ANGLE or native drivers for GLES via meta-data.

To enable, place the following within <application> and it
will be detected by the platform:

    <meta-data
        android:name:"com.android.angle.GLES_MODE"
        android:value:"angle" />

The manifest can also specify "native" to opt-out of
ANGLE, but native will be the default for Q release.

This method is in service of the tech preview of
ANGLE for Android. For Q release, we should move this
to the Android API.

Test: Manual, verify ANGLE can be selected or rejected
Change-Id: I41af7fe02ca6237db042b5f8bdfbab3c9f76078a
(cherry picked from commit a2e5faf4b23bf0b8b84ffc1d67d545e3dd4f8c63)
2018-09-28 08:24:13 -06:00
Cody Northrop
eb0ca8e593 Pass more ANGLE info from runtime
In order to facilitate ANGLE selection logic in the backend, we need to
start sending more information from GraphicsEnvironment.  This includes
the application name, whether the developer opted in, and the list can
be expanded.  We also have to send the ANGLE namespace unconditionally
in case the application opts in programmatically.

Bug: 80239516
Test: Manual build, booted clean, ensured developer opt-in still works.
Change-Id: I3b8f99942999de6a3188d2e61355dcd244f9191e
(cherry picked from commit 261dfbd814bf62caaee11e6ebe4e2e61e28f4919)
2018-09-28 08:24:12 -06:00
Cody Northrop
73c050422f Create ANGLE namespace in GraphicsEnvironment
This commit does the following:

* Create a new Android Setting for use during development,
  "angle_enabled_app", which can be used to load ANGLE
  only for specified applications.

  Usage:
    adb shell settings put global angle_enabled_app <package-name>

* When the package name condition is met, build a namespace
  that points to the ANGLE APK.  The namespace will be used
  by the EGL Loader to find ANGLE libs.

* The APK may be the pre-installed version in /system/app/ANGLE,
  or it may be an updated version from the Play Store, which will
  reside somewhere under /data/app/*.

Test: Manual

Change-Id: Ia0475cf80cf5c2589e52fdb3c8f3672696357923
2018-09-28 08:24:12 -06:00
Sudheer Shanka
3f0645ba83 Bind mount pkg specific dirs in the zygote child namespaces.
- Also update vold to create sandboxes for secondary storage devices.
- Since bind mounts are created in the process specific namespaces, we
  don't need /mnt/storage anymore which we were using it to prevent
  some bind mounts from propagating onto /mnt/runtime/write.
- Create bind mounts for {media,obb} dirs similar to data dir in
  per process namespace.
- Also fix a bug where we are not passing correct packages to vold when
  a new user starts.

Bug: 111890351
Test: manual
Change-Id: I1abbafabc58993860305e5a928c980420f89f289
2018-09-27 14:43:45 -07:00
Jeffrey Vander Stoep
60871d841d Merge "Add ConnectivityManager.getConnectionOwnerUid()" am: f8529dc891 am: 6729107f22
am: 904252f7a3

Change-Id: I8b8f6e74abc47f94231f3b9a1ab0db1ad0903a10
2018-09-21 15:36:28 -07:00
Jeffrey Vander Stoep
904252f7a3 Merge "Add ConnectivityManager.getConnectionOwnerUid()" am: f8529dc891
am: 6729107f22

Change-Id: I4ec4b9a8954deec001841566e0722caa1a3fa248
2018-09-21 14:48:32 -07:00
Tianjie Xu
58e024b33e Merge "Remove the metrics report in recovery system" am: aff3248507 am: 8deaf75cfd
am: acae1964ed

Change-Id: I9b61608bb34fd5658dcb2893296a04cdf4a98006
2018-09-21 14:12:30 -07:00
Jeffrey Vander Stoep
f8529dc891 Merge "Add ConnectivityManager.getConnectionOwnerUid()" 2018-09-21 21:04:20 +00:00
Jeff Vander Stoep
0ac2c0945b Add ConnectivityManager.getConnectionOwnerUid()
Allow VPN apps to lookup the UID owner of a network connection.

Requires specifying the:
 - IP address and port for both the source and destination of a TCP
   connection.
 - IP address and port for either source and destination or just
   source for a UDP connection.
Only TCP and UDP protocols are supported. Only connections for UIDs
that apply to the calling VPN app will be resolved. This is intended
to replace direct app access to /proc/net/{tcp,tcp6,udp,udp6}.

The implementation uses netlink inet_diag sockets[1] to perform
the lookup on TCP sockets as well as UDP sockets when supported
(kernel has CONFIG_INET_UDP_DIAG=y).

[1] http://man7.org/linux/man-pages/man7/sock_diag.7.html

Bug: 9496886
Bug: 109758967
Test: atest HostsideVpnTests
Test: atest InetDiagSocketTest on Taimen with CONFIG_INET_UDP_DIAG
    and on Sailfish without CONFIG_INET_UDP_DIAG.
Change-Id: I2bbc7072dd091e2e653dadf6dc05024c04180f34
2018-09-21 06:16:09 +00:00
Tianjie Xu
acae1964ed Merge "Remove the metrics report in recovery system" am: aff3248507
am: 8deaf75cfd

Change-Id: Id480a047be0799d6afc7cda472b6d4e00b48ec48
2018-09-20 23:01:09 -07:00
Tianjie Xu
aff3248507 Merge "Remove the metrics report in recovery system" 2018-09-20 17:39:36 +00:00
Marcin Oczeretko
ec7587283f Add work source uid collection to LooperStats
Add ThreadLocalWorkSourceUid and Message.workSourceUid
which will store the UID which caused, directly or
indirectly, the Message to be enqueued.

This was needed because using Binder.getCallingUid() does
not give us enough data since quite a few Binder services
call Binder.clearCallingIdentity() when processing the
call.

Test: UT and manual
Change-Id: I35af3a9ca5193477070990b41ff5d9c52f420069
2018-09-20 10:52:08 +01:00
Chenjie Yu
12e5e6755f use custom Parcel format to pull data
When statsd pulls data from StatsCompanionService, the data is put into
log_msg format on java side and expanded into LogEvent on cpp side.
There is a lot of dependency on log_msg and liblog to add new types.
There is pending bug to rewrite thta part of the code in statsd to
completely rid the legacy of logd and liblog. But that may not happen
soon.

Now we can support new storage type.
Also no need to specify number of fields in StatsLogEventWrapper cstr,
which is a source of bug in P.

Bug: 115775035
Test: manual test and cts test
Change-Id: Id1f0b033885da6f3bcebe043968061821db48f35
2018-09-18 16:29:52 -07:00