Commit Graph

16466 Commits

Author SHA1 Message Date
Rob Carr
a249166839 Merge "Clear opaque flag when surface insets change." into nyc-dev 2016-04-27 02:53:25 +00:00
TreeHugger Robot
1415d26786 Merge "Don't hold lock when calling externally" into nyc-dev 2016-04-27 01:45:13 +00:00
Chong Zhang
08eb8a1aa2 Merge "Finish immediately if the resumed activity is already visible" into nyc-dev 2016-04-27 01:08:17 +00:00
TreeHugger Robot
97ef0e77af Merge "Don't override pre-release target sdk" into nyc-dev 2016-04-27 00:53:19 +00:00
Robert Carr
b80d781f1d Clear opaque flag when surface insets change.
In addition to the pixel format there is an extra
force opaque flag. We only update this on creation,
but we need to respond to changing SurfaceInsets forcing
an otherwise opaque surface to become translucent.

Bug: 27364161
Change-Id: I13c69d1271412a0bc71e936867c58d5c413ab56b
2016-04-26 17:42:42 -07:00
TreeHugger Robot
fc5f6e6c80 Merge "Fix two multi-user bugs in package upgrade." into nyc-dev 2016-04-27 00:39:42 +00:00
TreeHugger Robot
e542e0cb9b Merge "Set installed flag of all users if system app is installed later" into nyc-dev 2016-04-27 00:32:41 +00:00
Rob Carr
4f40766360 Merge "Touch region fixes for dialogs and overlapping tasks." into nyc-dev 2016-04-27 00:29:59 +00:00
Todd Kennedy
d5e295f919 Don't hold lock when calling externally
Wound up in a deadlock. We held mPackages lock and called the mount
service. This called into the AppOps service which tried to obtain
its lock. On another thread, we held the AppOps service lock which
called into PackageManager service and tried to take mPackages.

Ideally, we'd never hold an internal lock when calling externally.
In practice, that's not always fixable [for example, code change
would be too great to not hold the AppOps lock when calling into
the PackageManager service].

Bug: 28169075
Change-Id: If0a7f1361c7be9385b1f629f68ebc0556b08ab06
2016-04-26 17:06:38 -07:00
Chong Zhang
b60a830f8b Merge "Request a wallpaper update pass when wallpaper target is set to visible" into nyc-dev 2016-04-26 23:29:40 +00:00
Chong Zhang
83c4135a3a Merge "Do not set waitForDebugger if the process to be debugged already started" into nyc-dev 2016-04-26 23:28:06 +00:00
Todd Kennedy
b107271813 Don't override pre-release target sdk
If a package targets a pre-release SDK [eg a letter version] it should not
be allowed to be upgraded by a release SDK [eg a number version]. If one
absolutely must upgrade to a release SDK, use the "--force-sdk" option
during install.

Bug: 28345311
Change-Id: Ic9fb209968e7c5da2c80c5ca4c0f44f5125f610a
2016-04-26 16:25:43 -07:00
Chong Zhang
efd9a5ba01 Finish immediately if the resumed activity is already visible
When in FINISH_AFTER_VISIBLE mode, we need to check visibility of
both the current activity, and the activity to be resumed. If the
resumed activity is already visible, we should finish immediately.
We can't put it into stopping state and wait because there won't be
a window visible callback from the next activity.

bug: 28378359

Change-Id: Ib1fb44acfec33616da76f48102cc00b453e41914
2016-04-26 16:24:24 -07:00
Jeff Sharkey
e75c0b9873 Fix two multi-user bugs in package upgrade.
When upgrading a package, we need to fill in the "origUsers" field
so that we can clone the installed state correctly.  This was done
for child package, but never set for the parent package.

Also fix a bug where a secondary user requested a package to be
moved.  Because that move was pushed onto a Handler, the calling
userId appeared to be the device owner instead of the user that
actually requested the move.  (Later in the upgrade flow there is
code that force-installs the package for the requesting user.)

