432081 Commits

Author SHA1 Message Date
Colin Cross
f4e74b8fa0 Fix fallthrough warning
Fix a single fallthrough warning and re-enable -Wimplicit-fallthrough.

Test: m libhwui
Change-Id: I850f53f717417f70c9d0416176d03fd64473d1ba
2019-10-31 13:47:42 -07:00
Treehugger Robot
4221333afe Merge "Services exit fg when bg-restricted app leaves top" 2019-10-31 18:26:35 +00:00
Tyler Gunn
9c3abc4692 Merge "Make Connection.Listener methods package private." 2019-10-31 18:10:16 +00:00
Marco Nelissen
8d132dd384 Merge "Remove unused link libraries from libmedia_jni_utils" 2019-10-31 17:18:51 +00:00
Steven Moreland
4a39e5bc1d VibratorService: support AIDL HAL implementation
Currently, this is with a 1.4 -> aidl shim, but this will be removed
when the 1.4 HAL interface is removed.

Bug: 141828236
Test: the following:
 - device w/ aidl vibrator (cuttlefish) - see logs
 - device w/o aidl vibrator, HIDL vibrator still used

Change-Id: Ib4d9841bae1e0bff3c4196959a9a20e03a4297eb
2019-10-31 09:51:09 -07:00
Harpreet "Eli" Sangha
89ffc2d327 Vibrator Service: Support Async Callback APIs
Bug: 136220871
Test: TBD
Change-Id: Ia639dd01081218db0bc3029316a58a03b9d4d927
(cherry picked from commit 7a4f1d23eaa5c55d84d8316bb531f7be03b08efb)
Merged-In: Ia639dd01081218db0bc3029316a58a03b9d4d927
2019-10-31 09:51:09 -07:00
Harpreet \"Eli\" Sangha
ce89efbed1 Vibrator Service: Allow HAL Version Checking
Broke up the halCall() API into two components, one that implements the
initial service retrieval and one that implements the retry on
connection loss. This allows the service retrival API to double as test
for supported version with little overhead.

Test: Manually via CLI
Change-Id: I12cf8838e933187d473157c9576d1b13b03913d4
Signed-off-by: Harpreet \"Eli\" Sangha <eliptus@google.com>
(cherry picked from commit e0b7951d632a5334f17b7e16cdf4bc4cfe9b2196)
Merged-In: I12cf8838e933187d473157c9576d1b13b03913d4
2019-10-31 09:51:09 -07:00
Brad Ebinger
d3e3fab996 Merge "Add new system level APIs for accessing IMS state" 2019-10-31 16:34:27 +00:00
Brad Ebinger
b1b98eaa99 Merge "Remove shell commands for setting default SMS app" 2019-10-31 16:33:00 +00:00
Andrei-Valentin Onea
2c3b1a1010 Merge "Add apis for listing all compat changes" 2019-10-31 13:36:26 +00:00
Mark Chien
259fdbb0b3 Merge "[Tether05] Migrate UpstreamNetworkMonitor into module" 2019-10-31 13:05:32 +00:00
markchien
11467288c6 Fix netd_aidl_interface compatible problem
Both of services.net and services.core statically link
netd_aidl_interface. But they use different version.
Since services.core already include service.net, removing
netd_aidl_interface from service.core.

Bug: 143560726
Bug: 139280289
Test: -build, flash, boot
      -Off/On tethering

Change-Id: Ifa83880ee7ee88ed67f8b638228ef1b0887e201e
2019-10-31 20:50:11 +08:00
Andrei Onea
18041f787d Add apis for listing all compat changes
These apis are required for adding UI in the Developer options for
modifying compatibility change overrides.

Bug: 138280620
Test: atest CompatConfigTest
Change-Id: If55aa68f9bdd6bed0765324e972de3683bacb553
2019-10-31 11:54:13 +00:00
Andrei Onea
0611dbc7a6 Initialize AppCompatCallbacks in system server
This ensures that any calls made (intentionally or not) in the system
server using the Compatibility (in-app process) gating APIs will always
return true, and log the gated feature.

Bug: 143591326
Test: m
Merged-In: I96792cf852f4167fc39d5055704f8617efaae25e
Change-Id: I96792cf852f4167fc39d5055704f8617efaae25e
2019-10-31 11:49:50 +00:00
Jiyong Park
00ea0b1f91 android.test.mock is built with much less number of sources
android.test.mock is built with its own sources plus a small number of
framework sources that provides private APIs that the library's APIs
have references to. Previously, it was built with the entire framework
sources which is too many and should have slowed the build performance.

