323103 Commits

Author SHA1 Message Date
Neil Fuller
99ebffc6d2 Finalize package intents used to trigger tz update
Finalize the package intents used to trigger tz update and
improve the documentation.

Bug: 64018084
Test: PTS: run pts -m PtsTimeZoneTestCases
Change-Id: Ifba9dea1d6d8818f875d4c7efba09d77c8e6d66a
Merged-In: Ifba9dea1d6d8818f875d4c7efba09d77c8e6d66a
(cherry picked from commit 228dc6cfefd06936657fa39848f7ee73162def8f)
2017-09-14 13:43:40 +01:00
Hugo Benichi
a3c28cc567 Merge changes I4719b4dc,I0308cdf4,I38db1bb7
* changes:
  IpManagerTest: fix flaky test
  Fix flaky NsdManagerTest
  Boostrap test for NetworkMonitor
2017-09-14 11:59:58 +00:00
Hugo Benichi
61901ddedd Merge changes Ie2676b20,Ie8db6f85
* changes:
  Connectivity metrics: add WakeupStats events
  Connectivity metrics: collect NFLOG wakeup events
2017-09-14 11:53:02 +00:00
Hugo Benichi
60c9f63b66 Connectivity metrics: add WakeupStats events
This patch defines a new WakeupStats event in ipconnectivity.proto and
populates these events from the NFLOG wakeup events stored in
NetdEventListenerService.

There is one WakeupStats object per known interface on which ingress
packets arrive and may wake the system up.

Example from $ adb shell dumpsys connmetrics list:

UPDATEME
...
WakeupStats(wlan0, total: 58, root: 0, system: 3, apps: 38, non-apps: 0, unrouted: 17, 6111s)
WakeupEvent(13:36:31.686, iface wlan0, uid -1)
WakeupEvent(13:38:50.846, iface wlan0, uid -1)
WakeupEvent(13:39:16.676, iface wlan0, uid 10065)
WakeupEvent(13:40:32.144, iface wlan0, uid 1000)
WakeupEvent(13:40:35.827, iface wlan0, uid 1000)
WakeupEvent(13:40:47.913, iface wlan0, uid 10004)
WakeupEvent(13:40:52.622, iface wlan0, uid 10014)
WakeupEvent(13:41:06.036, iface wlan0, uid 10004)
...

Bug: 34901696
Bug: 62179647
Test: runtest frameworks-net
Change-Id: Ie2676b20bfb411a1902f4942643df0c20e268d99
2017-09-14 13:29:56 +09:00
Narayan Kamath
ac0b4be198 Zygote: Improve logging and error handling during connections.
Before this change, we were throwing a checked exception on success
and returning on failure. This made it hard to figure out where / when
something was going wrong. This change switches things around to throw
a RuntimeException when something goes wrong and to return a Runnable
on success. This lets us make stronger assertions in both the parent
and the child process about their state and expected return values.

This change also upgrades the severity of several errors that we would
earlier just ignore. We will now reject the command and terminate the
connection to the client when we encounter these errors such as:

- Malformed arguments
- Any ZygoteSecurityException, such as thown thrown by
  applyUidSecurityPolicy and applyInvokeWithSecurityPolicy.
- Any error in setting up pipes etc. to facilitate communication
  with child processes.

(cherry picked from commit bf99d06003e76469a99269816babe16a22d83b89)

Bug: 13618569
Test: Manual
Merged-In: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
Change-Id: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
2017-09-13 18:40:59 -07:00
Narayan Kamath
a3d4230b92 Zygote: Fix race condition on package preloads.
Before this change, ZygoteProcess.preloadPackageForAbi returned
as soon as the command was written to the zygote socket and not
after the preload completed. This meant that there was a small
window of time before the server side of the socket polled its FDs
where a second command could be written to the zygote socket. This
would lead to only one of the commands being processed and the
other being dropped. The client side of that socket would then wait
forever for a response and bring down the system once the watchdog
timeout was hit.

Example failure case :
--------------
system_server:send command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(preloadPackage)  // the fork command is dropped.

Example of normal operation :
------------------
system_server:send command(preloadPackage)
zygote:poll & process command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(fork)

This change makes preloadPackageForAbi synchronous, which ensures
that each POLLIN event corresponds to precisely one command.

(cherry picked from commit 24a3306c32aa3860184025638f3abaab96cc9153)

Bug: 62886909
Bug: 13618569
Test: Manual
Contributed-By: yuqianyu@huawei.com

