Commit Graph

7183 Commits

Author SHA1 Message Date
Treehugger Robot
7ecda7500f Merge changes from topic "fix-package-manager-usages"
* changes:
  Fix usages of PackageManager APIs in Telephony
  Fix hidden API usage in PackageChangeReceiver
2020-01-08 01:00:22 +00:00
Hall Liu
e7baa9e91e Fix usages of PackageManager APIs in Telephony
Remove usages of the hidden PackageManager#*asUser methods from
Telephony, and add some unit tests to verify the functionality.

Test: atest FrameworksTelephonyTests
Test: atest TelephonyCommonTests
Bug: 146834818
Change-Id: I2e2ec2c421773e3ff58556373896238e1ff0678a
Merged-In: I2e2ec2c421773e3ff58556373896238e1ff0678a
2020-01-07 11:01:55 -08:00
Remi NGUYEN VAN
9933ad1e47 Merge "Add FrameworksNetIntegrationTests to postsubmit" 2020-01-07 12:16:34 +00:00
Lorenzo Colitti
96529ad7fc Merge changes If28f0be6,If0f80067
* changes:
  Make LinkPropertiesTest pass, and fix an NPE.
  Add the DHCP server address to LinkProperties.
2020-01-07 06:43:20 +00:00
Lorenzo Colitti
348577e09f Make LinkPropertiesTest pass, and fix an NPE.
aosp/973686 added the DHCP server address to LinkProperties, but
it did not have any tests, and would throw NPE when parceling a
LinkProperties that did not have a DHCP server.

Add tests and fix the bug.

Bug: 134098566
Test: unit test now passes
Change-Id: If28f0be650963e8d9af7eb53f6940824582a2db3
2020-01-07 13:02:32 +09:00
Hall Liu
2ada7fbac2 Merge "Clean up SmsApplication and expose getDefaultSmsPackage" 2020-01-07 00:36:51 +00:00
Remi NGUYEN VAN
4be48b1ed8 Add FrameworksNetIntegrationTests to postsubmit
After checking flake metrics for this test, it can be added in
presubmit.

Test: this change is to check results in postsubmit
Change-Id: I70cb149629a3e959e29cfd21048e7b148bd29fe9
2020-01-06 22:03:43 +09:00
paulhu
f88a88d72f Add permissions for FrameworksNetIntegrationTests
The protected permissions were changed in some connectivity APIs
since aosp/1099096. Add required permissions for
FrameworksNetIntegrationTests.

Bug: 147121740
Test: atest FrameworksNetIntegrationTests
Change-Id: I38ba5c8e93fd5bc94371b2a02a280f503f2e1367
2020-01-06 09:30:03 +08:00
Hall Liu
35c243caa4 Clean up SmsApplication and expose getDefaultSmsPackage
- Clean up usages of hidden AppOpsManager APIs in SmsApplication
- Add unit tests for SmsApplication
- Expose RoleManager#getDefaultSmsPackage for use in SmsApplication.

