66965 Commits

Author SHA1 Message Date
Treehugger Robot
6078bc1602 Merge "Resolve NPE and unexpected error code in AccountManagerServiceTest" 2018-08-16 18:25:56 +00:00
Michael Groover
ccf15f79f0 Resolve NPE and unexpected error code in AccountManagerServiceTest
ag/3915086 modified AccountManagerService to use the PackageManagerInternal returned from
LocalServices. However when AccountManagerServiceTest runs tests against AccountManagerService
it is using a local instance of the object which does not have access to system's local
PackageManagerInternal. To resolve this a mock PackageManagerInternal is added to the LocalServices
with a mocked hasSignatureCapability that returns an appropriate response based on the test. This
fix also exposed an issue that appears to be introduced by ag/2959363; with the change in
checkKeyIntent to no longer throw a SecurityException the expected return code for error paths
is now AccountManager.ERROR_CODE_REMOTE_EXCEPTION.

A small change was also added to AccountsDbTest to skip testCeNotAvailableInitially on eng builds
as the Log.wtf would crash the test process when invoked on eng builds.

Test: adb shell am instrument -w -e package com.android.server.accounts \
      com.android.frameworks.servicestests/\
      android.support.test.runner.AndroidJUnitRunner
Bug: 80380639

Change-Id: I9438550d1c19cc86ec56991da766d71e068784ab
Merged-In: I9438550d1c19cc86ec56991da766d71e068784ab
2018-08-16 17:59:45 +00:00
Treehugger Robot
ce7e53a943 Merge "Update docs and ensure PHONE_STATE is more predictable for unknown numbers." 2018-08-16 15:22:23 +00:00
Tyler Gunn
b8bd19ed45 Update docs and ensure PHONE_STATE is more predictable for unknown numbers.
In P the PHONE_STATE broadcast behavior changed due to new permission
requirements.  Updating the API docs for this broadcast to make it more
clear to developers how the broadcast will work given different permission
scenarios.

Also, made a minor change to how the "EXTRA_INCOMING_NUMBER" is populated
on the phone state broadcast.  Originally we opted to remove
EXTRA_INCOMING_NUMBER when the number is empty.  Developer feedback reveals
it is difficult to know for an unknown caller (where numer is empty)
whether the broadcast they're receiving is the one associated with the
broadcast for receivers with READ_CALL_LOG, or the one for receivers
without it.  This minor change eliminates the need to count broadcasts and
instead allows the developer to just focus on whether the extra is present
or not.

Test: make docs and verify the javadoc appears as expected.
Test: Used test app to confirm functionality.
Bug: 110190165
Merged-In: I55e3519fcbad4dcb7da041d0194bf4e1c7d38949
Change-Id: I35967d53274b99d66b63f4ff5acb60a689745f9d
2018-08-16 07:33:38 -07:00
Treehugger Robot
d5dc5a7168 Merge "Simplify IWeaver mocking code." 2018-08-15 17:31:57 +00:00
Luke Huang
3b9ae0ae48 Merge "Clatd-related commands porting" 2018-08-15 03:38:50 +00:00
Treehugger Robot
c5797b0745 Merge "Use seInfo to label secondary dex files" 2018-08-14 20:43:00 +00:00
Nick Kralevich
005f959c5b Use seInfo to label secondary dex files
There are, confusingly, two seInfo strings used to determine how
processes and files are labeled. "seInfo" was the original string, and
https://android.googlesource.com/platform/frameworks/base/+/be0b8896d1bc%5E%21/#F3
added "seInfoUser" to support instant apps (with a TODO to merge the two
fields).

"seInfoUser" is only intended to label instant app processes, not files.
So, when we need to label files, we should be using "seInfo", not
"seInfoUser". Otherwise, files will get labeled incorrectly.

Steps to reproduce:

  1) Revert system/sepolicy commit cdc6649acc43d3a38753e22790f372290c1189c1
  2) Rebuild and factory reset the device ("fastboot -w flashall")
  3) Wait for the device to boot.
  4) "adb root"
  5) "adb shell"
  6) "cmd package compile -r bg-dexopt --secondary-dex com.google.android.gms"
  7) Examine the files in /data/user_de/0/com.google.android.gms using
     "ls -laZR /data/user_de/0/com.google.android.gms"

Expected:

  All files in /data/user_de/0/com.google.android.gms should have the
  SELinux label "privapp_data_file"

Actual:

  Secondary dex files produced by installd have the incorrect label
  "app_data_file"

Bug: 112357170
Test: Verified labels of files in /data/user_de/0/com.google.android.gms
      are correct

