Commit Graph

96575 Commits

Author SHA1 Message Date
Amos Bianchi
b118c9b72b Remove polling of TetheringManager in ConnectivityManager.
Test: manual

Bug: 144742179

Change-Id: I196b320788be96c120f771d2fcdf032a73e26b5f
2020-03-05 18:34:14 +00:00
Paul Hu
63e5bd6b4b Merge "Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider" 2020-03-04 10:15:41 +00:00
Aaron Huang
8d6a6e0d4b Merge "Move DnsSdTxtRecord to net common static library" 2020-03-04 05:33:30 +00:00
paulhu
b7817e287c Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider
Registering/Unregistering network provider needs NETWORK_FACTORY
which is signature only permission. But mainline modules can't
grant this permission because it's not signed with platform key.
Hence, these APIs should also accept MAINLINE_NETWORK_STACK
permission that allow mainline module to register/unregister
network provider.

Bug: 150733435
Test: atest FrameworksNetTests
Change-Id: Id22113aa0db01244817b4b008f5573c5e7b317f0
2020-03-04 09:43:41 +08:00
Sarah Chin
01574a30ea Merge "Make MmsManager public and @SystemService" 2020-03-03 21:17:11 +00:00
Jack Yu
987b8df24d Added telephony display info support
Added the new APIs allowing clients like System UI to display
network icons correctly based on the provided telephony display
info.

Test: Telephony sanity tests
Bug: 148540139
Change-Id: I4dfb6eb7a313539e0565a4239d555426f12e503e
Merged-In: I4dfb6eb7a313539e0565a4239d555426f12e503e
2020-03-03 11:21:05 -08:00
Aaron Huang
9dbdb7a01e Merge "Update NetworkInfo public API." 2020-03-03 09:16:55 +00:00
Aaron Huang
97cc9b621a Merge changes from topic "del-factory-and-networkagent-wifi"
* changes:
  Delete NetworkFactory from frameworks/base/core.
  New NetworkAgentConfig API to replace NetworkInfo WiFi stuff.
2020-03-03 03:47:31 +00:00
Aaron Huang
9309eea2fe Merge "Move NetworkAgent#register to a new method." 2020-03-03 03:37:07 +00:00
Peter Wang
b0157c3ee3 Merge "[API Review] Expose sendOrderedBroadcast" 2020-03-02 21:50:13 +00:00
Aaron Huang
1752fcf3c8 Move DnsSdTxtRecord to net common static library
DnsSdTxtRecord is moved to frameworks/libs/net for mainline
support. Also change the import path using this class.

Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I6118b313ce668707d598aa2eab9baee2f7622dbc
Merged-In: I6118b313ce668707d598aa2eab9baee2f7622dbc
2020-03-02 08:21:26 +00:00
Aaron Huang
7cadca43f2 Merge "Remove framework code that has moved to frameworks/libs/net" 2020-03-02 06:23:44 +00:00
Aaron Huang
ac916d6e2b Merge "Always set NetworkInfo objects to available." 2020-03-02 04:53:10 +00:00
Treehugger Robot
6bd37ba788 Merge "Sanitize Bluetooth device names without regex" 2020-03-01 03:21:38 +00:00
Dan Sandler
1add9f0bc2 Sanitize Bluetooth device names without regex
Saves a considerable amount of RAM.

Fixes: 145623858
Test: Pair with a simulated device with whitespace in the name
Change-Id: I1c8b00922534ee5941be6b14948c0941c5640862
2020-02-28 16:45:23 -08:00
Abhijit Adsule
fa871a3642 Merge "Add feature to disable slices" 2020-02-28 22:13:01 +00:00
Amit Mahajan
3300730d3d Merge "Hide TelephonyRegistryManager." 2020-02-28 17:45:26 +00:00
Amit Mahajan
796d96ed05 Merge "Hide CarrierMessagingServiceWrapper for now." 2020-02-28 17:45:20 +00:00
Lorenzo Colitti
41c82c99df Merge "Fix crash and duplicated ethernet tethering request" 2020-02-28 02:37:45 +00:00
Amit Mahajan
da6a199972 Hide TelephonyRegistryManager.
This was added for telephony mainline, and as such is not needed in
R now.

Test: basic sanity
Bug: 149850449
Merged-in: I2b47ab45839f07494dcad4f1878809a55ddd3087
Change-Id: I2b47ab45839f07494dcad4f1878809a55ddd3087
(cherry picked from commit 7411d22e57)
2020-02-27 16:58:09 -08:00
Amit Mahajan
5c88e4767a Hide CarrierMessagingServiceWrapper for now.
Based on api-council feedback there are some changes required.
Will incorporate the changes and expose this class in a later
release.