Bug: 141149570
Test: m
Change-Id: I165ffdfc053a71b323ef7058651d5908df06870f
2019-10-31 20:38:47 +09:00
Mark Chien
47db7adcca Merge "[Tether04] Migrate EntitlementManager into module" 2019-10-31 07:33:21 +00:00
Treehugger Robot
450a38b074 Merge "Change AIDL module name" 2019-10-31 06:34:32 +00:00
Jiyong Park
f0cc2aa46f Merge "Build API stub with less number of source files" 2019-10-31 04:44:27 +00:00
Treehugger Robot
c29b5cba29 Merge "Move heap dump sharing to SHELL." 2019-10-31 03:45:50 +00:00
Phil Weaver
f4d1789b81 Merge "a11y: don't crash the system when illegal component name encounted" 2019-10-31 01:29:30 +00:00
Taesu Lee
f7488d0874 New APIs for SMSC address
Added getSmscAddress() and setSmscAddress() to access SMSC address in
(U)SIM through the SmsManager.
getSmscAddress() requires that the calling app is the default SMS app,
or has READ_PRIVILEGED_PHONE_STATE or the carrier privileges.
setSmscAddress() requires that the calling app is the default SMS app,
or has MODIFY_PHONE_STATE or the carrier privileges.

Test: Manual

Change-Id: Icb21aff450f71b30ef6a1181834014bf7b85b8e1
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-10-31 10:14:56 +09:00
Amit Mahajan
ef5e0ad2b4 Merge "Limit FDN Number up to 40 digits for Vodafone" 2019-10-31 00:51:07 +00:00
Brad Ebinger
67e099b9e7 Remove shell commands for setting default SMS app
Use RoleManager shell commands directly instead of telephony
commands for setting the default sms app.

Bug: 142419519
Test: GtsTelephonyTestCases:ImsServiceTest
Merged-In: Ib150ff57ecd0872ba732b273b5e7363375723639
Change-Id: Ib150ff57ecd0872ba732b273b5e7363375723639
2019-10-30 16:38:51 -07:00
Brad Ebinger
5c040e122f Add new system level APIs for accessing IMS state
1) Adds new system APIs that provide more access to IMS state.
2) Remove dependence on IPackageManager, which is not accessible
in mainline.

Bug: 141457496
Bug: 122098288
Test: atest FrameworksTelephonyTests
Merged-In: I17cbad4642ad3099668a354bb2588f2b55602311
Change-Id: I17cbad4642ad3099668a354bb2588f2b55602311
2019-10-30 16:33:52 -07:00
Treehugger Robot
3f5a8f5899 Merge "Add yanmin@ and zhouwenjie@ to incident proto OWNERS list." 2019-10-30 23:29:34 +00:00
Treehugger Robot
1b90887629 Merge "Consolidate ActivityStack#finishCurrentActivityLocked checking" 2019-10-30 14:49:22 +00:00
Marco Nelissen
e83368fcfa Remove unused link libraries from libmedia_jni_utils
Test: build
Change-Id: If11573e26f1b4e610b936d63870da962c8e128a2
2019-10-30 07:48:25 -07:00
markchien
d020e55723 [Tether05] Migrate UpstreamNetworkMonitor into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ic1d9deecb66aaba0a4264a57f2e6579ea491ac9b
2019-10-30 12:42:42 +00:00
wilsonshih
d528106fbc Consolidate ActivityStack#finishCurrentActivityLocked checking
This CL is to fix a bug that found in
TransitionSelectionTests#testCloseTask_BothWallpaper_SlowStop may flaky
because when TopActivity launched & call finish(), the activity will destroy
too soon before BottomActivity resume & idle.

When TopActivity launched, suppose BottomActivity's nowVisible state should
be false because both activities are fullscreen activity & TopActivity should
cover BottomActivity.

After TopActivity called finish(), normally the activity should wait for
BottomActivity visible and then destroy, and this test is to verify if
TRANSIT_WALLPAPER_INTRA_CLOSE state will coming when opening & closing animation
target with wallpaper theme are animating case.

But the flakiness may happen if device is in low-performance stage, when
TopActivity launched, system calls setClientHidden for BottomActivity's all
windows to update its viewVisibility but can't update in time, and then
the next relayoutWindow comes, mis-detected BottomActivity's Floating child
window as drawn state, so that can't update BottomActivity's nowVisible
state as invisible with onWindowsGone().

So when TopActivity called finish(), TopActivity will soon going to destroy
state since BottomActivity is still in nowVisible state.

The fix is to add isNextNotYetVisible, if the next activity the nowVisible or visible
is not yet true, which means we need to add the current finishing
activity into stopping list and destory until the next activity idle.

