14928 Commits

Author SHA1 Message Date
John Huang
54ca906604 Merge "Get rid of a race in NsdService in stopResolveService and getAddrInfo" into klp-dev 2013-11-13 19:14:00 +00:00
Jeff Brown
41b92b008e Merge "Finalize assets for screen casting." into klp-dev 2013-11-13 16:51:53 +00:00
John Spurlock
7d667ee2de Merge "Ensure wallpaper hint is at least as large as the display." into klp-dev 2013-11-13 16:41:44 +00:00
Jeff Brown
e7ae644522 Finalize assets for screen casting.
Extend wifi display connection timeout.

Show a notification while connecting to wifi display.

Ensure that remote display providers are really trusted before
connecting to them.

Bug: 11257292
Change-Id: Iad0caaa30d7946df818bc75ade071f2e377f8a53
2013-11-13 02:17:53 -08:00
Craig Mautner
6cd206b2aa Merge "Relayout windows that handle their own config change." into klp-dev 2013-11-12 23:56:21 +00:00
Vinit Deshapnde
4038724a53 Get rid of a race in NsdService in stopResolveService and getAddrInfo
Both requests are made using same id; and there is a chance that
stopResolve() is not fully completed when getAddrInfo() is issued. That
results getAddrInfo() failure, because both are using same requestId.

This change fixes this problem by creating a new unique id to call
getAddrInfo() with.

Bug: 11597153
Change-Id: I56bd78740e8a40bd31c52705dc797486aff53a50
2013-11-12 15:36:37 -08:00
Amith Yamasani
48dab493b9 Merge "Fix inconsistency in reporting device admin active state." into klp-dev 2013-11-12 22:47:55 +00:00
Craig Mautner
5d9f547720 Relayout windows that handle their own config change.
If a window claims to handle its own configuration change then we
won't destroy and recreate its window on a configuration change.
Normally that recreation triggers the first layout following
orientation change because mHaveFrame is false. Windows that handle
their own configuration changes never got a relayout pass following a
change in orientation.

This change passes the configuration changes that an application
handles into the AppWindowToken. If the app says it handles
orientation or screen size changes then a relayout will occur when the
configuration has changed.

Fixes bug 11647107.

Change-Id: Ie8d49fd050442ebbdcf0b805087894e3a2fc4be9
2013-11-12 14:02:52 -08:00
Craig Mautner
2c2549c5f4 Add event logging for tasks and stacks.
Also remove crufty write-only DisplayContent.mStackHistory.

Change-Id: I62b2b53dc02377c5d0d3b79df70b1990eed87d23
2013-11-12 09:57:00 -08:00
John Spurlock
41f6464b3f Ensure wallpaper hint is at least as large as the display.
Bug:11332853
Bug:11606952
Change-Id: I1840d7b723015c379da8eab7e22aa478d56adeb3
2013-11-12 10:28:14 -05:00
Jeff Brown
39ad0e5598 UI tweaks.
Hide disabled routes from the chooser.

Fix layout of chooser dialog when the settings button is visible and
the list is very long to prevent truncation of the settings button.

Fix an issue when we fake the route connecting status when a route
is selected.  The route changed notification needs to be propagated
to apps.  Fake it better.

Immediately disconnect from a route when the connection is lost or
a connection attempt fails.  Added a few new test displays for this
case.

Bug: 11257292
Change-Id: I360ab5dc937ad60d97592eab54b19f034519645e
2013-11-11 21:48:53 -08:00
Dianne Hackborn
596e409ec9 Merge "Work on issue #11634365: Leaking restarting services" into klp-dev 2013-11-12 01:36:10 +00:00
Dianne Hackborn
d6f5b62921 Work on issue #11634365: Leaking restarting services
Tighten up some flows to try to avoid any chance of leaving
a restarting service on the list, add a log to the only remaining
place I could find that we could get in to trouble for some
reason.

Change-Id: Iffb9be9d97deefc6cf0c5790eedfeb6e4e8a36bc
2013-11-11 17:25:37 -08:00
Jatin Lodhia
09e7e0ef8b Delegate existence of account check to Authenticator.
Current AccountManager code for getAuthToken checks if the account
in the request exists. If the account does not exist then it throws
an exception which leads to a runtime exception being thrown by
AccountManager in the client. In perticular, Checkin client code
hits this issue when accounts are deleted by user. As the exception
is thrown from the getAuthToken method call and is a RuntimeException
it is not caught by the client. Futhermore, Checkin runs in one of the
important processes and this exception makes the process crash.