Change-Id: If028dcb4742731acab2855d4eec8f314964bb09a
2018-08-14 11:22:50 -07:00
Steven Moreland
54ea922d1a Simplify IWeaver mocking code.
Implementations of HIDL interfaces are intended to extend
from the Stub class, not the core interface class.

Test: m FrameworksServicesTests
Test: frameworks/base/services/tests/runtests.py -e package "com.android.server.locksettings"
OK (454 tests)

Bug: 112334405

Change-Id: Ib060560fd74f0092544096210f52e1f7fcba6c06
2018-08-14 18:10:43 +00:00
Treehugger Robot
bf66847240 Merge "NetworkAgent: Send primitive integer in explicitlySelected" 2018-08-13 17:09:51 +00:00
Luke Huang
ff9159b1df Merge "Strict-related commands porting" 2018-08-13 05:39:02 +00:00
Roshan Pius
eaf8dee367 NetworkAgent: Send primitive integer in explicitlySelected
|Boolean| object is not parcelable and hences crashes when the binder call
crosses a process boundary. Using a primitive integer instead to
represent the boolean value.

Bug: 112358948
Test: Device boots up and able to make wifi connection.
Change-Id: Iac69fd302e1f1338ed0da1446105ffc5855451cc
2018-08-10 07:44:33 -07:00
Roshan Pius
7e83b79010 Merge "NetworkAgent: Send primitive integer in score" 2018-08-10 14:33:07 +00:00
Roshan Pius
64e99ef26d NetworkAgent: Send primitive integer in score
|Integer| is not parcelable and hences crashes when the binder call
crosses a process boundary. Using a primitive integer should suffice
for sending the value to the server. There are no other usage of
|EVENT_NETWORK_SCORE_CHANGED| in the codebase.

Bug: 112358948
Test: Device boots up and able to make wifi connection.
Change-Id: I4c8fc17f4b803f69a4d882c71a8ce014a194d1ba
2018-08-09 07:10:27 -07:00
Jeff Sharkey
344960b4d2 Shuffle FD ownership? \noideadog
Test: manual
Bug: 111746860
Change-Id: I1d88bcf81efe71d622bcf3056a6d7c1a4c793383
(cherry picked from commit a651b7833743a22859635409d923729678ac40b1)
2018-08-08 11:25:24 -07:00
Remi NGUYEN VAN
76f081be5c Merge "Add codewiz@, reminv@ to OWNERS for connectivity" 2018-08-08 08:05:20 +00:00
Remi NGUYEN VAN
97ff63812c Merge "Add tests for NetworkMonitor isCaptivePortal" 2018-08-08 04:59:12 +00:00
Remi NGUYEN VAN
d2cb322e93 Add codewiz@, reminv@ to OWNERS for connectivity
Test: m
Change-Id: I11df4c93ac61b620fc576a2ff17192b7c9ecb984
2018-08-08 12:22:20 +09:00
Paul Crowley
fc0b519374 Use fdeCheckPassword error code to indicate pw failure
Plumb through the error code from cryptfs_check_password to
decryptStorage that was lost in the switch to Binder, so that a wrong
password (+ve return value) is not treated like a bad state (-ve
return value).

Bug: 110976442
Test: Switch walleye fstab to FDE, and test wrong password by hand
Change-Id: Ic2d58483a230ab4520e3a0e6af08d2fac5e8156f
2018-08-07 10:22:17 -07:00
Remi NGUYEN VAN
d9a1cd7fc5 Add tests for NetworkMonitor isCaptivePortal
Bug: b/79499239
Test: added tests, ConnectivityService tests pass

Change-Id: I98d503b8f92d7f35e59dd1621a90f2eca8c7a63c
2018-08-07 08:57:35 +00:00
Xin Li
02857a7219 Merge Android Pie into master
Bug: 112104996
Change-Id: Id91836f22f2c9842975ac5b55f0f18b89db9b2f5
2018-08-06 19:20:02 -07:00
Remi NGUYEN VAN
10c593cf7f Merge "Add logging for private DNS probes" 2018-08-07 01:29:14 +00:00
rleix
212d9f76ba Merge "Fix the system_error while calling thread::join() in NativeCallbackThread."
am: 56104e6fb8

Change-Id: Idc11c245841a45882ddb90849c35e98d678947cc
2018-08-06 13:46:14 -07:00
rleix
4d5db38cc3 Fix the system_error while calling thread::join() in NativeCallbackThread.
system_server crashed because the system_error "resource_deadlock_would_occur"
occurred while calling thread::join(). It is caused by the value of thread is same
with the calling thread. Correct it using std::this_thread::get_id() to check
whether it is the same thread with the calling thread.

