Commit Graph

5673 Commits

Author SHA1 Message Date
Sudheer Shanka
dcd0b0abde Merge "Delete package sandbox data when it is uninstalled." 2018-10-10 21:00:04 +00: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
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
Mathew Inwood
db0657a4f4 Merge "Move some members to the "Q blacklist"." 2018-09-14 13:54:28 +00:00
Mathew Inwood
8c854f86a4 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
2018-09-14 13:18:34 +01:00
Jeff Sharkey
7da7681c6b Merge "Provide paths of interest to vendors." 2018-09-13 21:19:14 +00:00
Jeff Sharkey
e0339a6f6e Merge "Support more createPackageContextAsUser() users." 2018-09-13 20:08:57 +00:00
Jeff Sharkey
70eb34a23c Provide paths of interest to vendors.
Also update docs on path translation APIs, which are now no-ops.

Bug: 112159421
Test: none
Change-Id: I0912a6adb233b39f61728642fcefb83a74fa6662
2018-09-13 12:04:38 -06:00
Jeff Sharkey
8068dfe6be Merge "Utilities for content:// Uris and file modes." 2018-09-13 15:20:59 +00:00
kopriva
2c23a6b58d docs: fixed typo am: 9b5c03973e
am: 05f984a1a8

Change-Id: I8b70d412c1d422be5cbc8e041acc3fe340617181
2018-09-13 02:41:16 -07:00
kopriva
05f984a1a8 docs: fixed typo
am: 9b5c03973e

Change-Id: I8873ab4139dd3c073584a0ffaf67611c11dea084
2018-09-13 02:31:56 -07:00
Hui Yu
fc451f44dc Check Bundle length is aligned by 4 when readFromParcel.
Otherwise throw an IllegalStateException.
Fix: 26885514
Test: Make the bundle length not aligned by 4 and observe the IllegalStateException.

Change-Id: I57f0d5babdf1b8f1074eb2f4f76b71926db8b93c
2018-09-12 14:16:54 -07:00
Jeff Sharkey
ec5f7d1625 Support more createPackageContextAsUser() users.
We created this API to make it easy to pass a given UserHandle into
all Managers obtained from a given Context, which works great for
"normal" users, but we should also support special users like ALL
and CURRENT.

Also add an AutoCloseable marker to make try-with-resources easier.

Bug: 112153259
Test: atest android.content.cts.ContextTest
Change-Id: I261dfcc5cfdfc76bda5d70181785e11c2715a558
2018-09-12 14:02:11 -06:00
Jeff Sharkey
63280e06fc Utilities for content:// Uris and file modes.
Bug: 111268862, 111960973
Test: atest cts/tests/tests/content/src/android/content/cts/ContentUrisTest.java
Test: atest frameworks/base/core/tests/coretests/src/android/os/FileUtilsTest.java
Change-Id: I94373055468d279e6553d4a038267732b9b53745
2018-09-12 12:35:52 -06:00
Mike Ma
43908f112b Merge "Avoiding potential NPE when dumping to proto." am: a52b601ef3
am: 8964390dd3

Change-Id: Ie9dc401990b4267b9bcf0469a3526db93dc438d2
2018-09-11 18:47:58 -07:00