This cl, does the following:
1) Delegates the account exists check to Authentictor which in turn
would cause an AuthenticatorException which is a checked exception.
2) Replaces some of the runtime exceptions thrown by AccountManagerService
with calling AccountManagerResponse.onError() which causes more graceful
failure on the client.
3) Correctly passes on the error returned by Authenticator to
AccountManager. Earlier if Authenticator returned an error code to
the AccountManager, it ignored the error and returned null token to the
client which was incorrect.

Bug: 10856295
Change-Id: Ie250fec601d46f6dfecd74677b478bfd4e9dcfad
2013-11-11 23:48:53 +00:00
Amith Yamasani
f65c0a9958 Fix inconsistency in reporting device admin active state.
When a device admin goes away due to a package change, only one of two lists
was being updated, causing an inconsistency in the query for active admins
depending on which API was being called.

This makes sure that mAdminMap stays in sync with mAdminList so that
isActiveAdmin() and getActiveAdmins() returns the same results.

Bug: 11588094
Change-Id: I232608738249492d9fca7e4d7aa7566d96fccf46
2013-11-11 11:44:37 -08:00
Dianne Hackborn
c85a1143aa Merge "Fix issue #11630188: Still seeing some processes not on LRU list errors" into klp-dev 2013-11-11 19:31:59 +00:00
Dianne Hackborn
bc72dce075 Fix issue #11630188: Still seeing some processes not on LRU list errors
This happened:

android.util.Log$TerribleFailure: Adding dependent process ProcessRecord{43c7a120 0:com.google.android.gms/u0a7} not on LRU list: service connection ConnectionRecord{437c16e0 u0 CR ACT com.google.android.gms/.icing.impl.IndexService:@436ba7f8} from ProcessRecord{43c64208 4908:com.google.android.googlequicksearchbox:search/u0a19}
	at android.util.Log.wtf(Log.java:290)
	at android.util.Slog.wtf(Slog.java:82)
	at com.android.server.am.ActivityManagerService.updateLruProcessInternalLocked(ActivityManagerService.java:2290)
	at com.android.server.am.ActivityManagerService.updateLruProcessLocked(ActivityManagerService.java:2508)
	at com.android.server.am.ActiveServices.updateServiceClientActivitiesLocked(ActiveServices.java:636)
	at com.android.server.am.ActiveServices.removeConnectionLocked(ActiveServices.java:1656)
	at com.android.server.am.ActiveServices.unbindServiceLocked(ActiveServices.java:860)
	at com.android.server.am.ActivityManagerService.unbindService(ActivityManagerService.java:12773)
	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:869)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2071)
	at android.os.Binder.execTransact(Binder.java:404)
	at dalvik.system.NativeStart.run(Native Method)

Because of this earlier:

11-09 18:02:19.126 W/ActivityManager(  809): Exception when starting service com.google.android.gms/.icing.impl.IndexService
11-09 18:02:19.126 W/ActivityManager(  809): android.os.DeadObjectException
11-09 18:02:19.126 W/ActivityManager(  809): 	at android.os.BinderProxy.transact(Native Method)
11-09 18:02:19.126 W/ActivityManager(  809): 	at android.app.ApplicationThreadProxy.scheduleCreateService(ApplicationThreadNative.java:850)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActiveServices.realStartServiceLocked(ActiveServices.java:1384)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActiveServices.bringUpServiceLocked(ActiveServices.java:1294)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActiveServices.bindServiceLocked(ActiveServices.java:755)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActivityManagerService.bindService(ActivityManagerService.java:12766)
11-09 18:02:19.126 W/ActivityManager(  809): 	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:859)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2071)
11-09 18:02:19.126 W/ActivityManager(  809): 	at android.os.Binder.execTransact(Binder.java:404)
11-09 18:02:19.126 W/ActivityManager(  809): 	at dalvik.system.NativeStart.run(Native Method)

Not clearing the service's app pointer.

Also fix this wtf where we were not clearing the started state of
a ServiceTracker when its process goes away.  (This was like this
because we used to want to leave the started state so that we can
know the process is trying to restart.  But now that have a new
explicit restarting strate, there is no need to leave it.)