Bug: 70603039
Test step:
     Step 1 : Flash DUT and boot it.
     Step 2 : Connect with PC via USB.
     Step 3 : Run the following adb command and check the DUT: 
              adb shell
              su
              ps -A | grep broadcastradio
              kill xxx(the process id of android.hardware.broadcastradio@intel-service)

Change-Id: Ia21282c4cc631a0788496081b1821be28929fae6
Signed-off-by: Lei,RayX <rayx.lei@intel.com>
2018-08-06 18:04:24 +00:00
Makoto Onuki
088849fc5e resolve merge conflicts of c02b2ec3f179820c31c470d89b919ce721513472 to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Iabf4bf87cc8aec5dab871096fe320098c4622545
2018-08-03 08:07:01 -07:00
Nathan Harold
bb67bab55f Merge "Throw on revoked location permission - framework" 2018-08-02 22:16:07 +00:00
Svet Ganov
56c4148e41 Throw on revoked location permission - framework
When we fixed proper handling of location permisison gating
sensitive telephony calls we stopped throwing a security
exception when the permission is not held by the caller.
While this is not a security issue there is no reason to
change this behavior which is checked by CTS. This CL starts
throwing a security exception if the permission is not held.

Test: atest android.permission.cts.NoLocationPermissionTest

bug: 74074103

Merged-In: Ic891d62b408c692f84a345f24503f7f25d583e35
Change-Id: Ic891d62b408c692f84a345f24503f7f25d583e35
(cherry picked from commit 33b150937522ccda37567c1303117ac8f1bb6f7f)
2018-08-02 11:35:00 -07:00
gaoshiqi
075c81a3e2 use correct userId when startProcess failed
use app.userId

Change-Id: I989289e895d4263823cc68bf5ee1e307334aeafb
Merged-in: I1cbc37fdda8530bee6f1cf1d4d7d16776b4ff55d
Signed-off-by: gaoshiqi <gaoshiqi@xiaomi.com>
2018-08-02 15:33:53 +00:00
Luke Huang
69369f3391 Clatd-related commands porting
Test: runtest frameworks-net passes
Test: manual testing of clatd works
Change-Id: Ia7ee6721870f9fc8f1490e758198a01c452ebac6
2018-08-02 15:51:41 +08:00
Nathan Harold
270e4bb284 Merge "Count and Report Bandwidth Requests by UID"
am: e1d140619f

Change-Id: Iadfb7c04a49055c57cc8eed2ce9ad5f10e15cf52
2018-08-01 15:48:12 -07:00
Luke Huang
db4dace06b Merge "Idletimer-related commands porting"
am: b6b8516ba0

Change-Id: I48997db764885415f952520c5a29c5da34327e39
2018-08-01 15:44:30 -07:00
Nathan Harold
e1d140619f Merge "Count and Report Bandwidth Requests by UID" 2018-07-31 18:13:21 +00:00
Luke Huang
473eb872f6 Strict-related commands porting
remove strict enable command
netd will handle it

Test: runtest frameworks-net passes
Test: run cts StrictModeTest
Change-Id: I34c4f270ec1d4d9ae1f60c0f9abec2a7d966ce9b
2018-07-31 09:26:15 +00:00
Luke Huang
a62d0498c1 Idletimer-related commands porting
Test: runtest frameworks-net passes
Test: manual testing of idletimer works
Change-Id: I63e20aa3861e613b0970be30a70d0972d7e33d8c
2018-07-31 06:08:05 +00:00
Nathan Harold
fd45e5fee8 Count and Report Bandwidth Requests by UID
To debug power drain due to modem wakeups,
one of the signals we'd like to track is
requests for bandwidth estimate to see which
apps are making requests and how often. This
patch keeps a simple count per-UID when an
app requests a bandwidth update, and that
count is made available in dumpsys.

Bug: 77498849
Test: runtest frameworks-net
Change-Id: I30d2ce85f9fa6747030cf4039d1080113a32e386
2018-07-31 02:37:38 +00:00
Iris Chang
38d1885b46 Merge "Skip from copying preopted files if device is undecrypted"
am: 17977d897e

Change-Id: I169da87e2aca3b5146e91da4c635f583af94b27b
2018-07-26 19:25:01 -07:00
Treehugger Robot
17977d897e Merge "Skip from copying preopted files if device is undecrypted" 2018-07-27 01:00:00 +00:00
Andreas Gampe
1b5577b44a resolve merge conflicts of eff814e768f0a65006bb07520983df799ed0cbd9 to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I8f602eed512285de840bbadceefb88fdbd652780
2018-07-26 15:07:54 -07:00
Calin Juravle
73b38f94e7 Update system server profile
The previous profile contained only a few methods and classes
due to an error during processing.

