Commit Graph

2254 Commits

Author SHA1 Message Date
Adam Powell
8bf11c89f2 am c9f5b3d3: am e095ceaa: Merge "Handle returning a result from automatic up navigation from another task." into jb-dev
* commit 'c9f5b3d3ef1e0e329f6081cd120544f8d1d7576c':
  Handle returning a result from automatic up navigation from another task.
2012-05-15 17:20:06 -07:00
Adam Powell
3d193d92f6 Handle returning a result from automatic up navigation from another
task.

When navigating up from a different task, if the current activity has
a result set only finish the current activity instead of trying
finishAffinity. Log this so that developers know why this behavior is
happening.

Bug 6465336

Change-Id: Ic7cec6f0c0d5861296091e2aea9344309f5fc600
2012-05-15 16:53:34 -07:00
Dianne Hackborn
b4131ccba3 am b4652172: am bea7afc5: Merge "Fix issue #6284404: ArrayIndexOutOfBoundsException in..." into jb-dev
* commit 'b4652172404643d0a8fffbcc315cddcc733ec5ba':
  Fix issue #6284404: ArrayIndexOutOfBoundsException in...
2012-05-15 14:03:06 -07:00
Dianne Hackborn
03fcc333cf Fix issue #6284404: ArrayIndexOutOfBoundsException in...
...FragmentManagerImpl.restoreAllState

This was a bug related to the difference between the pre- and post-HC
behavior of onSaveInstanceState().  Prior to HC, state was saved
before calling onPause().  Starting with HC, it is saved between
onPause() and onStop().  To maintain compatibility with existing
applications, there is a check in ActivityThread for pre-HC to in
that case emulate the behavior of old applications, still calling
onSaveInstanceState() before onPause() but using the state later.

One of the special cases we had to deal with in the old model of
saving state before pausing was restarting an activity that is
already paused.

Consider, for example: you have two activities on screen, the one on
top not fullscreen so you can see the one behind.  The top activity
is resumed, the behind activity is paused.  In the pre-HC world, the
behind activity would have already had its state saved.

Now you rotate the screen, and we need to restart the activities.
We need to destroy the behind activity and create a new instance,
but the new instance has to end up in the paused state.  To
accompish this, we restart it with a flag saying that it should
end up paused.  For the pre-HC world, since it ends up paused,
we need to make sure we still have its instance state kept around
in case we need it because we can't regenerate it (since it is
already paused).

So that is what the changed code here is doing.  It goes through
the normal create/start/resume steps, but holds on to the current
saved state so that it isn't lost when resume clears it, and then
puts the activity back to paused and stuffs that old saved state
back in to it.

The problem is that this code was doing it for every application,
even HC apps.  So we end up in a bad state, when a HC app has its
saved state sitting there as if it had been saved, even though it
is only paused.  Now if we go to restart the activity again, instead
of asking it for a new saved state (as we should for a HC app as
part of stopping it), we just re-use the existing saved state again.

Now this wouldn't generally be a huge problem.  Worst case, when we
restart the activity yet again we are just instantiating it from
the same saved state as we used last time, dropping whatever changes
may have happened in-between.  Who cares?  All it has been doing is
sitting there in the background, visible to the user, but not something
they can interact with.  If the activity made changes to its
fragments, those changes will be lost, and we will restore it from
the older state.

However...  if one of those fragements is a retained fragment, this
will *not* appear in the saved state, but actually be retained across
each activity instance.  And now we have a problem: if the retained
fragments are changed during this time, the next activity instance
will be created from the most recent state for the retained fragments,
but the older state for everyting else.  If these are inconsistent...
wham, dead app.

To fix this, just don't keep the saved state for HC apps.

Also includes a small optimization to ActivityStack to not push
the home screen to the front redundantly.

Change-Id: Ic3900b12940de25cdd7c5fb9a2a28fb1f4c6cd1a
2012-05-15 13:13:33 -07:00
Dianne Hackborn
f2d3c418c4 am 1bcd6b8c: am a827843f: Merge "Fix issue #6020164: Settings crashed on orientation change..." into jb-dev
* commit '1bcd6b8ce8f7769e0b61dd630c98d56116d43595':
  Fix issue #6020164: Settings crashed on orientation change...
2012-05-15 11:38:54 -07:00
Dianne Hackborn
b61a02657b Fix issue #6020164: Settings crashed on orientation change...
...while listening to TTS example