Bug: 26729822
Change-Id: I2d2a007c73558f29a3f8c1408ec373fce6e87761
2016-04-26 17:01:42 -06:00
Shreyas Basarge
8fcf6a6922 Merge "Account info on job wakelocks" into nyc-dev 2016-04-26 22:36:47 +00:00
Ruben Brunk
f84b3e0e2f Merge "Add manifest attribute for VR activities." into nyc-dev 2016-04-26 22:05:30 +00:00
Chong Zhang
55c9d73918 Do not set waitForDebugger if the process to be debugged already started
For non-persistent debug settings, mDebugApp and mWaitForDebugger flags
will only be restored when we get attachApplication. If the process is
already running, we can't wait for debugger and there will be no
attachApplication calls coming.

We should leave the settings unmodified, otherwise after two such calls,
both mDebugApp and mOrigDebugApp will point to the same app, and the
debug settings can never be restored.

bug: 27931552
Change-Id: Id53e21bbe154f45bf2ca12bb5d7fd56279bae653
2016-04-26 12:29:14 -07:00
Svetoslav Ganov
f71d7feef2 Merge "Ensure local settings caches are not stale" into nyc-dev 2016-04-26 18:36:28 +00:00
Svet Ganov
53a441ca8e Ensure local settings caches are not stale
We used the system proterties as a shared memory mechanism
to propagate information to local settings caches when the
content has changed and the cache should be cleared. The
system properties are unfortunately updated asynchronously
leading to cases where clients may read stale data.

This change adds a simple int array data structure backed
by shared memory which guarantees individual values are
atomically read and updated without memory tear. Multi-
index opearations are not synchronized between each other.

The settings provider is using the new data structure to
propagate the settings generation which drives when caches
are purged.

We have a single memory array keeping the generation for
different settings tables per user. Since memory array is
not a compact data structure and the user space exceeds
the memory array size we use an in-memory map from keys
to indices in the memory array where the generation id of
a key is stored. A key is derived by the setting type in
the 4 most significant bits and the user id in the 28 least
significant bits.

The mapping from a key to an index is cleared if the user is
removed and the corresponding index in the memory arry is
reset to make it available for other users. The size of the
memory array is derived from the max user count that can be
created at the same time.

bug:18826179

Change-Id: I64009cc5105309ef9aa83aba90b82afc8ad8c659
2016-04-26 11:31:55 -07:00
Eino-Ville Talvala
e9bfc4e20b Merge "SchedulingPolicyService: Fix UID for cameraserver" into nyc-dev 2016-04-26 18:21:43 +00:00
Kenji Sugimoto
ea3064a586 Set installed flag of all users if system app is installed later
If an application(in /data) that other user installed it initially
is appended as system app later, owner user can not use the system app.

The reason this issue occurs is that the owner user's installed flag
is set false when the application was installed by other user
and the installed flag is not updated when the application is appended
as system app later.

So, we fix like as setting the installed flag to true
when the application is appended as system app.