(cherry-picked from commit 0161eaf5666fbb523b68dc77b965b96a0fab8cdd)

Test: build & flash & boot
Bug: 111820715

Merged-In: I4caac335941e2cc84c153652c5206fefdc03596b
Change-Id: I4caac335941e2cc84c153652c5206fefdc03596b
2018-07-26 10:28:18 -07:00
Iris Chang
cd5dd3c7b5 Skip from copying preopted files if device is undecrypted
After applies issue 78613232 patch (create symlink in init.rc),
we found device boots to home screen fail.

When device is FDE (Full Disk Encryption) and user sets the
Password/Pattern/PIN to lock phone and then reboot the device,
data partition will be mounted as tmpfs (256MB) until device
is unlocked after user inputs Password/Pattern/PIN.

During device boot-up process, PMS (Package Manager Service) will
execute requestCopyPreoptedFiles when device first boots, and it
may cause device fails to boot to home screen because PMS copies
larger system_b (about 500MB) to smaller tmpfs (tmpfs is only 256MB)
before device is decrypted.

We suggest that PMS doesn't execute requestCopyPreoptedFiles when
device is undecrypted during first boot.

Bug: 78613232

Test: Device boot up to launcher normally.
Test: APPs work normally after A/B upgrade.

Change-Id: I893e0e217a59577299e97adfbf5dc7762dffda7c
2018-07-26 18:34:53 +08:00
Gopal Krishna Shukla
c38e0f19c1 Merge "Avoid onServiceDisconnected() for unbind Service"
am: a37c252248

Change-Id: I825afa6ce1a341f37687fb453a1eeda1ad19ae86
2018-07-23 12:10:57 -07:00
Treehugger Robot
a37c252248 Merge "Avoid onServiceDisconnected() for unbind Service" 2018-07-23 17:27:13 +00:00
Gopal Krishna Shukla
9117037dd3 Avoid onServiceDisconnected() for unbind Service
onServiceDisconnected() and unbindLocked() both
are responsible to make mRemoteInstanceas null,
so ensure that the service is not unbinded already
while calling onServiceDisconnected()

Fixes:111631529
Test: Build Successful and device Running.
Change-Id: I505d97e32c4e76f06a358850e91fe189bf02654c
2018-07-23 15:44:28 +00:00
Edward Savage-Jones
2de74edd83 Merge "Fix an incorrect null check"
am: 09071b4fa8

Change-Id: Ie69056c21ee03e397881c14ef69804fead2202a9
2018-07-20 08:00:25 -07:00
Treehugger Robot
09071b4fa8 Merge "Fix an incorrect null check" 2018-07-20 12:41:17 +00:00
Remi NGUYEN VAN
dcb722fdd4 Add logging for private DNS probes
Also includes registering validation events as metrics.

Bug: b/111596247
Test: as follows:
  - Built, flashed, booted
  - Configured strict mode
  - Connected to working WiFi, then WiFi with no connectivity
  - Changed private DNS server to invalid value
  - Re-connected to working WiFi
  - adb shell dumpsys connectivity has PROBE_PRIVDNS events with success
    and failures of the probe

Change-Id: I2691dffd60593fdeaedd22f7ec04a76029f6297c
2018-07-20 18:13:24 +09:00
Edward Savage-Jones
36a8942ca2 Fix an incorrect null check
Found an incorrect null check when debugging.

Test: Manual
Change-Id: I7ea3e2cf88117ccef48f994719986e371e45d777
2018-07-19 13:03:16 +02:00
Yifan Hong
58faaa09da IBatteryPropertiesRegistrar: remove unused functions
* Remove BatteryProperties
* Remove IBatteryPropertiesListener
* Remove IBatteryPropertiesRegistrar.(un)registerListener
  functions

Test: builds
Test: boots
Bug: 68724651
Change-Id: Ic9a9d337e5cb39784db1a2745297ef985dd31653
Merged-In: Ic9a9d337e5cb39784db1a2745297ef985dd31653
(cherry picked from commit dd0e942597b51e517eb65d9ea80595d46a3e89df)
2018-07-17 15:35:49 -07:00
Jerry Zhang
4bff76be80 Merge "UsbDescriptor: Add finite timeout to control transfer"
am: 20dca26f41

Change-Id: I86a916694a497bedb7d2df8a64dd17e0e15ce332
2018-07-17 13:59:15 -07:00
Tyler Gunn
bbe8990162 Merge "Ensure Notification re-post with setOnlyAlertOnce(true) silences sound." 2018-07-17 20:29:59 +00:00