Test: basic sanity
Bug: 144346062
Merged-in: Icb65f90261ea6000aecd72a1888d5ee23eed6527
Change-Id: Icb65f90261ea6000aecd72a1888d5ee23eed6527
(cherry picked from commit e75a35d3b3)
2020-02-27 16:58:09 -08:00
Peter Wang
3e227cdfc5 [API Review] Expose sendOrderedBroadcast
with appOp as String and options as Bundle

Bug: 139077993
Bug: 146423958
Test: Build
Change-Id: I5325e08d60016741139251813a5df9b42f2efc82
Merged-In: I5325e08d60016741139251813a5df9b42f2efc82
2020-02-27 14:45:23 -08:00
markchien
d2d8d45b89 Fix crash and duplicated ethernet tethering request
This change fix two things:
1. Handle ethernet callback in internal thread to avoid crash. IpServer
should be created from tethering thread, otherwise mIpNeighborMonitor of
IpServer would throw
   IllegalStateException("start() called from off-thread")
2. Ethernet tethering request may be duplicated if multiple
startTethering is called but no stopTethering

Bug: 130840861
Bug: 148824036
Test: ON/OFF ethernet tehtering manually
      atest TetheringTests

Change-Id: I7c5127e96d80d077735010d2e62c7227805ccb10
2020-02-27 14:50:16 +08:00
Aaron Huang
bdb86ff8ab Merge "Add methods to send connected/disconnected state." 2020-02-27 03:21:14 +00:00
Joshua Duong
be0d76d382 Merge changes I36c6ef4b,I3c31394e
* changes:
  Allow UsbDeviceManager to start adbd again.
  Remove key from adb_keys if user forgets the key.
2020-02-26 21:39:39 +00:00
Amit Mahajan
32f87fc6fb Merge changes from topic "Delete RcsMessage code"
* changes:
  Remove the usage of Downloads.* constants.
  Delete unused RcsMessage code for now.
  Move EXTRA_SERVICE_STATE from Intent to ServiceState.
2020-02-26 18:00:11 +00:00
Joshua Duong
eb6e5bc47b Allow UsbDeviceManager to start adbd again.
There's some weird state where if persist.sys.usb.config=none,adb, then
adbd won't get started. Give back adbd start permissions to
UsbDeviceManager to see if that fixes the issue.

Bug: 150130503

Test: adb shell su 0 setprop persist.sys.usb.config none,adb; adb reboot
adb should be online after.

Change-Id: I36c6ef4b20d58570a2d51ed70088ae5c54d6687d
Merged-In: I36c6ef4b20d58570a2d51ed70088ae5c54d6687d
Exempt-From-Owner-Approval: Fix adbd offline failure
2020-02-26 08:33:19 -08:00
Amit Mahajan
3ee618bbf5 Move EXTRA_SERVICE_STATE from Intent to ServiceState.
This extra is not exposed and is not used by anyone as such.
Leaving it there for internal use/unsupported app usage.

Test: basic sanity
Bug: 140908357
Merged-in: I9fe6e904291affb1cd7b705212d47525b61a5679
Change-Id: I9fe6e904291affb1cd7b705212d47525b61a5679
(cherry picked from commit bb61b17cd9)
2020-02-25 12:28:02 -08:00
Rahul Sabnis
f9e92a836f Add missing RequiresPermission annotations in BluetoothHidHost and
BluetoothMap APIs, disallow null device input for setConnectionPolicy,
getConnectionPolicy, and getConnectionState in BluetoothHidHost, and
BluetoothMap implements AutoCloseable, its close() method is public, and
utilizes a CloseGuard.

Bug: 149238030
Test: Manual
Change-Id: I8add9e26afcaf1a988c15e3cc7f8c446491f0686
2020-02-25 12:03:48 -08:00
Amit Mahajan
a7fdceeba2 Merge changes I756b5834,Idce09cff
* changes:
  Move euicc related file to telephony.
  Delete unused reference of a hidden constant.
2020-02-25 18:15:58 +00:00
Amit Mahajan
f035fd91aa Move euicc related file to telephony.
All other files were moved earlier. This is a newly added file
that was added in the old location.

Test: basic sanity
Bug: 140908357
Merged-in: I756b5834ddb1031627168a17dc49ce93b5af8219
Change-Id: I756b5834ddb1031627168a17dc49ce93b5af8219
(cherry picked from commit 235289719b)
2020-02-24 17:59:17 -08:00
Rahul Sabnis
746e713d80 Update javadoc to reflect that BluetoothPbap#setConnectionPolicy returns
true on successfully setting the connection policy instead of on
disconnection. It also now indicates that if
BluetoothProfile#CONNECTION_POLICY_FORBIDDEN is passed in, the profile
will be disconnected.