Merged-In: I83faf974c9a70a6ab18323f692c1981784e4c56a
Change-Id: I83faf974c9a70a6ab18323f692c1981784e4c56a
2017-09-13 18:37:05 -07:00
Treehugger Robot
d763e341b5 Merge "Abort connecting to native daemon during shutdown" 2017-09-13 22:09:54 +00:00
Hall Liu
0285ee851d Merge "Unhide EMBMS download API" 2017-09-13 20:40:34 +00:00
Hall Liu
910e5751b6 Merge changes from topics "embms-0804-adjustments", "prepare-download-unhide"
* changes:
  Make EMBMS adjustments for 08/04
  Prepare EMBMS apis for un-hiding
2017-09-13 19:55:58 +00:00
Treehugger Robot
f8c7572b8f Merge "Bluetooth: thread-safe callback invocation" 2017-09-13 19:03:47 +00:00
Jakub Pawlowski
3eb569fc72 Bluetooth: thread-safe callback invocation
Bug: 65596701
Test: manual
Change-Id: I92a436328a3070ea842e8e652891e485406c2ed7
2017-09-13 17:31:43 +00:00
Treehugger Robot
06b29a87d7 Merge "Bluetooth: fix GATT race conditions when using Handler" 2017-09-13 17:31:30 +00:00
Jakub Pawlowski
eb6b3da4fc Bluetooth: fix GATT race conditions when using Handler
Bug: 65596701
Test: manual
Change-Id: Id703cea0543626bdd5a583da95615b650bbcc331
2017-09-13 17:31:24 +00:00
Nicolas Geoffray
1f88ad66e1 Special handling of priv-apps in Zygote.
If pm.dexopt.priv-apps is set to false, disable verifier and
only allow loading oat files from system.

bug: 30972906
bug: 63920015

Test: works as expected when pm.dexopt.priv-apps is true or false
Change-Id: Ib9e80c9b7b4106e82c0b9d1c7fbb8065c190ac1f
2017-09-13 14:21:00 +01:00
Hugo Benichi
25c7f49ff3 IpManagerTest: fix flaky test
Reset the callback mock for every onLinkPropertiesChange expected when
pushing address updates on the BaseNetworkObserver.

Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net, IpManagerTest passes 200 times in a row
Change-Id: I4719b4dc86044438243887634191c2d21686b80f
2017-09-13 18:39:50 +09:00
Hugo Benichi
2a94ac555e Fix flaky NsdManagerTest
Bad synchronization between the mock handler and the test assertions
were causing testDiscoverService() to sometime fails (1/50 ~ 1/100 repro
rate).

Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net, NsdManager#testDiscoverService now passes
      1000 times without errors.
Change-Id: I0308cdf48fc6bdc2fc9b4e8f7d5241a1cf2ea443
2017-09-13 18:38:53 +09:00
Rubin Xu
60eae6e621 Merge "Refactor CompareResult<> class and its call sites" 2017-09-13 09:35:04 +00:00
Nicolas Geoffray
e017dae587 Merge "Rename debugFlags to runtimeFlags." 2017-09-13 08:08:47 +00:00
Hugo Benichi
c894b12388 Boostrap test for NetworkMonitor
This will finally allow to write captive portal detection unit tests.

Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net
Change-Id: I38db1bb79ae80a82b4199dc9cb1b56257e0cf222
2017-09-13 16:21:50 +09:00
Nathan Harold
d999d225a8 Re-Expose IpSecService API Surface
Note, This reverts commit bd62d6aff264b8e8ce4a06ca6417e69bcca3006b.

Bug: 64800246
Test: compilation
Change-Id: I709d4c476647cfe9f6b982fc373f8d76018b3922
2017-09-12 19:25:13 -07:00
Nathan Harold
b72821747c Re-Enable Starting of the IpSecService
This reverts commit 41004ff4113dc9175c993638a47af602af6d8a98.

Bug: 64800246
Test: compilation
Change-Id: I4f5e3cd23001b9d94b3f6dc9fcfe731a90650e6e
2017-09-12 19:25:09 -07:00
Tyler Gunn
c4fd93e43b Fix ImsCallProfile parceling and add protection for invalid parcelables.
Two things:
1. The writeToParcel and readFromParcel in the ImsCallProfile never
worked; they were not parceling the Bundle properly.
2. Ensuring on writeToParcel that invalid Bundle contents are removed and
not sent across a Binder interface.

The existing Bundle.filterValues method accomplishes this by ensuring only
primitive types and android.* namespace parcelables are included in the
Bundle.  We use this to ensure that when the ImsCallProfile instances cross
the binder call boundary, package-local Parcelables don't cause the
Bundle to be invalidated when unmarshaled in a place where the
pacakge-local parcelable is not available.

Test: Manual, also wrote new unit tests
Bug: 65562929
Change-Id: Iea982d14a053414b9a4daba998c021c61902119d
2017-09-12 19:13:30 -07:00
Nicolas Geoffray
81edac4037 Rename debugFlags to runtimeFlags.
Also now pass the flags to the forked process through --runtime-flags instead
of converting to command line arguments and converting back to an integer.

bug: 30972906
bug: 63920015