android.util.Log$TerribleFailure: Service owner ServiceRecord{436f5168 u0 com.dirtywaterlabs.uberhype/com.dirtywaterlabs.musichype.MDService} cleared while started: pkg=com.dirtywaterlabs.uberhype service=com.dirtywaterlabs.musichype.MDService proc=ProcessState{42bf4bb8 com.dirtywaterlabs.uberhype:remote/10115 pkg=com.dirtywaterlabs.uberhype}
	at android.util.Log.wtf(Log.java:290)
	at android.util.Slog.wtfStack(Slog.java:86)
	at com.android.internal.app.ProcessStats$ServiceState.clearCurrentOwner(ProcessStats.java:2989)
	at com.android.server.am.ActiveServices.serviceDoneExecutingLocked(ActiveServices.java:1821)
	at com.android.server.am.ActiveServices.serviceProcessGoneLocked(ActiveServices.java:1779)
	at com.android.server.am.ActiveServices.removeConnectionLocked(ActiveServices.java:1693)
	at com.android.server.am.ActiveServices.killServicesLocked(ActiveServices.java:2028)
	at com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked(ActivityManagerService.java:12424)
	at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:3605)
	at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:3750)
	at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1026)
	at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
	at dalvik.system.NativeStart.run(Native Method)

Change-Id: I25a3fb678b5365254490cd5509b558348655b589
2013-11-11 10:55:42 -08:00
Jeff Brown
1cdbbb1e73 Merge "Changes to support new screen cast settings screen." into klp-dev 2013-11-11 18:19:26 +00:00
Craig Mautner
45bf281515 Merge "Fix a couple of issues with mOpeningApps." into klp-dev 2013-11-11 18:02:08 +00:00
Craig Mautner
8cfa6d083b Merge "Use old task info when creating new task." into klp-dev 2013-11-11 18:01:36 +00:00
Jeff Brown
75af171006 Changes to support new screen cast settings screen.
Fixed the Preference ordering code to consider the case where
two preferences might have the same order.  In that case, it
falls back on the title to disambiguate.  Previous behavior was
undefined (and technically not stable).

Expose the wifi display device address.

Perform wifi display scans every 10 seconds instead of every 15
to improve reponsiveness.

Make sure to define routes for wifi displays that we are connecting
to even if they are not yet paired.  Simplified the logic for
adding and removing these routes to avoid possibly getting out
of sync and leaving stale routes behind.

Fix wifi display notification icon.

Bug: 11257292
Change-Id: I8ac15fb17d83758c0bdce80399e12723c367b83c
2013-11-10 22:51:15 -08:00
Craig Mautner
8862929e2a Use old task info when creating new task.
When a new task is being created solely to protect the system from an
old task going away, save the info from the old task and use it when
creating a new task.

Fixes bug 11615548.

Change-Id: Ibc3fd15ec4b0d76bce30381fbd83b6899f6a9023
2013-11-10 20:39:05 -08:00
Craig Mautner
a8ee262c04 Fix a couple of issues with mOpeningApps.
In setAppVisibility add wtoken to mOpeningApps even if the requested
visibility already matches requestedHidden. When Keyguard hides an app
requestedHidden will mismatch and mOpeningApps will end up empty where
it should have the app that will become visible.

Add mAnimateWallpaperWithTarget = true to another situation where
wallpaper animation needs it.

Fixes bug 11570753.

Change-Id: I70b93bbb580386eb912613f0ce11e582eff8c449
2013-11-08 15:36:23 -08:00
Jim Miller
505329b21b Restore permission check in keyguard.
Fixes bug 11584685

Change-Id: I80621f5608505bdc365930e0276c297c0d5bff67
2013-11-08 14:08:10 -08:00
Jeff Brown
4fd791735b Allow keyguard dialogs to show on secondary displays.
When the keyguard or a dream is visible, we usually block content
from showing on secondary displays by mirroring the primary display
contents to them.  However, the keyguard may wish to show a
presentation on a secondary display in which case we should not
mirror.

This change adds an exemption for keyguard dialogs when the full
screen is obscured.  The keyguard can then create presentations with
the TYPE_KEYGUARD_DIALOG window type in order to show special
content on other displays selectively.

The old code used to cause all secondary displays to mirror, which
isn't quite what we want.

