Commit Graph

16710 Commits

Author SHA1 Message Date
Makoto Onuki
b03866ee72 Merge "System APIs for telephony to expose/obtain binder services" 2019-12-13 20:02:36 +00:00
Ying Xu
3ddd328c9a Merge "Expose the onCarrierPrivilegedAppsChanged as SystemApi" 2019-12-13 18:58:13 +00:00
Carmen Agimof
79dc7ed61e Merge "Do not try to do a restore at install if the user is not ready for backup." 2019-12-13 16:41:21 +00:00
Mark Renouf
364568f6f7 Merge "Mark TaskEmbedder#setListener as public" 2019-12-13 15:59:07 +00:00
Galia Peycheva
a4aff1e1df Merge "Add minimal post processing API to framework" 2019-12-13 10:09:00 +00:00
Songchun Fan
6cde9d9ada add DataLoaderManagerService to system server and register to system service
Test: boots
Change-Id: I9cba99327da012b6f6de898ad1c5cc7cf11d1d31
2019-12-13 00:07:17 +00:00
Jeffrey Huang
cd5c5990d2 Merge "Rename IStatsManager to IStatsd" 2019-12-12 21:47:47 +00:00
Zimuzo Ezeozue
fe30cb6f17 Merge "Revert "Remove the rename() interceptor"" 2019-12-12 20:20:03 +00:00
TreeHugger Robot
6137064d41 Merge "Add admin consent cross-profile package APIs" 2019-12-12 19:53:16 +00:00
Carmen Agimof
4e55418864 Do not try to do a restore at install if the user is not ready for
backup.

Bug: 144155744

This solves a bug which makes staged installs hang. This is
happening because when installing, the PackageManager is waiting for a response to be sent back from
the BackupManagerService after it finishes restoring. In the case of staged installs which happen at boot,
isUserReadyForBackup is false, so the method does nothing and the
PackageManager keeps on waiting on a response.

Test: 1) atest RunBackupFrameworksServicesRoboTests and atest AutoRestoreHostSideTest
2) Manual:
   - Applied ag/9722795
   - run `atest com.android.tests.rollback.host.StagedRollbackTest#testStagedInstallHang`
   - The log file doesn't contain any "Watchdog: *** WATCHDOG KILLING SYSTEM PROCESS: Blocked in handler on main thread (main)".

Change-Id: I294c309b0c7e5a9e12bdbd0c3fc4946767f91cee
2019-12-12 16:29:00 +00:00
Automerger Merge Worker
8dfaccfcaa Merge "Handle multiple phoneIds in time detection" am: 51c61e8bdb am: 1602545f28 am: 161d1764c8
Change-Id: I49c060f1369d382f82d91f729d8fd099d4a217d4
2019-12-12 12:47:51 +00:00
Zim
e59cb735f3 Revert "Remove the rename() interceptor"
This reverts I0f9ac456104759887c0410fe64acc32cab19b62b

And adds an additional check to only fallback handle the EXDEV
from paths on /storage

We are bringing back the interceptor because the implementation of
scoped storage in R uses a FUSE filesystem mounted on /sdcard with an
sdcardfs filesystem mounted on /sdcard/Android/<package> (for now,
just /sdcard/Android in Ic17a5751b5a94846ee565ff935644a078044ab06)

Test: atest
android.appsecurity.cts.ExternalStorageHostTest#testExternalStorageRename
with FUSE enabled passes
Bug: 135341433
Change-Id: I7876bfe00890f24559576f260ba456afb07e9482
2019-12-12 12:40:51 +00:00
Automerger Merge Worker
161d1764c8 Merge "Handle multiple phoneIds in time detection" am: 51c61e8bdb am: 1602545f28
Change-Id: I75551184a50e7bfe9cebd9b649bfd71acf5ac0f7
2019-12-12 12:27:01 +00:00
Jeffrey Huang
161c075d99 Rename IStatsManager to IStatsd
Bug: 146075178
Test: CTS/GTS tests
Change-Id: I235944758b8cc24a0df85b54d7441e7e8d0a8bbc
2019-12-11 15:49:03 -08:00
yinxu
0016eefe11 Expose the onCarrierPrivilegedAppsChanged as SystemApi
Bug: 145944877
Test: N/A
Change-Id: I0fd32f38587ae46d1d170bc8353d23bbc9928cd0
2019-12-11 11:54:39 -08:00
Mark Renouf
366cc85eaf Mark TaskEmbedder#setListener as public
This is needed to integrate directly with TaskEmbedder.