This was a nice one.  What was happening is that immediately upon
being created, the activity was starting another activity in a
different process.  The second activity would never show, just
immediately exit.  However the original activity had time to
pause and get into stopping itself before the second activity had
come back to the activity manager to say it was going away, resulting
in the activity manager asking the original activity to resume.

At this point the activity manager's state is that the second
activity is finishing and gone, and the original activity is
resumed.  However in the app process the original activity is
still working on stopping itself, and it eventually completes
this and tells the activity manager.  The activity manager now
changes its state to STOPPED, even though it is actually resumed
and that is the last thing it told it to be, and it is now
proceeding to set itself in that state.

This would result later in the activity manager sending an
unnecessary state change to the application.  In the case of
the screen here, we next do a rotation change, the activity
manager thinks the current state is STOPPED not RESUMED, so it
tells the application to relaunch the activity in a new config
but not in the resumed state.  Now it does the whole "start a
new temporary activity" thing again, at which point it tries
to pause the original activity again, and we have an unbalanced
onPause() call to the app and it falls over.

Change-Id: I38b680746f4c61ae30e7ce831e1de187adf60902
2012-05-14 17:19:18 -07:00
Daniel Sandler
e1713afb6c am 6ad11058: am f54bfcf5: Merge "Restyling action buttons." into jb-dev
* commit '6ad1105806232b540848a84050c5106a895d694b':
  Restyling action buttons.
2012-05-10 15:50:20 -07:00
Daniel Sandler
f54bfcf5a3 Merge "Restyling action buttons." into jb-dev 2012-05-10 15:44:16 -07:00
Daniel Sandler
e551884b09 Restyling action buttons.
Bug: 6418617
Change-Id: I843352fbd167aeb6cc7beb0172b7416aabd5856a
2012-05-10 16:45:48 -04:00
Daniel Sandler
ba32499a68 am d634b77b: am a4487e1b: Merge "Clean up API docs for Notification." into jb-dev
* commit 'd634b77bbf838e92716d03879e77f203c86c2fc6':
  Clean up API docs for Notification.
2012-05-10 11:57:59 -07:00
Michael Jurka
e5c511a1cc am bf1b5fa9: am 421dceb0: Merge "Making transition out of recents look better" into jb-dev
* commit 'bf1b5fa944158044a595706924b935b5577ec0f0':
  Making transition out of recents look better
2012-05-10 11:57:33 -07:00
Daniel Sandler
c323d9ec3a am 8046724d: am e95658c9: New backgrounds for notifications.
* commit '8046724da39735d03a4659c268d9154f82f4d31a':
  New backgrounds for notifications.
2012-05-10 11:39:22 -07:00
Dianne Hackborn
169c3d4dd7 am 7ab16751: am 2c2864f6: Merge "Add new API to find total RAM." into jb-dev
* commit '7ab1675111954814ebaa32dd82084929df1b390e':
  Add new API to find total RAM.
2012-05-10 11:38:56 -07:00
Dianne Hackborn
58d4f2e36f am e2e03913: am dd79ae6b: Merge "Add infrastructure for accessing "unstable" content providers." into jb-dev
* commit 'e2e0391389fce1a9fd9d5c5442ba1901b6d96211':
  Add infrastructure for accessing "unstable" content providers.
2012-05-10 11:38:52 -07:00
Daniel Sandler
a4487e1b4b Merge "Clean up API docs for Notification." into jb-dev 2012-05-10 10:57:02 -07:00
Michael Jurka
421dceb0a4 Merge "Making transition out of recents look better" into jb-dev 2012-05-10 10:35:19 -07:00
Daniel Sandler
d33b803b6b Clean up API docs for Notification.
Bug: 6427241
Bug: 6427245
Bug: 6427814
Change-Id: I91d741513e3b345d2b9f28ad0a1bf11b0a898076
2012-05-10 13:15:37 -04:00
Daniel Sandler
e95658c98e New backgrounds for notifications.
Note that PRIORITY_MIN notifications have a special
background treatment.

Bug: 6418617
Change-Id: I5f96330fcc53ac39e80a025baa0c134bd1e971b8
2012-05-10 04:52:18 -07:00
Dianne Hackborn
2c2864f65c Merge "Add new API to find total RAM." into jb-dev 2012-05-09 21:34:42 -07:00
Michael Jurka
21385cd83d Making transition out of recents look better
- Fading out recents first, then scaling up app
thumbnail
- Fade Recents out over 130ms
- Delay the window animation for 200ms first,
then animate for 200ms (previously we didn't delay
and then animated for 300ms)

Bug: 6390075