Bug: 11257292
Change-Id: I55429002b2233ae25fe80db149636d6f41f2a112
2013-11-08 09:53:56 -08:00
Jeff Brown
d40a4d74c6 Merge "Add media router service and integrate with remote displays." into klp-dev 2013-11-08 01:36:55 +00:00
Craig Mautner
c9ffd74659 Merge "Don't call setTask twice." into klp-dev 2013-11-07 20:51:30 +00:00
Craig Mautner
2040967478 Merge "If home activity is not fullscreen keep drilling." into klp-dev 2013-11-07 20:49:02 +00:00
Craig Mautner
f41bcd47ea If home activity is not fullscreen keep drilling.
When the home activity launches a non-fullscreen activity as part of
its own task then ensureActivitiesVisibleLocked() must continue past
the launched activity when determining activities to show and hide.
Stopping at the non-fullscreen activity leaves the fullscreen home
activity hidden.

Fixes bug 11555762.

Change-Id: I9058d8cde3a41cb7f9b1f97e5c0cb32e9b0f5af7
2013-11-07 11:51:29 -08:00
Robert Greenwalt
e8c51298a4 Merge "Add BatteryStats for Wifi Batched Scanning." into klp-dev 2013-11-07 18:30:49 +00:00
Dianne Hackborn
9882d38899 Merge "Fix issue #11223338: Not retaining service started state while restarting" into klp-dev 2013-11-07 18:16:10 +00:00
Craig Mautner
329f4129a5 Don't call setTask twice.
The method ActivityRecord.setTask() removes the ActivityRecord from
its old task's mActivities ArrayList. In jb-mr2 it did not have this
side effect (there was no mActivities) so calling it twice was not a
problem. This fix causes setTask to only be called once for the target
activity.

Fixes bug 11557835.

Change-Id: If2b6d4b297e86130009713efe6891a24fad3dd15
2013-11-07 09:10:42 -08:00
Jeff Brown
69b07161be Add media router service and integrate with remote displays.
This change adds a new media router service whose purpose is to track
global state information associated with media routes.  This service
publishes routes to the media router instance in application processes
and handles requested state changes such as selecting or unselecting
global routes.  The service also binds to remote display provider
services which can offer new remote display routes to the system.

Includes a test application for manually verifying certain aspects
of the operation of the media router service.

The remote display provider interface is essentially a stripped down
media route provider interface as defined in the support library
media router implementation.  For now, it is designed to be used only
by first parties to publish remote display routes to the system so
it is not exposed as public API in the SDK.  In the future, the remote
display provider interface will most likely be deprecated and replaced
with a more featureful media route provider interface for third
party integration, similar to what is in the support library today.

Further patch sets integrate these new capabilities into the System UI
and Settings for connecting remote displays.

Bug: 11257292
Change-Id: I31109f23f17b474d17534d0f5f4503e388b081c2
2013-11-07 03:25:37 -08:00
Robert Greenwalt
a029ea1318 Add BatteryStats for Wifi Batched Scanning.
bug:10690989
Change-Id: Ia39b715ee6d5733970095bc76de0ed40ff8208c0
2013-11-06 17:43:18 -08:00
Christopher Tate
c157cac9b2 Merge "System package permission decls take precedence over 3rd party apps'" into klp-dev 2013-11-07 00:54:55 +00:00
Dianne Hackborn
daa0d5c929 Fix issue #11223338: Not retaining service started state while restarting
When I cleaned up how we maintained the lifecycle of the tracker with a
service, I broke most tracking of the service restart state.  (Since at
that point the service is no longer associated with a process, so I
must clean up the tracker state).  This change introduces a new special
case for interacting with a service tracker to explicitly tell it when
a service is being restarted.  It also fixes how we update the process
state when services are attached to it, so it goes in and out of the
restarting state correctly.

In addition:

- Maybe fix issue #11224000 (APR: Dependent processes not getting added
  to LRU list).  We were not clearing ServiceRecord.app when bringing
  down a service, so if for some reason there were still connections to
  it at that point (which could happen for example for non-create bindings),
  then we would so it when updating the LRU state of that client process.
- dumpsys procstats's package argument can now be a package or process
  name, and we will dump all relevent information we can find about that
  name.
- Generally improved the quality of the dumpsys procstats output with its
  various options.