Change-Id: Icb685a711011b997f7e2a02013029cf4bdbef76f
2019-12-11 12:15:24 -05:00
Ruslan Tkhakokhov
72cb5517dd Merge "Pass excluded keys to the backup agent in onRestore" 2019-12-11 16:23:34 +00:00
Ruslan Tkhakokhov
d7f5fdb43b Pass excluded keys to the backup agent in onRestore
Pass the list of the keys excluded from KV restore to the backup agent to make it aware of what data has been removed (in case it has any application-level consequences) as well as the data that should be removed by the agent itself.

Bug: 145126096
Test: atest CtsBackupTestCases
Change-Id: I34415b149b379fb5bb67b0fbcd70ec9b9858acfe
2019-12-11 13:43:32 +00:00
Martijn Coenen
d5a091a424 Merge "Disable resetting OP_LEGACY_STORAGE" 2019-12-11 09:22:18 +00:00
TreeHugger Robot
648fb1d9b0 Merge "Isolate mAnimationCompleteLock from mSync." 2019-12-11 00:49:19 +00:00
Alex Kershaw
434a224cb3 Add admin consent cross-profile package APIs
Add DevicePolicyManager#setCrossProfilePackages and
DevicePolicyManager#getCrossProfilePackages. This provides admin consent
for apps that can ask for user consent to communicate cross-profile.

Some Javadoc can be improved once all CLs are in, since different APIs
should refer to each other.

BUG: 136249261
BUG: 144577776
BUG: 141690885
BUG: 145970297
TEST: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: I3f931bb7c1d5e490d04e5450f3010465ed6a5dc6
2019-12-10 20:06:13 +00:00
Neil Fuller
312da9b9fc Handle multiple phoneIds in time detection
Android has dual sim devices, which means multiple "phone" time
signals. NITZ is generally trusted and considered "good enough" in the
absence of better signals, but it is provided by carriers and it's not
unusual for the signals to be incorrect by minutes. We don't want the
device system clock just flicking to the latest signal received.

The changes to the SimpleTimeDetectorStrategy try to balance recency and
provide some consistency / determinism. See comments in the code for
details. The time zone detection works in a similar way, particularly
with respect to choosing the lowest phoneId in the event of a tie.

There will be a follow-up change to remove the word "Simple" from
SimpleTimeDetectorStrategy as it no longer applies.

Test: atest services/tests/servicestests/src/com/android/server/timedetector/SimpleTimeDetectorStrategyTest.java
Test: atest android.app.timedetector
Bug: 140712361
Change-Id: I228aff8709eabfcec910af22f7ab08fee32d566a
2019-12-10 19:15:38 +00:00
Automerger Merge Worker
e08205b609 Merge "track and report packages with undecorated remoteviews" into qt-qpr1-dev am: 1eb5828022
Change-Id: I24e5eeecdac3a9d72d73fb5bca9cdc7ec202f94c
2019-12-10 18:59:17 +00:00
wilsonshih
29fd42c9d7 Isolate mAnimationCompleteLock from mSync.
Sometimes the test fail because activity starts for more than 5
seconds, and it seems only happen when calling startActivitySync
and running for split screen tests.

If there are two activities A and B are running in the same
process. Consider the following sequence:

1. Start ActivityA then move it to primary split screen.
2. Start ActivityB with startActivitySync, it would launched on
second split screen and wait for enter animation complete.
3. Resume ActivityA naturally, but since ActivityB is blocking mSync
in waitForEnterAnimationComplete, performResume for ActivityA would
waiting for mSync on main thread.
4. Animation complete, scheduleEnterAnimationComplete for ActivityB,
however ENTER_ANIMATION_COMPLETE cannot be executed due to main
thread was blocked.
The deadlock occurs until mAnimationCompleteLock timeout.

Note: There is also another case where the first activity is started
more than 5 seconds at the beginning of the test.

Bug: 127741025
Test: atest ActivityThreadTest
Test: atest android.server.wm.lifecycle
Change-Id: I8b4fe44f962dd31d130ee6b38dabf6e0c90b4060
2019-12-10 13:19:31 +08:00
Makoto Onuki
6b0a7b86dc System APIs for telephony to expose/obtain binder services
Bug: 142255256
Bug: 112725883
Test: Boot
Change-Id: Ia02384689b6b5ecb19db27d91d03f06ae2543b91
2019-12-09 16:44:45 -08:00
TreeHugger Robot
6a26ddcafc Merge "Move WindowControllerCallback methods into a delagate." 2019-12-09 23:51:21 +00:00
Chester Hsieh
5aa92326c4 Merge "Add package name to DDM APNM packet" 2019-12-09 22:41:02 +00:00
Chris Wren
bc487b5759 track and report packages with undecorated remoteviews
print query results with:
  adb shell dumpsys notification --remote-view-stats

test the pulled atom with:
  make statsd_testdrive
  ./out/host/linux-x86/bin/statsd_testdrive 10066

Bug: 144855217
Test: atest frameworks/base/services/tests/uiservicestests/src/com/android/server/notification
Change-Id: I6dcc9871f78298a8b213a051223c7316f8feefc5
Merged-In: I773378fc7cfb47a9f9c7495404ddafa63f39cfaf
2019-12-09 15:48:14 -05:00
Chris Wren
cdea3b7009 track and report packages with undecorated remoteviews
print query results with:
  adb shell dumpsys notification --remote-view-stats

test the pulled atom with:
  make statsd_testdrive
  ./out/host/linux-x86/bin/statsd_testdrive 10066

Bug: 144855217
Test: atest PulledStatsTest
Change-Id: I773378fc7cfb47a9f9c7495404ddafa63f39cfaf
2019-12-09 12:18:18 -05:00
Roshan Pius
3f9ba67fa7 Merge changes from topics "suggestion_no_uid_package", "wifi_key_value_list_parser", "wifi_power_profile", "wifi_service_manager_getService", "wifi_westworld"
* changes:
  statsd: Allow wifi mainline module to log its metrics
  wifi-services-srcs: Stop using KeyValueListParser from android.internal
  WifiNetworkSuggestion: Don't store packageName/uid
  WifiAwareManager: Add requestMacAddresses @hide API
  UserManager: Add StringDef for all restrictionKey values
  WifiActivityEnergyInfo: Use time values for energy calculation
2019-12-09 17:08:30 +00:00
Alex Johnston
b6bcf30de9 Merge "Call setCameraDisabled and getCameraDisabled on the parent profile" 2019-12-09 15:37:01 +00:00
Alex Johnston
755e377c4a Call setCameraDisabled and getCameraDisabled on the parent profile
Previously, these APIs did not support explicitly querying the parent profile.
This CL allows the WP DPC to now call these methods, which means the WP DPC
can disable the camera device-wide and not just for the WP.

Bug: 138709470
Test: manual testing using Personal and WP TestDPC and Camera
      atest com.android.cts.devicepolicy.ManagedProfileTest
      atest com.android.server.devicepolicy.DevicePolicyManagerTest