Bug: 148966894
Test: Manual
Change-Id: I881c240fcbce0c8148625c35e6e88ab02ea7122f
2020-02-24 13:28:30 -08:00
Chalard Jean
48413166fb Update NetworkInfo public API.
Wifi needs to create these objects so it can include them
in the broadcasts.

Bug: 135998869
Test: FrameworksWifiTests
Change-Id: Ic50d9b5c65e8771708620badc3bc242a8ffbb5cc
Merged-In: Ic50d9b5c65e8771708620badc3bc242a8ffbb5cc
2020-02-24 21:07:08 +08:00
Yo Chiang
f41e145480 Add DSU default userdata partition size
Use DEFAULT_USERDATA_SIZE as userdata partition size if the calling
Intent desn't specify the userdata size or the specified size is zero.

Bug: 145891687
Test: adb shell am start-activity \
  -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
  -a android.os.image.action.START_INSTALL \
  -d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip

Change-Id: I52767dfefef394403c5e16fcfd40792b14ff9a71
2020-02-24 15:06:56 +08:00
Amy
ec8c2df33b Add a TV_TUNER_RESOURCE_MGR_SERVICE in Android Framework Context
Test: manual
Bug: 147380513
Change-Id: Id026b59bcec4a1ead9aa7ba900e72ee074c7ef81
Merged-In: Ifedc4e6f120e711aadffdf715d8720e0b64fbe16
2020-02-21 23:33:38 +00:00
Anna Trostanetski
9c6ecc90c5 Revert "Cache binder calls in CompatChanges"
Reason for revert: cache needs to be cleared on package install.
This is much simpler to do in internal master with recent changes
(ag/10172190) so I'm reverting the cache from aosp to keep it correct,
and cherrypicking this into internal master.

Change-Id: I71757a5b60fbdba3c69322b95a20527a1e3a66e9
2020-02-21 16:38:32 +00:00
Lorenzo Colitti
e81ef45b29 Delete NetworkFactory from frameworks/base/core.
It is being moved to frameworks/libs/net.

Test: builds
Test: atest FrameworksNetTests
Test: atest FrameworksWifiTests
Test: atest FrameworksTelephonyTests
Bug: 138306002
Bug: 139268426
Change-Id: I4eec40bed93679a029a20d38c114b1dbc80aa12e
Merged-In: I4eec40bed93679a029a20d38c114b1dbc80aa12e
2020-02-21 16:20:54 +08:00
Chalard Jean
490e292a76 New NetworkAgentConfig API to replace NetworkInfo WiFi stuff.
Bug: 139268426
Test: FrameworkWifiTests
Change-Id: Id13fcf41e05fd1eb26c86717e2684c724b94e401
Merged-In: Id13fcf41e05fd1eb26c86717e2684c724b94e401
2020-02-21 16:08:17 +08:00
Chalard Jean
e668251eee Move NetworkAgent#register to a new method.
Calling IPC in a constructor is unusual and confusing, and can be
considered bad form. There are multiple reasons for this :
• Users can't obtain an instance of the class without calling the
  constructor, but they can't always afford an IPC where they need
  this, forcing them to know about the implementation detail and
  sometimes design around it.
• On a related but generalized note, constructors should usually
  be fast for the same range of reasons.
• Having a separate method to register the agent simply gives more
  flexibility to the app.
• It's also a lot easier to test.
But also we can't fix it without an update to the API, so here it is.

Another reason for doing this is consistency with the NetworkProvider
API.

Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I1ee5c7b1353d581e487c8a8a159009bebd781643
Merged-In: I1ee5c7b1353d581e487c8a8a159009bebd781643
(clean cherry-pick from internal branch)
2020-02-21 14:54:18 +08:00
Joshua Duong
458a9a2561 Merge changes from topic "adbwifi-base"
* changes:
  Add Settings.Global.ADB_WIFI_ENABLED.
  [adbwifi] SysUI: Add WifiDebuggingActivity.
2020-02-21 05:02:49 +00:00
Joshua Duong
a71c97f440 Add Settings.Global.ADB_WIFI_ENABLED.
ADB_ENABLED historically meant the state for USB debugging. Since
wireless debugging can be enabled separately, define another setting
for it.

BUG: b/111434128