Bug: 140088359
Test: atest TransitionSelectionTests
Change-Id: If1907d71135158bafea69881205f351ab666025e
Merged-In: If1907d71135158bafea69881205f351ab666025e
2019-10-30 20:30:13 +08:00
markchien
f303c5a881 [Tether04] Migrate EntitlementManager into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ifdfc6cd95377351c37946a146b60896f07ece59d
Merged-In: Ifdfc6cd95377351c37946a146b60896f07ece59d
2019-10-30 11:06:28 +00:00
Nicolas Geoffray
555ffd1c0c Merge "Add checks to ensure only the ART memfd file is whitelisted." 2019-10-30 08:24:37 +00:00
Ruoyao Liu (刘若尧)
51038e8b3c Add API to set the sll_protocol on PacketSocket
Problem & Root cause:
the mInterfaceBroadcastAddr.sll_protocol is not assigned when the
interface initializes, sll_protocol is 0x0000 by default.
This causes packets to be filtered incorrectly in packet capture,
typically with tcpdump. The previous API is used by DhcpClient, causing
DHCP tx messages to not be recognized properly.

Background: inside the kernel packets carry both an ethertype metadata
(skb->protocol) and may also carry a real ethertype in the mac header.

Previously skb->protocol would be inherited from the socket either from
the protocol from socket() creation or from bind().  This was zero,
so skb->protocol would end up 0, even though the DHCP packets we actually
wrote would have the right on-the-wire ethertype populated in the bytes
passed to send().

As such DHCP packets would look correctly on the wire, but were lacking
the skb->protocol metadata to correctly tag them as IPv4.

This results in 'tc' and packet hooks potentially not triggering
correctly, and can thus result in tcpdump 'ipv4' filters discarding
these packets leading to confusing/erroneous tcpdump output.

In newer kernels (somewhere around 5.3), if socket protocol is 0, we
actually parse out the right ethertype from the mac header during send().

However, for old kernels we can't rely on this kernel magic, and the
right fix is simply to make sure that socket bound protocol is correctly
set to ipv4 [htons(ETH_P_IP)] in the bind() system call.

Solution:
  Add a new constructor in SocketUtils to set the protocol parameter.
Bug: 133196453
Test: manual test
Change-Id: I07887b82e0e32aadb0cbb9f930f2b2fa3e277ca9
2019-10-30 06:26:10 +00:00
Jiyong Park
3c8f37f421 Build API stub with less number of source files
The metalava fix 09094fc5e566a380b7aa1a4c3948ac66cebc0aba allows us to
not include source files having class definitions that are referenced by
private constructors of the API classes.

Removing the now uncessary source files from the input list so that
metalava can run faster.

Bug: 141149570
Test: m
Change-Id: Ib203221600baa0e57393b0d448125676d01bcb8e
2019-10-30 13:25:35 +09:00
Xiangyu/Malcolm Chen
d7f38d742b Merge "Have getSupportedModemCount always rely on system properties." 2019-10-30 02:10:42 +00:00
Treehugger Robot
634c108060 Merge "Returns null not empty string if MEID is not available" 2019-10-30 00:21:50 +00:00
Treehugger Robot
5cd5e277dc Merge "Prevent sending CLIR activation and deactivation code only" 2019-10-30 00:08:27 +00:00
Xiangyu/Malcolm Chen
8ed3fb4bcf Merge changes from topic "getDeviceCapableModemCount"
* changes:
  Rename and publicize getMaxPhoneCount; and deprecate getPhoneCount.
  Add public intent ACTION_MULTI_SIM_CONFIG_CHANGED.
2019-10-29 22:54:26 +00:00
Treehugger Robot
c91c7ab339 Merge "Add OWNERS for media/tv files" 2019-10-29 22:31:08 +00:00
Kweku Adams
03866d96e5 Add yanmin@ and zhouwenjie@ to incident proto OWNERS list.
Bug: N/A
Test: N/A
Change-Id: I8c2fa55a348c8cb1622489ab07fea05a29391f0b
2019-10-29 15:27:24 -07:00
Kweku Adams
4d345d7af1 Move heap dump sharing to SHELL.
The system shouldn't be granting read URI permissions as itself. This
means that heap dumps aren't successfully shared. Moving the heap dump
sharing mechanism to SHELL, which already has the permission to dump
heaps so that dumps can be shared properly.

The ActivityManagerService changes are submitted separately.

Bug: 126885951
Bug: 135150619
Test: collect a heap dump and confirm it's successfully shared with an app
Test: do manual test on a secondary user & confirm it's not available to
other user