Change-Id: I7e7ce7be766850c6e2f58c72a0a44990817e9b73
2019-12-09 14:08:03 +00:00
Rubin Xu
feeeb6538e Merge "Kill off untrusted password reset" 2019-12-09 10:29:24 +00:00
Rubin Xu
d952240979 Kill off untrusted password reset
Time has come that we can finally ditch untrusted password reset i.e.
changing lockscreen password without providing the existing password or
an activiated password reset token. In this change, we are:

1. Preventing any DPC / legacy device admin from invoking
DPM.resetPassword(), the primary route to invoke untrusted password
reset. Depending on their target SDK level, resetPassword() will either
throw SecurityException, or fail silently.
2. Still allowing privilleged app holding RESET_PASSWORD permission to
call this API, but it's limited to setting a new passowrd on an
unsecured device.
3. Removing synthetic password caching mechanism in LockSettingsService,
whose sole purpose was to support untrusted password reset.

Bug: 137939224
Test: atest com.android.server.locksettings
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ie3e5e277984b6fc2f1d378880363028752bad775
2019-12-08 22:01:01 +00:00
Chester Hsieh
ab720ee161 Add package name to DDM APNM packet
DDM APNM currently only reports the application/process name. For
services that need to know the underlying package name, those
services need to manually resolve the process's UID and map it to
the package name via the shell - a slow and error-prone process.

This change adds the package name to the APNM packet so users of
newer versions of DDMLib can directly get the package name.

Test: manual

Change-Id: I92517d5bb641cc263c0d58db667b00e67fc5e58b
2019-12-06 15:59:12 -08:00
Roshan Pius
3eac0b9158 UserManager: Add StringDef for all restrictionKey values
Based on API council feedback for the recently added
hasUserRestrictionForUser API.

Bug: 144924593
Test: Compiles
Change-Id: Ib78c334d48a57c2e97f8f1b29d7d663d3eb2f1c1
2019-12-06 15:34:26 -08:00
Ruchir Rastogi
cd9dd94fb1 StatsEventParcel impl.; move AIDL files
This implementation continue to uses libbinder, as opposed to
libbinder_ndk.

We also move many (but not all) statsd aidl files from
frameworks/base/core into the apex.

Test: m -j128 && bit statsd_test:*
Change-Id: I95f06e937e50c1e2a638163b13587682402956a7
2019-12-06 14:08:27 -08:00
Jeffrey Huang
77db950964 Merge "Rename writeToProto to be dumpDebug" 2019-12-06 18:53:15 +00:00
Galia Peycheva
ea9457585a Add minimal post processing API to framework
This API allows applications to instruct the connected display to do minimal
post processing on the produced image or video frames. This will switch the
display to a low latency mode (ALLM, Game mode or some other custom
implementation thereof), reducing lag in the final images. Thus, minimal post
processing would greatly enhance performance for gaming and video
conferencing applications. It would not, however, suit applications that
prioritise image quality over performance.

This CL adds 2 public method:
 - Window.setPreferMinimalPostProcessing()
(this can also be set in WindowManager.LayoutParams.preferMinimalPostProcessing)
If minimal post processing is preferred, the connected display will be requested
to go into low latency mode, which reduces image processing, resulting in better
performance for gaming applications. If the Display sink is connected via HDMI,
the device will begin to send infoframes with Auto Low Latency Mode enabled and
Game Content Type. This will switch the connected display to a lower latency
mode (if available).
For more information, see HDMI 2.1 specification.

If the Display sink has an internal connection or uses some other protocol than
HDMI, effects may be similar but implementation-defined.

 - Display.isMinimalPostProcessingPreferred()
Returns true if the connected display supports either Low Latency Mode (ALLM or
some other custom low latency implementation) or Game content type.

Bug: 135116095

Test: make -> flash on ATV OTT device -> open an activity which requests minimal
post processing -> check SurfaceControl logs -> verify correct signals are
passed to native