Test: make
Change-Id: If3abca8e77381d6832f55d55a43c52ee1a1267d1
Merged-In: If3abca8e77381d6832f55d55a43c52ee1a1267d1
Exempt-From-Owner-Approval: cherry-pick
2020-02-20 18:42:14 -08:00
Treehugger Robot
49fa6ba37f Merge "Add Vulkan dEQP level feature flag" 2020-02-20 21:06:20 +00:00
Chalard Jean
d0eb17eb76 Add methods to send connected/disconnected state.
Also add methods to set the legacy subtype and the APN name.
These have to be added together because they have to be used
together.

Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: Ie90b8d290eab490061d5cb066744b67d597b9469
Merged-In: Ie90b8d290eab490061d5cb066744b67d597b9469
(clean cherry-pick from internal branch)
2020-02-20 19:37:16 +08:00
Qingxi Li
239908298e Merge "Sanitize owner UID iff owning app does not have location permissions." 2020-02-20 05:20:27 +00:00
Qingxi Li
9c5d8b963c Sanitize owner UID iff owning app does not have location permissions.
This change adds permission checking to ensure that the following
conditions are enforced in order for apps to receive the owner UID:
1. The app must be the owner of the network
2. The app must hold the FINE_LOCATION permission/appop
3. The user must have their location toggle enabled.

Bug: 142072839
Test: atest FrameworksNetTests
Change-Id: I7a981a82f1219828ee89c8c96eb9d2efd153377f
2020-02-20 01:02:42 +00:00
Treehugger Robot
269d57b7da Merge "Make me an owner of accessibility frameworks" 2020-02-20 00:05:45 +00:00
Qasid Ahmad Sadiq
88d52e8ca6 Make me an owner of accessibility frameworks
Test: Relying on treehugger. No functional changes.
Change-Id: If0e88345001ec286bd0a9a01314dba53e45dc6ac
2020-02-19 14:02:07 -08:00
Calin Juravle
1ee3e70cf3 Merge "Revert "Revert "[DexLoadReporter] Report classloader contexts di..."" 2020-02-19 19:38:35 +00:00
Calin Juravle
c78162f489 Revert "Revert "[DexLoadReporter] Report classloader contexts di..."
Original commit:
[DexLoadReporter] Report classloader contexts directly from classloader

At the moment classloader contexts are incorrectly computed in the
PackageManager for secondary dex files. There are two issues:

(1) The wrong computed classLoaderContext will be reported for a secondary
    dex file if it was loaded at the same time as a primary dex file
    - This is due to the continue statement that doesn't increment
      dexPathIndex
(2) If a secondary dex file was loaded with a shared library then that
    shared library info isn't passed through the dex load reporting
    infrastructure, and thus its classloader context is incorrectly computed
    in PackageManager.

In order to fix the issues described above & prevent further classloader
context computation divergences between the package manager and the
runtime, lets compute the classloader context in the runtime at dex load
time and report the expected classloader context directly to
DexLoadReporter (and thus the package manager).

Notes: This is mostly just a refactor (i.e. there are a lot of line
changes, but functionally speaking this set of CLs doesn't do much
except change where the classloader context is computed)

Addendum: The bugs described above could also be fixed by:
- changing DexLoadReporter to report information about shared libraries that
  the reported classloaders depend on to PackageManager
- Teach DexoptUtils.processContextForDexLoad about shared libraries
- Fix dexPathIndex calculation in DexManager

I opted for this set of changes instead because this reduces the
possibility of context computation divergence between the framework and the
runtime. Additionally it feels more "solid" that the classloader context
is now computed directly when a dex file is loaded, rather than the
context recreated later on in the PackageManager.

Test: atest com.android.server.pm.dex.DexManagerTests
Test: atest com.android.server.pm.PackageManagerServiceTest
Test: Install app depending on shared library & uses secondary dex
files; adb shell pm bg-dexopt-job; launch app and see odex file
successfully loaded (from smaps/no logcat errors)

Bug: 148494302
Exempt-From-Owner-Approval: This is a pure re-revert, previously owner approved.
Reason for revert: Re-land
Reverted Changes:
I295a6e99e:Revert "Fix shared libraries not being reported vi...
Ib58066e8f:Revert "[DexLoadReporter] Report classloader conte...

Change-Id: I8d1af791f93a3f8fa6eca78df50891cd2ebbb4a3
2020-02-19 19:37:05 +00:00
Alastair Donaldson
1c0b692a0e Add Vulkan dEQP level feature flag
This change adds a feature flag that specifies the date associated
with the Vulkan dEQP tests that a device claims to pass.

Bug: 136573508

Change-Id: I0cec29fe5f69f228faaa2298b7f5b65bcf988dba
Merged-In: I0cec29fe5f69f228faaa2298b7f5b65bcf988dba
2020-02-19 19:17:50 +00:00