Change-Id: I6fad69280b5124c8ec2d3b4bef0f7dddb6a9422c
2019-10-29 15:17:42 -07:00
Christian Wailes
5ed0e55859 Merge "Fixes a system crash in VibratorService on x86 hosts" 2019-10-29 22:13:06 +00:00
Jack Yu
e750b5b659 Merge "Addition of 'XorEqualsString' method for comparing String" 2019-10-29 21:12:26 +00:00
Treehugger Robot
c817b66016 Merge "Ignore classes on the classpath when generating stubs" 2019-10-29 21:09:29 +00:00
Chris Wailes
7d716426ea Fixes a system crash in VibratorService on x86 hosts
Original symptom: Cuttlefish devices would crash when the "recent apps"
tray was swiped up from the bottom.

Root cause: Raising the "recent apps" tray triggers a vibration.  Close
to the bottom of the call stack responsible for this action in
VibratorService is the native function vibratorPerformEffect().  The
Java Language signature for this function has a long as the type of the
second parameter, as does the JNI signature that is registered with the
environment.  The native function, however, uses an int type for this
parameter.  As a result, when the arguments are passed via the stack on
x86 devices the high bits of the second long argument are read as the
contents of the third argument, which is a jobject reference.  When the
code attempts to convert this NULL local reference into a global
reference the JNI code aborts the runtime for the process.  Because the
VibratorService is part of the SystemServer, when it crashes the Zygote
is notified and restarts the entire shell.

Why this wasn't an issue on ARM devices: ARMs calling conventions pass
many of a function's arguments via registers instead of via the stack.
This means that the long argument is passed in a register, preventing it
from stomping on any other arguments.  When the native function uses the
argument it simply reads the lower bits from the register and ignores
the higher bits.

Why this wasn't previously an issue on X86 hosts: ag/9158254 introduced
a new parameter to the vibratorPerformEffect() function.  This new
parameter is located after the mis-typed parameter and will be aliased
to the high bits of the mis-typed long argument.

Fix: Correct the type signature of the native vibratorPerformEffect()
function.

Bug: 143082450
Test: Build -> start cuttlefish -> raise recent apps tray -> no crash
[adelva: port to AOSP to close potential ASAN issues]
Change-Id: If50f68df9579f84bddc9d70a0a30cd73f4485e96
Merged-In: If50f68df9579f84bddc9d70a0a30cd73f4485e96
2019-10-29 13:09:55 -07:00
Treehugger Robot
8c6e9e653d Merge "Expose APIs required by CarrierDefaultApp as system APIs." 2019-10-29 20:06:27 +00:00
Malcolm Chen
ee5bfb643e Have getSupportedModemCount always rely on system properties.
Earlier we disabled the reboot free feature and always have
getSupportedModemCount return the same value with getActiveModemCount.
Now that we've enbaled reboot free switch, we will return correct value
based on system property.

Bug: 142514392
Test: manual - change PROPERTY_REBOOT_REQUIRED_ON_MODEM_CHANGE and test
what getSupportedModemCount returns.
Change-Id: I34e172c747dd52aa498037e64b758393793fddba
Merged-In: I34e172c747dd52aa498037e64b758393793fddba
2019-10-29 12:19:49 -07:00
Malcolm Chen
387dc0efd1 Rename and publicize getMaxPhoneCount; and deprecate getPhoneCount.
To have better names reflecting what getPhoneCount / getMaxPhoneCount
actually represent, we replace them with getActiveModemCount and
getSupportedModemCount. As getPhoneCount is public API, we mark
it as @Deprecated.

Bug: 141388730
Test: build
Change-Id: If086c50ae803b384691f709057bceeac2fc1d9d5
Merged-In: If086c50ae803b384691f709057bceeac2fc1d9d5
2019-10-29 12:19:32 -07:00
Malcolm Chen
64ff73fe4d Add public intent ACTION_MULTI_SIM_CONFIG_CHANGED.
ACTION_MULTI_SIM_CONFIG_CHANGED will be sent when multi-SIM
variants change.

Bug: 141388730
Test: test app
Change-Id: I717482ea05571afdfe6b04318d3f1fbda0c177ed
Merged-In: I717482ea05571afdfe6b04318d3f1fbda0c177ed
2019-10-29 12:15:59 -07:00
Nicolas Geoffray
abbd4a7aa0 Add checks to ensure only the ART memfd file is whitelisted.
A memfd file can be created with any name, but to protect ourselves
from unintended leakage, check that it's the name ART uses.

Test: boots
Bug: 119800099
Change-Id: Ibc684d09dd05f38933c6808b72fb402fc9d5e4eb
2019-10-29 15:45:46 +00:00
Steven Moreland
2a6f6ed94b Merge "ServiceManagerProxy: implement new method" 2019-10-29 15:45:43 +00:00