Bug: 28183865
Change-Id: I0b4da5e0bb77fb3baf86d0453e6637a230b104ba
2016-04-26 10:55:30 -07:00
Chong Zhang
4d7369adb3 Request a wallpaper update pass when wallpaper target is set to visible
Usually wallpaper target gets updated when some wallpaper target window
finishes drawing. However in some cases, Recents app could be set to
visible again before its stopped. (Which could happen when we started
opening transition into some app with a saved surface, but the app draws
so slow so that when user pressed Recents button again, the app still
hasn't delivered first frame.) In this case, the surface is already
drawn and we won't get a finish drawing again. We need to make sure the
wallpaper target is updated.

bug: 27742244
Change-Id: I8ff53f15f95bae8a99a5a0fd11e24e0186dc3345
2016-04-26 10:36:07 -07:00
Liejun Tao
39fb5670a8 Bluetooth: Fine tune audio gain for Absolute Volume case
Fine tune the audio gain for Bluetooth Absolute Volume.
Use 50%, 70% and 85% for lowest volume steps 1, 2 and 3.
Thus the volume change sounds smoother, more linear.
When remote end tune volume out of mute, we should also
tune the audio gain for the lowest volume steps.

Bug: 26694114
Change-Id: I298a334a4b40ddb87495fda1935349bfce8b0537
2016-04-26 09:19:17 -07:00
Chris Wren
6392db9df7 Merge "cancel group children before summaries" into nyc-dev 2016-04-26 15:26:35 +00:00
David Brazdil
3eaf72dc67 Merge "Change app selection policy for post-OTA verification" into nyc-dev 2016-04-26 12:22:16 +00:00
David Brazdil
90e269917e Change app selection policy for post-OTA verification
Changes the policy for selecting packages which will be pre-verified
during post-OTA boot animation.

For Nx to Ny, an app is pre-verified if used in the foreground in the
last 7 days, or if its APK was loaded by other apps.

For M to N (or early N builds without detailed stats), an app is
pre-verified if it has any recorded use in the last 7 days.

Bug: 27902702
Bug: 27350503
Change-Id: I2b38daf017ecd0e5aa5ed596ed9351cffa03dbcb
2016-04-26 12:51:53 +01:00
David Brazdil
5bc7f5f01b Merge "Enable profile merging for post-OTA package verification" into nyc-dev 2016-04-26 11:39:43 +00:00
David Brazdil
5da9dad2dd Enable profile merging for post-OTA package verification
Currently post-OTA verification will attempt to compile with
'verify-profile' but does not merge the profiles prior to calling
dex2oat. As a result, we may miss some or all classes that need
verification.

Bug: 27688727
Change-Id: I1aa93cad2686513594cb37f6d3d181ae5c718d1d
2016-04-26 11:37:49 +00:00
TreeHugger Robot
e12d62bd79 Merge "WebView downgrade prevention logic" into nyc-dev 2016-04-26 09:31:57 +00:00
Shreyas Basarge
eda34e4d96 Account info on job wakelocks
Adds account information to wakelock
names for JobScheduler jobs.

Bug: 28321515
Change-Id: Ifaf289c2a9a11843769a3b40eea57d93dbd7d075
2016-04-26 10:28:44 +01:00
Shreyas Basarge
a16a3362b5 Merge "Wait for JobService to start before scheduling syncs" into nyc-dev 2016-04-26 09:23:30 +00:00
Lorenzo Colitti
b414eb8de6 Merge "Close open sockets when enabling firewall rules." into nyc-dev 2016-04-26 08:52:26 +00:00
Jaewan Kim
bdc4700155 Merge "PIP: Send KEYCODE_WINDOW to app first if PIP isn't exist" into nyc-dev 2016-04-26 06:03:01 +00:00
Lorenzo Colitti
4cb4240b4d Close open sockets when enabling firewall rules.
When enabling a firewall rule that will deny networking to apps,
first close any sockets opened by those apps. Just dropping an
app's packets without closing its connections  has the following
problems:

1. The app has no way to know this has happened until a network
   timeout occurs.
2. The app's connections stay open, so the other end of the
   connection (e.g., a server) might continue to retransmit
   packets. These packets will wake up the kernel and cause
   battery drain, but we cannot respond to them because packets
   on those connections are dropped by the kernel (since the app
   is blackholed). So the other end might keep retransmitting.
3. Even though we think the connections are still open, the
   other end of the connection, or any intermediate NATs or
   firewalls, might time out and close the connection (e.g., by
   sending a RST). Because the app is blackholed, we have no way
   of knowing that this has happened, so when the app is granted
   network access again, these connections might just get stuck.

Bug: 27824851
Bug: 27867653
Change-Id: Iaaad1b26954fc5f1ba5c9ed8bdee039282f5e249
2016-04-26 13:39:08 +09:00
Jaewan Kim
f0fd218382 PIP: Send KEYCODE_WINDOW to app first if PIP isn't exist
Bug: 27954955
Change-Id: I517e378d5c1672ac0eb87bdf4375b7d733276e58
2016-04-26 13:06:21 +09:00
Jorim Jaggi
c5804afa73 Fix a few issues with occluded Keyguard
- When we get a collapse before the layout happened in SystemUI,
don't expand the panel after the layout.
- Don't reset waitingToShow when coming out of sleep. This will cause
win.isVisibleOrBehindKeyguardLw to return false and then occluded
state will change rapidly from true -> false -> true, leading to
flickering in SysUI.

Bug: 23898941
Change-Id: I2b941188de777086bb2b477f5bfc00cc0cd6abe0
2016-04-26 02:54:34 +00:00
TreeHugger Robot
72c216f250 Merge "Don't hide app windows due to not showing when locked when keyguard is hidden" into nyc-dev 2016-04-26 02:21:18 +00:00
Wale Ogunwale
23fd1db68d Don't hide app windows due to not showing when locked when keyguard is hidden
This worked in pre-N because the only visible app was the app that can be
shown when the keyguard is hidden. That isn't the case in multi-window mode
where one of the apps can be shown when locked and the other doesn't have
the show when locked flag. Only hide the other app if the keyguard is shown.

Bug: 28368875
Change-Id: I5039098db74492fadf667fed24fc58448436681a
2016-04-25 17:21:34 -07:00
Makoto Onuki
711ffe620e Merge "When app is updated, save the new version code, and update shortcuts with resource based icons." into nyc-dev 2016-04-26 00:07:59 +00:00
Eino-Ville Talvala
1f677fdeae SchedulingPolicyService: Fix UID for cameraserver
Cameraserver has been split from mediaserver, so need to use
its UID for determining whether to grant scheduling priority
change requests.

Bug: 28246165
Change-Id: I87b96e9fe0c0c38ec994d3d2aa131668d3d66986
2016-04-25 17:05:03 -07:00
Shreyas Basarge
a4ac5ab850 Wait for JobService to start before scheduling syncs
Add code to wait for SycJobService to pass back an
instance of itself after boot before allowing syncs
to be scheduled. 

Also removes unused constant MESSAGE_SYNC_EXPIRED.

Bug: 28380795
Change-Id: I616ba5c74578a81ff1e37ba4bd1fd937ce5c006d
2016-04-25 23:04:32 +00:00
TreeHugger Robot
b59beffa89 Merge "Fixed issue with wrong stack fullscreen state on configuration change" into nyc-dev 2016-04-25 22:27:58 +00:00
Jeff Sharkey
436308f88b Merge "Destroy both CE and DE data when corrupted." into nyc-dev 2016-04-25 21:59:59 +00:00
Amith Yamasani
1d66995f47 Merge "Fix deadlock between VrManager, ActivityManager and WindowManager" into nyc-dev 2016-04-25 21:37:17 +00:00
Chong Zhang
98afb342df Merge "Wait for next app to be visible if current activity is marked visible" into nyc-dev 2016-04-25 21:13:29 +00:00
Wale Ogunwale
5952f9aea4 Fixed issue with wrong stack fullscreen state on configuration change
- No need to run TaskStack#updateBoundsAfterConfigChange if the stack
is fullscreen as the bounds will already be updated to when the display
content changed due to rotation.
- Correctly set mTmpRect2 that we are using to calculate the rotated
bounds to the current mBounds.

Bug: 28319277
Bug: 27870534
Change-Id: Ic3d9407b735210351c28297de79bf035909afcfe
2016-04-25 14:04:04 -07:00
Chris Wren
076bddde4b cancel group children before summaries
Bug:28190616
Change-Id: I1b716417119cfa3f4ffdd159ab5197cbfa714a8d
2016-04-25 16:44:53 -04:00
Ruben Brunk
f56c9f432b Add manifest attribute for VR activities.
- Allow jank-free VR->VR activity transitions, even during
  long activity transitions.

Bug: 28115931
Change-Id: I1e3fd1a5245bac3433ea6282cb1c7a71f0e0266f
2016-04-25 13:32:03 -07:00
Chong Zhang
592bf0b7d5 Wait for next app to be visible if current activity is marked visible
WM's AppWindowToken.updateReportedVisibilityLocked() may not report
nowVisible if the app has animation set. So nowVisibible could be false
for a while after the app is already on screen. If we finish the app in
this state, we still need to wait for next app to be visible.

bug: 28019637
Change-Id: I4f9f8e138f5d011a9ab393913159ed2978d26e0d
2016-04-25 20:24:18 +00:00
Dongwon Kang
0751a83a99 Merge "TIF: Be consistent with argument name for startRecording" into nyc-dev 2016-04-25 20:16:22 +00:00