Change-Id: Id09160ba1513fef4dac979162bcda3bfeaace0e6
2019-12-06 15:20:02 +01:00
Neil Fuller
ba5a0dfa5b Merge "TimeDetector improvements" am: 6e3020490d am: c72f796176
am: c186f60e8c

Change-Id: I544b8e79ae31a478e3a8bad171db6e2bde63afff
2019-12-06 04:14:27 -08:00
Neil Fuller
c186f60e8c Merge "TimeDetector improvements" am: 6e3020490d
am: c72f796176

Change-Id: I76a5726953cd6dc7998e298c9d41e86a3b4f7c00
2019-12-06 04:08:26 -08:00
Neil Fuller
6e3020490d Merge "TimeDetector improvements" 2019-12-06 11:53:14 +00:00
Mathew Inwood
d69738602a Move WindowControllerCallback methods into a delagate.
Adding @hide public methods to commonly subclassed classes like Activity
is never safe, as they can clash with existing methods in apps. Moving
@hide interface implementations into an inner class avoids the need to
add new @hide public methods in many cases.

Bug: 144361565
Test: Build, flash, boot device.
Change-Id: Ie8459c5a542e6ff4058d4ce783e27ebcf9c41dbb
2019-12-06 10:32:17 +00:00
Peter Wang
5b0ee657e0 Merge "[Telephony Mainline] Refactored grantDefaultPermissionsToActiveLuiApp and revokeDefaultPermissionsFromLuiApps from PermissionManagerService to Permmission Manager" 2019-12-06 05:32:51 +00:00
TreeHugger Robot
14ec7e5938 Merge "StatsManager uses private object for synchronizing" 2019-12-06 04:01:35 +00:00
Tej Singh
2cf3ae3f06 StatsManager uses private object for synchronizing
StatsManager used to synchronize on "this", which is dangerous because
an app can get StatsManager and also sychronize on it, which would block
all calls. We now lock on a private final object.

Test: make
Bug: 144315658
Fixes: 144315658
Change-Id: Ia34b1c586b09a48b244cc16dba77fe54e81f62cf
2019-12-05 18:42:30 -08:00
TreeHugger Robot
cf87cafa19 Merge "Bug report handler app via Bug Report Shortcut" 2019-12-06 01:45:31 +00:00
Paul Chang
c40f578d02 Bug report handler app via Bug Report Shortcut
- Send intent (android.internal.intent.action.BUGREPORT_REQUESTED) to bug report handler app after pressing Bug Report Shortcut
- Add config "config_bugReportHandlerEnabled" to enable this feature
- Add config "config_defaultBugReportHandlerApp" to get the package of default bugreport handler app
- Add settings CUSTOM_BUGREPORT_HANDLER_APP to get the package of custom bugreport handler app
- Add settings CUSTOM_BUGREPORT_HANDLER_USER to get the user id of custom bugreport handler app

BUG:142921485
Test: After pressing Bug Report Shortcut in manual local test:
- the intent can be sent to bugreport handler app.
- the intent can be sent to Shell if the chosen and the default bugreport handler app can't handle it.
- the intent can be sent to system user profile's default bugreport handler app if the custom profile(like work profile) is removed.
Change-Id: Idc33b47f0cc65b90cbf648bda54a1d900fef007a
2019-12-06 05:52:09 +08:00
Peter Wang
56dec3f134 [Telephony Mainline] Refactored grantDefaultPermissionsToActiveLuiApp
and revokeDefaultPermissionsFromLuiApps from PermissionManagerService to
Permmission Manager

Bug: 142019744
Test: Build
Change-Id: Ic39e1a66b650e7969242eb2116f342de488b1ca6
2019-12-05 13:23:02 -08:00
Jeffrey Huang
cb78285b81 Rename writeToProto to be dumpDebug
We want to eventually migrate some of these APIs to be @SystemApi for mainline modules.
The #dumpDebug name is more appropriate than #writeToProto.

Bug: 142279786
Test: Manual
Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f
2019-12-05 11:28:11 -08:00