- Fixed a bug in ActivityManager.dumpPackageState() where it would hang if
  the service was dumping too much, added meminfo to the set of things
  dumped, and tweaked command line options to include more data.
- Added some more cleaning code to ActiveServices.killServices() to make
  sure we clean out any restarting ServiceRecord entries when a process is
  being force stopped.
- Re-arranged ActiveServices.killServices() to do the main killing of the
  service first, to avoid some wtf() calls that could happen when removing
  connections.

Bug: 11223338
Bug: 11224000

Change-Id: I5db28561c2c78aa43561e52256ff92c02311c56f
2013-11-06 16:42:17 -08:00
Craig Mautner
c9d0ee5e84 Merge "Tweak test for layout." into klp-dev 2013-11-06 23:22:12 +00:00
Craig Mautner
f961b3c5b6 Tweak test for layout.
Return to old way of only laying out Keyguard on configuration change
and add a new qualifier that does a layout if a window is part of an
opening app. This qualifier allows apps that handle their own
configuration changes to be notified of screen changes after the
configuration has changed. Apps that do not handle their own
configuration changes find their way into this code because their
surfaces are recreated by default and mHaveFrame is false.

This fixes bug 11544694 and passes the test of all bugs listed in CL
ag/383579.

Change-Id: I3a679b27eb4a2c5210957bcd4ae2f10b46f6e076
2013-11-06 14:52:36 -08:00
Craig Mautner
a724d86537 Merge "Fix incorrect looping limits." into klp-dev 2013-11-06 22:20:25 +00:00
Craig Mautner
db5c4fb864 Fix incorrect looping limits.
One cannot iterate across an entire list if one both removes an entry
and increments the index into the list. Do one or the other or you
will end up with bugs like 11556768 which is now fixed.

Change-Id: I57f1ad13075a005cae3c1cbfae10e230d9af143a
2013-11-06 13:55:08 -08:00
Michael Wright
6a29778eeb Merge "Continue synthesizing data even after brightness adjustment" into klp-dev 2013-11-06 20:33:08 +00:00
Christopher Tate
3aeea1f25a System package permission decls take precedence over 3rd party apps'
In particular, if a 3rd party app tries to define a permission that
turns out to be defined by system packages following an upgrade,
the system package gets ownership and grants are re-evaluated
on that basis.

Bug 11242510

Change-Id: Id3a2b53d52750c629414cd8226e33e5e03dd0c54
2013-11-05 16:27:07 -08:00
Michael Wright
65031a2913 Continue synthesizing data even after brightness adjustment
Bug: 11337887
Change-Id: I80adb330c4e9250965030626634002a1b9c999cf
2013-11-05 15:49:52 -08:00
Christopher Tate
8869d6f353 Merge "Extend preferred-app preload support for complex resolutions" into klp-dev 2013-11-05 18:42:58 +00:00
Dianne Hackborn
d64744cc76 Merge "Help out with issue #11497149: Clock app crashes when opened during..." into klp-dev 2013-11-05 18:17:01 +00:00
Craig Mautner
2722d79f01 Merge "Remove harmful visibility test." into klp-dev 2013-11-05 15:45:10 +00:00
John Spurlock
a89727c85e Merge "Ensure wallpaper hint is at least the display's max size." into klp-dev 2013-11-05 14:05:06 +00:00
Dianne Hackborn
23037419e3 Help out with issue #11497149: Clock app crashes when opened during...
...the repeated hour in DST transition

Record the last crash info that caused an app to be marked as a bad app.

Also for the battery work, add a system property tuning parameter to be
able to control the background service start delay, so we can easily
run experiments with it turned off if we want.

Change-Id: Ic33dc464d8011c918a39b912da09ea4f0fb28874
2013-11-04 18:11:29 -08:00
Christopher Tate
2298ef2f7f Extend preferred-app preload support for complex resolutions
Support factory defaults that involve specific type+scheme matching.

Bug 11372979

Change-Id: I0d68937797d6b4bc996a8707a7cd21491a3aae3b
2013-11-04 17:02:10 -08:00
Craig Mautner
76be9d2595 Remove harmful visibility test.
Previously inserted requirment that an activity be visible in order to
block visibility of the home screen is removed.

Fixes bug 11515761.

Change-Id: Ia47cfb4a0b6d90bbbca2b42e12a6048b1644d7cb
2013-11-04 16:01:22 -08:00