Bug: 146834818
Test: atest SmsApplicationTest
Change-Id: I4ab49d7f6274389e7de7cd7223cab3c433936044
2019-12-31 14:41:02 -08:00
markchien
6d06f6d51a [Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
2019-12-19 20:53:06 +08:00
Remi NGUYEN VAN
f705ea69dc Fix parceling of LinkProperties Inet6Addr
IPv6 addresses parceled for DNS servers, private DNS servers, PCSCF
servers were parceled without the scope. This causes issues with
link-local DNS servers.

Test: atest FrameworksNetTests
Bug: 145181158
Change-Id: I0ed24e51d4d0656f4a1f932b5e9f646b35b4b971
2019-12-18 19:52:30 +09:00
Jorim Jaggi
d915fc7025 Merge "Automatically clean up flicker test data" 2019-12-09 14:14:54 +00:00
Nataniel Borges
9f2ad75a6e Automatically clean up flicker test data
Currently the flicker tests leave data on the /sdcard/flicker directory. We now clean up this data after the test.

The logs are still available in the atest results directory.

Test: atest FlickerTests
Change-Id: Ia83cbedff3104964e3d4be14a7c035f2193d36a8
2019-12-04 10:38:42 +01:00
Paul Hu
6be69420df Merge "Replace the permission of internal connectivity checks" 2019-12-04 05:59:59 +00:00
paulhu
59148b7938 Replace the permission of internal connectivity checks
A number of connectivity checks that protect system-only methods
check for CONNECTIVITY_INTERNAL, but CONNECTIVITY_INTERNAL is a
signature|privileged permission. We should audit the permission
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
all CONNECTIVITY_INTERNAL to other proper permissions.

Bug: 32963470
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I8f2dd1cd0609056494eaf612d39820e273ae093f
Merged-In: I8f2dd1cd0609056494eaf612d39820e273ae093f
2019-12-04 11:44:45 +08:00
Treehugger Robot
87bf9bc09c Merge changes Ie756b9aa,I38110f3a
* changes:
  [NS A19] Inline updateCapabilities in rematch.
  [NS A18] Reverse listens and request-availables
2019-12-04 02:07:45 +00:00
Treehugger Robot
2b65793cd6 Merge "Merge Android10 QPR1 into AOSP master" 2019-12-03 23:15:02 +00:00
Chalard Jean
b6ec076ac0 Disable a flaky test
Bug: 145513323
Test: FrameworkNetTests
Change-Id: I66e02fdaab2969b77db4a0f0e6fb8b1a981d9350
2019-12-03 16:13:22 +09:00
Chalard Jean
28e6b26c11 [NS A18] Reverse listens and request-availables
This is a long standing bug that happens to now be trivial
to fix, and also be beneficial for refactoring

Test: FrameworksNetTests NetworkStackTests
Change-Id: I38110f3a4a75936ea755788e7f9fee67863e14be
2019-12-02 18:44:10 +09:00
Chalard Jean
f477d5c4c6 Merge changes I0613c23f,Ibeab8d0a,I8bd668ad,I7d3a16be
am: 5cf5b30990

Change-Id: Ibe34e78e53a15e987042703fdd27d6393e4e7d59
2019-12-01 21:26:44 -08:00
Chalard Jean
5cf5b30990 Merge changes I0613c23f,Ibeab8d0a,I8bd668ad,I7d3a16be
* changes:
  [NS A14] Move code notifying battery stats in its right place
  [NS A13] Move legacy broadcast handling after rematch.
  [NS A12] Move some legacy type tracker handling to a function
  Add tests for ConnectivityService → BatteryStats messages
2019-12-02 05:17:39 +00:00
Chalard Jean
bbaa33e1d3 [NS A14] Move code notifying battery stats in its right place
This should be done once every time an interface comes online.
Doing this in updateLinkProperties guarantees this happens every
time a new interface comes online, but it doesn't do it more
often than needed.

Test: FrameworksNetTests NetworkStackTests
Change-Id: I0613c23f44192944266d76107308da8d1c541d1c
2019-12-02 13:02:38 +09:00
markchien
6b828d2915 [Tether07] Migrate Tethering into module
am: 0df2ebc43d

Change-Id: I1aaa034e91eae2d6e9abcbbd70741a54a18b3ddc
2019-11-30 04:25:57 -08:00
Mark Chien
e8401aff92 Merge changes from topic "tether_migrate"
* changes:
  [Tether10]Remove UserManagerInternal usage in Tethering
  [Tether07] Migrate Tethering into module
  [Tether07] Clean up build rule for libtetheroffloadjni
2019-11-30 12:17:47 +00:00
markchien
0df2ebc43d [Tether07] Migrate Tethering into module
Now tethering would be run in dedicated service.
TetheringManager is the interface used to communicate with
TetheringService. The new call flow would be: ConnectivityManager
-> ConnectivityService -> TetheringManager -> TetheringService.
Note: the return value of #tether(), #untether() and #setUsbTethering()
APIs would always be no error. Client can use #getLastTetherError()
or #getTetheredIfaces or listen tether state change to check
status of corresponding interface.

Bug: 136040414
Bug: 144742179
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
Merged-In: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
2019-11-30 10:03:08 +00:00
Chalard Jean
587758bea6 Add tests for ConnectivityService → BatteryStats messages
Test: ConnectivityServiceTest
Bug: 113554781
Change-Id: I7d3a16be76f606872f8edb84647b9ef94f36cba1
2019-11-29 16:59:30 +09:00
Hugo Benichi
04cad88eee Merge "BitUtils: support packing/unpacking negative long values"
am: 9e5de85e21

Change-Id: Ibd0c4756fb0f888a506111bb2f33c60debe33d57
2019-11-27 07:46:56 -08:00
Treehugger Robot
9e5de85e21 Merge "BitUtils: support packing/unpacking negative long values" 2019-11-27 15:34:46 +00:00
Hugo Benichi
7157c8e7af BitUtils: support packing/unpacking negative long values
Bug: None
Test: Compiled. New unit tests.
Change-Id: Ia543285e206b0bbc7d64458da10e68a951f9eec1
2019-11-27 11:00:32 +09:00
Nataniel Borges
fcc1ef2d7d Merge "Include janky runs on flicker rotation tests"
am: 3341bbefea

Change-Id: I05d509ca9ceb0d14725c25f90de4381fd1ff5241
2019-11-26 08:37:23 -08:00
Treehugger Robot
3341bbefea Merge "Include janky runs on flicker rotation tests" 2019-11-26 16:29:45 +00:00
Chiachang Wang
a6e8219c59 Merge "Refactor based on new NetworkMonitor"
am: 0d7ed7932d

Change-Id: I6f2f42dee11b2ee3db9e52817cd7aa871539aaed
2019-11-26 04:03:47 -08:00
Chiachang Wang
0d7ed7932d Merge "Refactor based on new NetworkMonitor" 2019-11-26 10:52:33 +00:00
Nataniel Borges
8e65a898ec Include janky runs on flicker rotation tests
Sometimes the tests crash because all runs are janky. Our checks are so far robust to jank, so we will consider janky runs too

Test: atest FlickerTests
Change-Id: I20303d530e1a9cc266230530c6f7fa1cecd51020
2019-11-26 11:46:42 +01:00
Chiachang Wang
3532e86487 Refactor based on new NetworkMonitor
Bug: 130325409
Test: atest NetworkStackIntegrationTests
Change-Id: I4426be339cb9990c05b3f4fb5666bd70bcd0f78e
2019-11-26 09:10:45 +08:00
Paul Hu
e0ddf49e0b Merge "Fix hasUseBackgroundNetworksPermission issue."
am: 85e8fd5a24

Change-Id: I6f378dcbbecb9848d02112b2d33c5a0f2d5c9d1f
2019-11-25 06:05:32 -08:00
Lucas Lin
124bb5c9ff Merge "Fix title of PRIVATE_DNS_BROKEN notification when connecting VPN"
am: 82f0c22598

Change-Id: I2df410b6ceb0f9a28ee0f171bb2ff7cadd4cdefb
2019-11-25 05:56:29 -08:00
Bill Lin
00190cf8a6 Merge changes from topic "migrate_CtsStagedInstallTest_RollbackTest"
am: 63e6d6af01

Change-Id: I362c1a03a1f8c106f684cd6a28fe63fbd5532d9c
2019-11-25 05:36:35 -08:00
Richard Uhler
5a6df15108 Increase timeout in testNativeWatchdogTriggersRollback
am: 5f01cb9246

Change-Id: I4677f053787074ef445bba8d18ace8ad66c711ff
2019-11-25 05:36:26 -08:00
Richard Uhler
79e8fcb4ae Fix flaky testEnableRollbackTimeoutFailsRollback test
am: 1d66bf8c48

Change-Id: Id8c792c9a0926fbd7b8e287c6547eb250caca5fb
2019-11-25 05:36:13 -08:00
Oli Lan
170a519878 Wait for available rollbacks in RollbackTest.
am: 77a40731f8

Change-Id: I83b8f07f333e318bb7fd31b2bec3f868b1848c6c
2019-11-25 05:35:57 -08:00
Richard Uhler
a39bd708e4 Update to new RollbackUtils.sendCrashBroadcast API.
am: 3e7ef5ae0b

Change-Id: I518d37f8d2eef80f63c88530ed4aa581c27b9e75
2019-11-25 05:33:56 -08:00
Gavin Corkery
4bcb79bb71 Extend ROLLBACK_COMMITTED broadcast for the multi-user case
am: e92720ddb9

Change-Id: I28bb0d0574c80df5f6d6628bc6026d99770faaf5
2019-11-25 05:33:06 -08:00
Richard Uhler
01178b4f9d Cleanup some obsolete TODOs and unused code.
am: cda1a17516

Change-Id: I56bce126042670678002ddbbfcf14ff9f94860c3
2019-11-25 05:24:46 -08:00
Paul Hu
85e8fd5a24 Merge "Fix hasUseBackgroundNetworksPermission issue." 2019-11-25 08:41:05 +00:00
Lucas Lin
82f0c22598 Merge "Fix title of PRIVATE_DNS_BROKEN notification when connecting VPN" 2019-11-25 08:14:09 +00:00
Bill Lin
63e6d6af01 Merge changes from topic "migrate_CtsStagedInstallTest_RollbackTest"
* changes:
  Add multi-user test for the general non-staged case
  Increase timeout in testNativeWatchdogTriggersRollback
  Fix flaky testEnableRollbackTimeoutFailsRollback test
  Wait for available rollbacks in RollbackTest.
  Include NewRollbacks in result of getAvailableRollbacks.
  Rename RollbackData to Rollback.
  Remove INSTALLED_USERS extra from ACTION_PACKAGE_ENABLE_ROLLBACK.
  Update to new RollbackUtils.sendCrashBroadcast API.
  Extend ROLLBACK_COMMITTED broadcast for the multi-user case
  Fix NullPointerException.
  Cleanup some obsolete TODOs and unused code.
  Test Native Watchdog triggers RollbackManager rollback
  Uninstall testapps before running SecondaryUserRollbackTest
  delete ENABLING rollback if we can't get session info for it.
  Add test for rollback of userdata with multiple rollbacks
  Load rollback data in RollbackManagerServiceImpl constructor.
  Use "commit" for rollbacks instead of "execute".
  Add TestApi to block the RollbackManagerHandlerThread.
  Use Slog in RollbackManager, not Log
  Make setRequestDowngrade @TestApi
  Migrate RollbackTest and StagedRollbackTest to cts utils
  Add .apex suffix to apex files during validation
  Add host side test for secondary user rollback
  Reduce ENABLE_ROLLBACK timeout to 0 for timeout test.
2019-11-25 02:56:10 +00:00
paulhu
86e23ebb47 Fix hasUseBackgroundNetworksPermission issue.
PermissionMonitor#hasUseBackgroundNetworksPermission only uses
the first package name of the uid for checking permission.
This is incorrect since each package declared different
permissions. So using the mApps which already checked both
network and using restricted network permissions. If uid is in
the mApps list that means uid has one of permission at least.

Bug: 135897744
Test: atest FrameworksNetTests
Change-Id: I3500a03ce06b5b822311ad0c67b606ce4039216a
2019-11-24 22:27:32 +08:00
Remi NGUYEN VAN
8a72e3d3b4 Merge "Move shared packages to NetworkStack project"
am: 27253f29ad

Change-Id: I17068de9e9b4388b8ec025ce3e1dc722e471ccbb
2019-11-21 23:15:29 -08:00
Remi NGUYEN VAN
27253f29ad Merge "Move shared packages to NetworkStack project" 2019-11-22 06:50:22 +00:00