Change-Id: Ia8c753bf7ee03d2acef6eb2772b28d88fe10a682
2012-05-09 20:25:28 -07:00
Dianne Hackborn
59325eb31f Add new API to find total RAM.
Change-Id: Iad2dff3c44f471515f093e7f0d0d959528881ab9
2012-05-09 18:45:20 -07:00
Dianne Hackborn
652b6d1e59 Add infrastructure for accessing "unstable" content providers.
We have an API and some stuff that purports to this, but no real
implementation yet.

Change-Id: I93555440014a50fdf79fa3f65318d90fb82265b4
2012-05-09 18:18:40 -07:00
Irfan Sheriff
0280e9cf8f am 1a11e33b: am 9669a0ce: Merge "API review fixes" into jb-dev
* commit '1a11e33b91daeed22eef42936233e0751e56f4b8':
  API review fixes
2012-05-09 14:09:20 -07:00
Irfan Sheriff
9669a0ce57 Merge "API review fixes" into jb-dev 2012-05-09 14:04:04 -07:00
Irfan Sheriff
22af38c526 API review fixes
- Remove the notion of channel from an application perspective
- Remove the use of DnsSd as part of API and add a protocol type to allow
future extensions
- Use the listener object as a handler for stop and unregister operations. Also,
we now allow multiple active discovery operations.
- Remove init/deinit operations in favour of setting up construction

Bug:6434844
Change-Id: Id15521d571aac9c4053d81184ad66dfc54f636de
2012-05-09 11:48:42 -07:00
Adam Powell
132a75f5cf am c23411e6: am 13740708: Merge "Fix bug in TaskStackBuilder#addParentStack" into jb-dev
* commit 'c23411e6db3989cf8b5259d2c89c640dad3bb008':
  Fix bug in TaskStackBuilder#addParentStack
2012-05-09 10:10:39 -07:00
Fabrice Di Meglio
450743459f am e1b1cdc0: am 92d7f9ff: Merge "Fix bug #6408393 Character corruption is caused when locale is changed" into jb-dev
* commit 'e1b1cdc0d45b23ad65819643ca135783ad17b976':
  Fix bug #6408393 Character corruption is caused when locale is changed
2012-05-09 10:09:23 -07:00
Adam Powell
d509da93e4 am 5fac4ca4: am ef31e7ca: Fix for toggling menu item visibility outside of create/prepare menu
* commit '5fac4ca4652e1a5211ef15c706feb64b9f250aa3':
  Fix for toggling menu item visibility outside of create/prepare menu
2012-05-09 10:09:05 -07:00
Chris Wren
b992f4a1f7 am 2779c4c1: am 195ba504: Merge "Clear out any existing buttons before adding the set of requested actions." into jb-dev
* commit '2779c4c1f1580b13bd9bb29695451b58b381b1e3':
  Clear out any existing buttons before adding the set of requested actions.
2012-05-09 10:08:48 -07:00
Kenny Root
c72b502d89 am 83ea8609: am 29bb27ef: Merge "Add encryption parameters to package installation" into jb-dev
* commit '83ea86091bf94571912694c7caf8be1c21727f91':
  Add encryption parameters to package installation
2012-05-09 10:08:19 -07:00
Adam Powell
c1e8244f72 am c5967ab8: am e601efd3: Merge "Fix a bug in Activity Up navigation dispatching" into jb-dev
* commit 'c5967ab8defdb199b95317a3c67957f8d7a0aacb':
  Fix a bug in Activity Up navigation dispatching
2012-05-09 10:07:46 -07:00
Adam Powell
5c43ec9328 Fix bug in TaskStackBuilder#addParentStack
Don't assume the initial component has a valid parent specified.

Bug 6464209

Change-Id: I22aa4c0e667ea85dc46ad7320f4a9f52117af520
2012-05-08 16:55:20 -07:00
Dianne Hackborn
709d138d2f am eef61216: am 8e11051a: Merge "Tweak anim API to automatically call Intent.setSourceBounds()." into jb-dev
* commit 'eef61216183b77842d06533fcc661020c0032d2d':
  Tweak anim API to automatically call Intent.setSourceBounds().
2012-05-08 15:02:13 -07:00
Dianne Hackborn
2a8650bdca am 009e6e6b: am bae365c1: Merge "Fix issue #6319312: Consecutive call to Activity\'s onCreate()/onResume()..." into jb-dev
* commit '009e6e6b5e83f18cd691d69dc5f08e04bfccf059':
  Fix issue #6319312: Consecutive call to Activity's onCreate()/onResume()...
