summaryrefslogtreecommitdiffstats
path: root/services/tests/servicestests/src/com/android
Commit message (Collapse)AuthorAgeFilesLines
* pm: Avoid installing prebundle to other users that were uninstalled by owner.Adnan Begovic2016-05-171-2/+66
| | | | | | | | | | | Otherwise the copied app data (since these are treated similarily to system packages on user creation) would be purged of the granted permissions in packages.xml. Also, it just doesn't make sense from a users perspective. Change-Id: I9a72eb9a9f0bea9401e90daa86c8fa32e866c380 TICKET: OPO-695
* pm: Update PackageManagerServiceTestsAdnan Begovic2015-12-181-5/+5
| | | | Change-Id: I02428faa2c43a54124fd5295ac101d93b4883228
* Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-072-0/+103
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/base into cm-13.0 Android 6.0.1 release 3 Change-Id: I59b9e5a943e0860d43bcfb36ee0e8b8b072412ea
| * DO NOT MERGE Sync extras bundle comparison can throw NPEMatthew Williams2015-10-201-0/+64
| | | | | | | | | | | | BUG: 23591205 Change-Id: Ic6404c0befe70c34b078e0eae6a627826173d82c (cherry picked from commit 9ad2c8403354a985258c098681067e74b9e2f638)
| * DO NOT MERGE Sanity check loaded periodics and cap runtime.Matthew Williams2015-10-161-0/+39
| | | | | | | | | | | | | | | | | | | | | | BUG: 24900376 We've seen an issue where periodic run times can be massively inflated after loading from disk. As a safeguard, cap the period's loaded runtime to be [p, 2p] from the time of loading. Change-Id: Ie4464490c8d6702fee8efe9190c3da5dc5f013f6 (cherry picked from commit fa8e5084eed63ab8d92c71fcff656690a30293c3)
* | Merge tag 'android-6.0.0_r26' into HEADRicardo Cerqueira2015-11-051-273/+503
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android 6.0.0 release 26 Conflicts: cmds/bootanimation/BootAnimation.cpp core/java/android/accounts/AccountManager.java core/java/android/app/AppOpsManager.java core/java/android/os/PowerManagerInternal.java core/java/android/os/storage/IMountService.java core/java/android/provider/Settings.java core/java/com/android/internal/widget/ILockSettings.aidl core/res/res/values-mcc204-mnc12/config.xml core/res/res/values-mcc219-mnc02/config.xml core/res/res/values-mcc730-mnc07/config.xml core/res/res/values/config.xml core/res/res/values/symbols.xml packages/SystemUI/res/values/config.xml packages/SystemUI/src/com/android/systemui/doze/DozeService.java packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java packages/SystemUI/src/com/android/systemui/statusbar/ExpandableOutlineView.java packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java services/core/java/com/android/server/LocationManagerService.java services/core/java/com/android/server/am/ActivityManagerService.java services/core/java/com/android/server/pm/PackageManagerService.java services/core/java/com/android/server/power/PowerManagerService.java telecomm/java/android/telecom/Phone.java telephony/java/android/telephony/CarrierConfigManager.java telephony/java/android/telephony/RadioAccessFamily.java telephony/java/android/telephony/ServiceState.java telephony/java/android/telephony/SignalStrength.java telephony/java/android/telephony/TelephonyManager.java telephony/java/com/android/ims/ImsCallProfile.java telephony/java/com/android/ims/ImsReasonInfo.java telephony/java/com/android/ims/ImsSuppServiceNotification.aidl telephony/java/com/android/ims/ImsSuppServiceNotification.java telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl telephony/java/com/android/internal/telephony/RILConstants.java Change-Id: I99c6edb8e25a77145b5adef97d0d55bfbe676959
| * am 4f7d0bc7: Merge "Add get_accounts app op" into mnc-devSvetoslav Ganov2015-09-091-3/+3
| |\ | | | | | | | | | | | | * commit '4f7d0bc7af5fbb65796d24b130b7e9e63107bc5d': Add get_accounts app op
| | * Add get_accounts app opSvetoslav2015-09-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For each runtime permission we have an app op to toggle the permission for legacy apps as they cannot handle permission revocations. We were lacking an app op for get_accounts which prevented the user from controlling access to accounts regardelss that they change the state of the permission toggle in the UI. Even worse the permission UI is written with the assumption that every runtime permission has an app op and as a result revoking the contacts group (if the app requests the get_accounts permission) is reset back to allowed in the UI. bug:23854618 Change-Id: I9e3f9bfeb320bed561d718db99ee285915d5701b
| * | Add tests for the PacketKeepalive API.Lorenzo Colitti2015-09-091-0/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | This currently fails in many different ways, but it tells us what to fix. Bug: 22606153 Bug: 23884210 Change-Id: If2e5ee0a8d7b26cad67d3d566ed5b1383e0db096
| * | Use a CountDownLatch instead of sleep() in NetworkFactory tests.Lorenzo Colitti2015-09-081-23/+99
| | | | | | | | | | | | | | | | | | | | | This makes testNetworkFactoryRequests 2-3 times faster. Bug: 22606153 Change-Id: I9657b6929e77f23ec811d0ab57b2ba974f0b6a69
| * | Get rid of shortSleep() in ConnectivityServiceTest.Lorenzo Colitti2015-09-081-39/+118
| | | | | | | | | | | | | | | | | | | | | Instead, use IdleHandler to wait for things to become idle. Bug: 22606153 Change-Id: Ic6ab93ad4d336b40962f9be1096629a44b63ee2f
| * | Make ConnectivityServiceTest a bit more readable.Lorenzo Colitti2015-09-071-218/+45
| |/ | | | | | | | | | | | | | | | | | | | | | | 1. Make TestNetworkCallback a bit smarter and rename it to SingleUseNetworkCallback. This allows us to get rid of all the calls to TestNetworkCallback#getConditionVariable. 2. Delete the commented out code that used to test a ConnectivityService model that has not been used since KK. 3. Remove unused imports, etc. Bug: 22606153 Change-Id: I81a2d0b970d19e5f4515490d8c2f88d416445fa1
* | prebundled: Handle prebundled packages per-user.Adnan Begovic2015-10-281-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add migration step for reading old file to go towards per-user system file structure TICKET: CYNGNOS-1006 Change-Id: I743e8efaa074c9b84291fdc8d3d15763cc39e79d pm: Create per-mcc prebundled install filter. If packages are region locked, avoid installing them for the SKU, otherwise if a package is specified for a mobile country code, allow it to be installed. TICKET: CYNGNOS-912 Change-Id: I69c5be62dff771fc7d3117e9edf65d8ea4150f28 pm: Update PackageManagerSettingsTests. Change-Id: Ib3a23514055935f68f3f3bb4fd2b2d4d495c1132 PackageManager : Extend prebundled logic Instead of specifying which packages to explicitly install, Only install packages if : a) Its in the current mcc's config_region_locked_packages b) Its not region locked by checking config_restrict_to_region_locked_devices Change-Id: I74c13763ef367e16e5e79290a569f3a720b85adc
* | Add get_accounts app opSvetoslav2015-09-081-3/+3
|/ | | | | | | | | | | | | | | | | For each runtime permission we have an app op to toggle the permission for legacy apps as they cannot handle permission revocations. We were lacking an app op for get_accounts which prevented the user from controlling access to accounts regardelss that they change the state of the permission toggle in the UI. Even worse the permission UI is written with the assumption that every runtime permission has an app op and as a result revoking the contacts group (if the app requests the get_accounts permission) is reset back to allowed in the UI. bug:23854618 Change-Id: I9e3f9bfeb320bed561d718db99ee285915d5701b
* Don't mark NetworkRequests restricted when they don't have restricted capsPaul Jensen2015-08-191-2/+1
| | | | | | | | | | Requests without NET_CAPABILITIES_INTERNET and just the default network capabilities should not be marked restricted. Without this fix apps can hit permissions exceptions if they inadvertently make requests without NET_CAPABILITIES_INTERNET. Bug:23164917 Change-Id: I4c7136821315bcb05dfc42ffbc505a5d4f6109e6
* Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-devPaul Jensen2015-08-051-0/+13
|\
| * Fix NOT_RESTRICTED network capability and enforce it.Paul Jensen2015-08-041-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | With this change: 1. NOT_RESTRICTED should be removed from NetworkRequests that bring up special restricted carrier networks (e.g. IMS, FOTA). 2. NetworkRequests without NOT_RESTRICTED require CONNECTIVITY_INTERNAL permission to register 3. Binding sockets to networks without NOT_RESTRICTED requires CONNECTIVITY_INTERNAL permission Bug:21637535 Change-Id: I5991d39facaa6b690e969fe15dcbeec52e918321
* | Stop supporting legacy ConnectivityManager routing methods in M.Lorenzo Colitti2015-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The methods startUsingNetworkFeature, stopUsingNetworkFeature and requestRouteToHost were @removed in all the M preview builds, but internal and external developers have noted that this imposes additional burden for applications that need to work across multiple platform versions because it causes compile-time errors. We switched from @removed back to @deprecated to avoid these problems. In order to effectively deprecate these methods, which are error-prone and insecure, make them throw UnsupportedOperationException if the app's target SDK is M or above. Because there are still one or two places in system code that use these APIs, exempt Process.SYSTEM_UID and the OMA-DM client from the check for now. Bug: 22728205 Change-Id: I790bd32f3aa8067cbb625962a209bb9232f4b58c
* | Fix missing onLost NetworkCallbacks when network loses capabilityPaul Jensen2015-07-281-41/+139
|/ | | | | | | | | | | | | | | | | | | | | If a network no longer satisfies a NetworkRequest, send the onLost NetworkCallback. If it was a real request (not listen) then update the NetworkFactories. To test this change I created a little infrastructure to fake different Internet connectivity probe results during tests. This allowed me to rewrite some of ConnectivityServiceTest's logic for validating networks. This brought to light a couple issues that I had to address to keep tests passing: 1. testUnlingeringDoesNotValidate was relying on a bad side-effect of my old method of ConnectivityServiceTest's logic for validating networks, so I rewrote the test. 2. ConnectivityService was not sending out NetworkCallbacks for WiFi when Cellular was validated. I'm including a fix for this in this CL also. Bug:22220234 Change-Id: I29314f38189817f8b2561a213c4f9e8522696663
* Added sendBroadcastMultiplePermissions methodFyodor Kupolov2015-07-141-0/+5
| | | | | | | | | Added Context.sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) method, which allows an array of required permissions to be enforced. Bug: 21852542 Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
* Revert "Allow array of required permissions in sendBroadcast"Fyodor Kupolov2015-07-141-5/+0
| | | | | | This reverts commit b4e7283c9afd9fb15ebd63f6ce9b75c9c1af658b. Change-Id: Ie8390964bda5bdfa869cee8f46584043d8e7c664
* Allow array of required permissions in sendBroadcastFyodor Kupolov2015-07-141-0/+5
| | | | | | | | Added Context.sendBroadcast(Intent intent, String[] receiverPermissions) method, which allows an array of required permissions to be enforced. Bug: 21852542 Change-Id: I3b8ff258fa9f3249c344bb8093b820b24eef00c0
* Fallback to Cellular if WiFi fails to validatePaul Jensen2015-07-091-4/+207
| | | | | | | | | | | | | Previously, once a network validated, for the purposes of comparing networks to select the default network, we always considered it validated. With this change if a network later fails to validate, we'll take this latest validation result into account. This means if WiFi and cellular are up (e.g. if we recently switched from cellular->WiFi, and cellular is now lingering) and both are validated, but for some reason WiFi fails a validation, cellular will become the default network connection. Bug:20896761 Change-Id: I858aa10c1aaec5cd9032067f960963409107bdb1
* Prepare some ConnectivityService logic for fallback to Cellular changePaul Jensen2015-07-091-27/+81
| | | | | | | | | | | Reduce the duplication of some logic so when falling back to Cellular when WiFi fails to validate is enabled, there's less chance for bugs and failures: 1. De-duplicate several Network vs NetworkRequest matching functions 2. Remove the very tricky nascent logic by adding a simple "lingering" bit. Bug:20896761 Change-Id: I21da9e827eec9cfd6835fcaa650192b9186ed053
* Disallow requesting networks with mutable NetworkCapabilities.Paul Jensen2015-06-231-0/+25
| | | | | | | | | | | | | | | | | It's not clear what it means to request a network with a mutable NetworkCapability like NET_CAPABILITY_VALIDATED or NET_CAPABILITY_CAPTIVE_PORTAL. Presently requesting such a network would fail in a number of different ways: 1. The NetworkFactories would fail to match the request against their filter which doesn't include stateful NetworkCapabilities. 2. If the NetworkFactories did match, they'd bring up networks to try and satisfy the requests, but the networks would not have any mutable NetworkCapabilities initially so they'd be reaped. Because of these problems it's safest to simply disallow these requests. Bug: 21343774 Change-Id: I56303242b81d39b370b8d5d1e32059bfcfc25949
* Merge "Don't send spurious onAvailable NetworkCallbacks when rematching" ↵Paul Jensen2015-06-201-33/+238
|\ | | | | | | into mnc-dev
| * Don't send spurious onAvailable NetworkCallbacks when rematchingPaul Jensen2015-06-191-33/+238
| | | | | | | | | | Bug:21762680 Change-Id: Ia701045dffc666fe75fba0e1771872147e37179a
* | Merge "high-frequency notification stats." into mnc-devChris Wren2015-06-171-1/+6
|\ \
| * | high-frequency notification stats.Chris Wren2015-06-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aggregate and then periodically report stats that are high-frequency because they are driven by app behavior, not user behavior. Reuse the NotificationUsageStats facility. Remove redundant stats. Lessen memory foot print. Enable in-memeory aggregates with small, bounded memory footprint. Bug: 20258744 Change-Id: I87e391419c53917fa13c68a56f8cdb40a7c8e548
* | | Make keysetmgrservice gurantees explicit.dcashman2015-06-151-40/+40
| |/ |/| | | | | | | | | | | | | | | Add exceptions/checks for keysetmgrservice interractions which *should* never happen, but would result in NPE or invalid metadata. Also handle mismatches between package and keyset metadata in packages.xml. Bug: 20128916 Change-Id: Ia0f63f78d232d9d8d9fbe4cd8e6cc3406e5192a7
* | Remove most sleep() calls from ConnectivityServiceTestPaul Jensen2015-06-121-19/+67
|/ | | | Change-Id: I90d2f6811ed1cb84614101200ac377e920bd864a
* Merge "Remove network requests properly." into mnc-devRobert Greenwalt2015-06-111-0/+93
|\
| * Remove network requests properly.Robert Greenwalt2015-06-101-0/+93
| | | | | | | | | | | | | | | | | | | | We used to only remove requests that we'd acted on but that's just wrong. Also adds test case which exposed the problem but passes with the fix. bug:20731384 Change-Id: I581a005560cc71167b857abf2452769399a9e1b7
* | Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDsPaul Jensen2015-06-101-0/+21
|/ | | | | | | | | Overlapping the NetIDs can cause the ConnectivityService instance under test to inadvertently use real networks, for example when NetworkMonitor attempts to validate a network. This fixes test hangs when run on devices with active internet connections. Change-Id: I5e1898953f0117b9f75beccac4a52ae2db173567
* Revive ConnectivityServiceTest and add some tests.Paul Jensen2015-06-041-72/+356
| | | | Change-Id: I44740a7b21cff18ac2a67d09c4d0e597add19ee0
* Fix PackageManagerSettingsTests and add KeySet info.dcashman2015-04-283-149/+327
| | | | | | | | | Add unit tests for the keyset portion of packages.xml. Also fix previously broken test by adding UserManagerService reference. Bug: 19530911 Bug: 19530120 Change-Id: I251fc3e9dc983f1d63f9e84905d3ed0e64843def
* Add KeySetManagerService unit tests.dcashman2015-04-272-0/+988
| | | | | Bug: 19530120 Change-Id: Ie5601f7cafd4b853c6436941cfed48622549d928
* CONNECTIVITY_ACTION is the new _IMMEDIATEErik Kline2015-04-203-21/+21
| | | | | Bug: 20013379 Change-Id: I3e904dc0a0ddb30c7bb8cdb24d0762052ddc59eb
* Wire up GateKeeper to LockSettingsServiceAndres Morales2015-04-131-22/+22
| | | | | | | | | Adds: - Communication to GKService - password upgrade flow - enroll takes previous credential Change-Id: I0161b64642be3d0e34ff4a9e6e3ca8569f2d7c0a
* Use UserHandle instead of int for public APIsFyodor Kupolov2015-04-131-4/+6
| | | | | Bug: 20049349 Change-Id: If5671fb47aa9a3cffebff16787daeae9ca7361e8
* Merge "Added getUserCreationTime to query user/profile creation time"Fyodor Kupolov2015-04-101-36/+73
|\
| * Added getUserCreationTime to query user/profile creation timeFyodor Kupolov2015-04-081-36/+73
| | | | | | | | | | | | | | | | Added public api to query creation time of the user or of a managed profile associated with the calling user. Bug: 20049349 Change-Id: I7f9263fe434233e6f7d4f165c974cab64ca7107c
* | More work on device idle mode and other power stuff.Dianne Hackborn2015-04-091-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add idle mode support to the alarm manager. Introduce a new concept of flags associated with alarms to tell the alarm manager how to treat the alarm -- they allow everything from the alarm that will bring us out of idle mode, to alarms that are allowed when idle or should also bring us out of idle. The standalone boolean is now also a flag. (Note there is currently no protection from user space setting the flags however it wants; I will be working on that in a follow-up change.) When in idle mode, the alarm manager pushes all alarms that shouldn't execute during that time over to a separate list that is not executed until out of idle. To help with this, I reworked a bit how Alarm objects are managed, so that when rebatching or moving between lists we don't have to allocated new objects but can just use the same existing instance. Also tweaked the sync manager to deal with idle mode, which currently just means doing the same thing as when low on storage -- turning off sync. Add new ACTION_CHARGING and ACTION_DISCHARGING broadcasts that apps can listen for to know when the device is actively charging and discharging. These are better than the old POWER_CONNECTED and POWER_DISCONNECTED ones because we only report charging when we actually see that there is enough power being provided to charge the battery (and will report discharging if there is not enough power). The job controller uses these new actions for scheduling jobs that want to run while plugged in. Removed the "stable charging" stuff while doing so, since the new charging state serves as an even better signal for that. Introduced two new process states: FOREGROUND_SERVICE and TOP_SLEEPING. This will allow us to treat foreground services specially (such as still allowing network access to them for background music playback) while not mixing them together with whatever happens to be the top activity while the device is asleep. Also some other small cleanup here and there. Change-Id: I7a9808b578bad6f50deb8e1baf919298512a0d3a
* Support for nested bundles in setApplicationRestrictionsFyodor Kupolov2015-03-301-0/+102
| | | | | | | | | | | | | | | Added new restriction types - bundle and bundle-array. Modified RestrictionsManager.getManifestRestrictions to support new hierarchical restrictions. Added RestrictionsManager.convertRestrictionsToBundle, which enables programmatic conversion from a list of RestrictionEntries to a Bundle. Modified read/write methods for application restrictions in UserManagerService. Added unit tests. Bug: 19540606 Change-Id: I32b264e04d5d177ea5b4c39a8ace5ee0ce907970
* Fix buildSvet Ganov2015-03-281-2/+2
| | | | Change-Id: Ib3fc843ad02ea3a83f03cf1d6b063d4031da51b1
* Fix runtime permissinos toggling and relax XML parsing.Svet Ganov2015-03-281-2/+2
| | | | | | | | | | | | | | 1. Fixed the case where runtime permissons can be toggled by a developer via a system property. 2. Relaxed the runtime permission XML parsing to be more fault toelrant and consistent wiht the reset of the package manager parse code. 3. Fixed a deadlock due to calling in to the activity manager with the package manager lock held to kill an app. Change-Id: I11dfb57ad4d8119baea79227dc2a3fe5e2208515
* Runtime permissions: per user permission tracking.Svetoslav2015-03-231-16/+20
| | | | | | | | | | | | | | | | | | Before all permissions were granted at install time at once, so the user was persented with an all or nothing choice. In the new runtime permissions model all dangarous permissions (nomal are always granted and signature one are granted if signatures match) are not granted at install time and the app can request them as necessary at runtime. Before, all granted permission to an app were identical for all users as granting is performed at install time. However, the new runtime model allows the same app running under two different users to have different runtime permission grants. This change refactors the permissions book keeping in the package manager to enable per user permission tracking. The change also adds the app facing APIs for requesting runtime permissions. Change-Id: Icbf2fc2ced15c42ca206c335996206bd1a4a4be5
* resolved conflicts for merge of b6b9fe21 to masterAndreas Gampe2015-03-131-1/+0
|\ | | | | | | Change-Id: If4f62aa1fd8bb774288a677e7008e86a7e3ea6d9
| * Remove dead code, mostly DataStateTracker.Paul Jensen2015-03-111-1/+0
| | | | | | | | Change-Id: I1433937bffdb29bd42fb1adbfcf0a50ceffac7dd
* | Remove deprecated version of setProfileOwner that takes packageNameEsteban Talavera2014-12-242-11/+23
|/ | | | | | | The ComponentName equivalent should be used instead. Bug: 17654371 Change-Id: I7001e86ab1709b824944148a3c44af5243dacb83