Test: builds

Change-Id: I7f10c43dd916ca2d3b9b5141f17261eb7b64f49a
2017-09-12 15:54:23 +01:00
Treehugger Robot
7b625191e2 Merge "Patch incoming LinkProperties before it's visible to the outside" 2017-09-12 11:12:53 +00:00
Rubin Xu
6c1f6fd789 Patch incoming LinkProperties before it's visible to the outside
Otherwise we risk a race condition when we are fixing the LinkProperties
routes, other parts of ConnectivityService is reading the field at the
same time.

Test: runtest frameworks-net -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-core -c android.net.LinkPropertiesTest
Bug: 65529483
Bug: 35995111
Change-Id: I539578703570a901e0a5dff0155422ca78c52401
2017-09-12 10:18:58 +01:00
Treehugger Robot
c5932ab2a8 Merge "Check for IControllOffload.getServer() returning null" 2017-09-12 06:10:45 +00:00
Erik Kline
300f9d0bf2 Check for IControllOffload.getServer() returning null
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 65529504

Merged-In: I5a57a9fd14dc53eaf1722fbc9a972f4f73280497
Merged-In: Ib2d1862367145260ac83f14d181646eb827538f8
Change-Id: I671487344000f1f2db92b8e4a693c096b680830c
(cherry picked from commit 87b3bfd5f2d3d0ccfc3ee1279b496d4ff289e38f)
2017-09-12 13:36:19 +09:00
Hugo Benichi
f562ac34a5 Connectivity metrics: collect NFLOG wakeup events
This patch stores NFLOG packet wakeup events sent by Netd to the system
server into a ring buffer inside NetdEventListenerService. The content
of this buffer is accessible by $ dumpsys connmetrics or $ dumpsys
connmetrics list, and is added to bug reports.

The wakeup event buffer stores currently uid and timestamps.

Bug: 34901696
Bug: 62179647
Test: runtest frameworks-net, new unit tests
Change-Id: Ie8db6f8572b1a929a20398d8dc03e189bc488382
2017-09-12 10:02:13 +09:00
Jordan Liu
9da895b5e1 Merge "Show 3G data icon for TD-SCDMA network type" 2017-09-11 22:52:20 +00:00
Treehugger Robot
9b65f03abf Merge "AAPT2: Fix processing of quotes in XML" 2017-09-11 21:34:53 +00:00
Treehugger Robot
8303fb42e0 Merge "Revert "OMS: fix listener callbacks triggered by changes to target package"" 2017-09-11 21:10:12 +00:00
Wileen Chiu
4105ab0856 Show 3G data icon for TD-SCDMA network type
- The data annunciator on the UI shows up as
"G" instead of "3G"
- Map the 3G telephony icon to network type
TD-SCDMA

Bug: 36802489
Test: manual
Change-Id: I63a0e54aab7fda2bcc6f098bb0b43799aad2f6c2
2017-09-11 13:23:37 -07:00
Adam Lesinski
fa6058118e AAPT2: Fix processing of quotes in XML
When processing attributes in XML, quotes can't be used to mark a
section as whitespace preserving, so the assumption should be that the
entire string is whitespace preserving, which makes quote characters
literals.

Bug: 62840718
Bug: 62840406
Test: make aapt2_tests
Change-Id: I4afff02148b5b8e78833abf1f323c2f5325d6155
2017-09-11 13:05:38 -07:00
Treehugger Robot
d217a0c5a7 Merge "Add ims registration status" 2017-09-11 19:44:31 +00:00
Adam Lesinski
47d2375255 Revert "OMS: fix listener callbacks triggered by changes to target package"
Some internal tests broke due to this. Revert for now to unblock, and investigate why this occurred.

This reverts commit f08ad98acbb83abf7d30b6583bdfc188145a4215.

Bug: 65319218
Change-Id: I1bfb2d4937708441eac2ee5909717abec10f4971
2017-09-11 19:05:04 +00:00
nharold
3e884ce13c Merge "Un-hide TelephonyManager.getSignalStrength()" 2017-09-11 17:44:34 +00:00
Treehugger Robot
777d0cd7c3 Merge "Remove config_tether_apndata for Telstra." 2017-09-11 17:19:35 +00:00
Amit Mahajan
32a3fe14d6 Remove config_tether_apndata for Telstra.
Test: manual
Bug: 63564491
Change-Id: Iaca29bfd474b7df6489b1daeaeea182ebf8d81ae
2017-09-11 09:05:35 -07:00
Miodrag Dinic
81e684b76b Fix random systemui crashes during boot
When trying to boot android in emulator, systemui may crash due
to an uninitialized value of mNavigationBar probably because
of some race condition during initialization caused by emulation
performance issues:

08-24 16:28:43.722  1947  1947 E AndroidRuntime: FATAL EXCEPTION: main
08-24 16:28:43.722  1947  1947 E AndroidRuntime: Process: com.android.systemui, PID: 1947
08-24 16:28:43.722  1947  1947 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.app.Fragment.getView()' on a null object reference
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.StatusBar.getNavigationBarView(StatusBar.java:4636)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.updateStates(StatusBarKeyguardViewManager.java:537)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.reset(StatusBarKeyguardViewManager.java:207)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.show(StatusBarKeyguardViewManager.java:145)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.keyguard.KeyguardViewMediator.handleShow(KeyguardViewMediator.java:1721)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.keyguard.KeyguardViewMediator.access$2900(KeyguardViewMediator.java:138)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.systemui.keyguard.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java:1482)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:105)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6510)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
08-24 16:28:43.722  1947  1947 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)

This patches adds an explicit checks for (mNavigationBar != null)
everywhere it is used.

Test: Boot ARM & MIPS emulators to homescreen.

Change-Id: I3af868b9da565c7eb6c6882f65fbda4a34d802c8
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
2017-09-11 15:59:35 +02:00
Sanket Padawe
a90205492f Merge "Deprecate TelephonyManager APIs which are present in TelecomManager." 2017-09-11 03:31:18 +00:00
tiansiming
f58793c5a1 Fix AddAccountSettings memory leak
The memory leak will always occur in AddAccoutSettings
when a null Bundle is returned in the addAccount we implement.

Bug: https://issuetracker.google.com/issues/65322371
Test: Install the app through the github i have offered in above link,
then press the "Test" item in ChooseAccountActivity (adb shell am start -n
'com.android.settings/.accounts.ChooseAccountActivity') serveal times.
Check the activity number by "adb shell dumpsys meminfo com.android.settings".

Change-Id: I3f139fe059e6094e9e5bf1660946ebc8bab6d090
Signed-off-by: tiansiming <tiansiming@xiaomi.com>
2017-09-11 10:19:11 +08:00
Treehugger Robot
e77be9c610 Merge "tests: remove LOCAL_CLANG" 2017-09-10 17:31:20 +00:00
Lennart Wieboldt
9eb1bc05ac tests: remove LOCAL_CLANG
clang is the default compiler since Android nougat

Test: mma & verified it´s still build with clang
Change-Id: I9bfe0668eddf51dd56174fefc650a11002d38196
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2017-09-10 11:54:23 +02:00
Treehugger Robot
30798ad13a Merge changes I93cf24d4,I32e438ef
* changes:
  Convert host tools to Android.bp
  Rename aapt_defaults to aapt2_defaults
2017-09-10 01:29:21 +00:00
Treehugger Robot
5a1e85eb71 Merge "Convert libhidcommand_jni to Android.bp" 2017-09-10 01:18:28 +00:00
Treehugger Robot
d928842ab6 Merge "Convert incident_report and incident-section-gen to Android.bp" 2017-09-09 22:00:33 +00:00
Dan Willemsen
760d57a888 Convert incident_report and incident-section-gen to Android.bp
See build/soong/README.md for more information.

Test: m incident_report incident-section-gen
Test: mmma frameworks/base
Change-Id: If1a930b40196139d29e63f6558bc4a75faca1967
Merged-In: If1a930b40196139d29e63f6558bc4a75faca1967
2017-09-09 19:24:33 +00:00
Dan Willemsen
392d4e7f47 Convert libhidcommand_jni to Android.bp
See build/soong/README.md for more information.

Test: m libhidcommand_jni
Change-Id: Ica144979a2f89e0a9ed8eb4a816024aa318043e6
Merged-In: Ica144979a2f89e0a9ed8eb4a816024aa318043e6
2017-09-09 19:24:21 +00:00
Dan Willemsen
ec462238f6 Merge changes Ia3bcece1,Icd26dc1e
* changes:
  Don't compile libaapt with the build number
  aapt: Always use our libz
2017-09-09 19:21:16 +00:00
Charles He
ab6f2f62fe Add alert dialog when always-on VPN disconnects.
As part of the improvement to always-on VPN, we're adding this dialog
which is shown when the user taps the "Always-on VPN disconnected"
notification. This dialog shows a relatively detailed explanation of the
situation and offers two actions: 1) to attempt to reconnect, and 2) to
open the VpnSettings page in Settings. As a result, we expect the users
to be more aware of the consequences of a disconnected VPN, and offer
them more actionable options.

Bug: 36650087
Bug: 65439160
Test: manual

Change-Id: I5ae3ff5d25740ea52357012b75d7eb1776dfdc5e
Merged-In: I5ae3ff5d25740ea52357012b75d7eb1776dfdc5e
(cherry picked from commit 7376f6c16873e4c8f7c3f7fa27d4be6ea7894014)
2017-09-09 14:05:27 +00:00