2012-05-08 15:01:27 -07:00
Fabrice Di Meglio
92d7f9ff1c Merge "Fix bug #6408393 Character corruption is caused when locale is changed" into jb-dev 2012-05-08 10:54:41 -07:00
Adam Powell
ef31e7cab5 Fix for toggling menu item visibility outside of create/prepare menu
Allow applications to transition from 0=>1+ visible menu items outside
of onCreatePanelMenu/onPreparePanel. Previously, having 0 visible items
at this point would require an invalidation of the options menu.

Bug 6452605

Change-Id: I6cbfc46d0e5ec42b8d78ee516e9b57fdeaf1a890
2012-05-08 10:01:35 -07:00
Chris Wren
195ba5047c Merge "Clear out any existing buttons before adding the set of requested actions." into jb-dev 2012-05-08 07:34:12 -07:00
Chris Wren
2c22eb0a49 Clear out any existing buttons before adding the set of requested actions.
Bug: 6459557
Change-Id: Id19050e7280208d4f98c1aabe8087c6fe6c8d72a
2012-05-08 09:49:13 -04:00
Fabrice Di Meglio
30ca5cd11a Fix bug #6408393 Character corruption is caused when locale is changed
- free the TextLayoutCache on Locale change

- also free TextLayoutCache when memory is low

Change-Id: I39a37ac8ec3c292cfb1c0eea4bb41ff71897d089
2012-05-07 20:17:38 -07:00
Kenny Root
29bb27ef90 Merge "Add encryption parameters to package installation" into jb-dev 2012-05-07 18:41:27 -07:00
Adam Powell
e601efd375 Merge "Fix a bug in Activity Up navigation dispatching" into jb-dev 2012-05-07 17:40:09 -07:00
Adam Powell
07304f5299 Fix a bug in Activity Up navigation dispatching
Propagate the return value from onNavigateUp as the result of
onMenuItemSelected. This fixes a bug where the action bar Up nav
button clicks would not be propagated to support lib FragmentActivity
or other activity subclasses that rely on processing otherwise
unhandled onMenuItemSelected events.

Change-Id: Id879dd1756ed06b8a7b720ebf0eae2a8ddc66ca8
2012-05-07 17:32:44 -07:00
Anonymous Coward
ceb1b0bfae Add encryption parameters to package installation
Change-Id: Ic9f8ab9f8110f08bb3c00725cfce5b8ee7b766f3
2012-05-07 16:34:49 -07:00
Dianne Hackborn
8e11051a06 Merge "Tweak anim API to automatically call Intent.setSourceBounds()." into jb-dev 2012-05-07 16:12:44 -07:00
Dianne Hackborn
d367ca88ee Tweak anim API to automatically call Intent.setSourceBounds().
Also don't retain the source bounds in recent tasks, since it
has no meaning there and it would be better when relaunching an
activity to have a new bounds set based on wherever it is now
being launched from.

Change-Id: Ia90c04ee98a888a7f725b038abe23d71e2b12800
2012-05-07 15:54:58 -07:00
Dianne Hackborn
755c8bfbff Fix issue #6319312: Consecutive call to Activity's onCreate()/onResume()...
...without onPause() in between

There was a bug in the handling of "always finish activities" where we
would go through destroying activities while in the middle of updating
the activity stack.  This would result in the activity behind the
non-full-screen activity being created and then immediately destroyed,
which things were not expecting.

Change-Id: Idaa89089f7b1af7eb747d7b8f9f394beeb2d23fa
2012-05-07 15:06:09 -07:00
Daniel Sandler
d4ff15ac60 am f3fda077: am fafce1f9: Merge "Add number back to legacy notifications." into jb-dev
* commit 'f3fda0778c3deee7955f2c3caef2ac71cd9b647b':
  Add number back to legacy notifications.
2012-05-07 06:04:38 -07:00
Daniel Sandler
fafce1f9f5 Merge "Add number back to legacy notifications." into jb-dev 2012-05-07 05:58:55 -07:00
Romain Guy
3ce1747583 am 2e353b35: am 2db084fa: Merge "Dialog not dismissed when tearing down dialog fragment." into jb-dev
* commit '2e353b35f0b0a346e54aaec91de455d5f1cef213':
  Dialog not dismissed when tearing down dialog fragment.
2012-05-06 14:11:28 -07:00
Romain Guy
2db084fa95 Merge "Dialog not dismissed when tearing down dialog fragment." into jb-dev 2012-05-06 14:06:05 -07:00