Commit Graph

1396 Commits

Author SHA1 Message Date
Chet Haase
e646b28cb3 Minor fix to previous fragment change: non-animating case
The previous change only hid the fragment when the transition animation
ended. But if there is no animation, the fragment would never be hidden.
This change adds an else clause that handles the non-animating case.

Change-Id: Ie35b2ae98cb5c21193dadefbef71b8542fcf5f7d
2010-12-28 14:48:32 -08:00
Chet Haase
61eb40d276 Delay hiding fragments until transition finishes
Change-Id: I616de20e7e161fe1a53cd5e72912cec48f078df5
2010-12-28 14:25:56 -08:00
Dianne Hackborn
1b39e221e2 Fix NPE pointed out by Chet.
Change-Id: Id421476aa6f6ff281054b435ecd09f932966305c
2010-12-28 14:17:18 -08:00
Dianne Hackborn
d173fa3b1c Possible fix to issue #3213749: NPE at...
...android.app.Fragment.startActivityForResult(Fragment.java)

Make sure to remove all pending messages when AbsListView is detached
from its window.

But...  that's not enough.

It turns out that when a fragment's views are animating away, they of
course don't get detached until after the animation is done.  However
the fragment itself is immediately destroyed, leaving its live views
still going after that.

Here's a possible solution: when fragment manager initiates an animation
on a fragment whose views are being removed, it makes note of that so
it can hold off on destroying the fragment until the animation is over.

There are a lot of interesting race conditions here, if further operations
happen on the fragment while it is being animated.  I think the code here
does something sensible, and it does seem to work for the situations I
have tested, but it is hard to know all of the edge cases that may happen.

Change-Id: I4490ce8862a9bb714c7ea54baca3072c62126388
2010-12-28 14:01:20 -08:00
Svetoslav Ganov
e9730bf3d2 Adding APIs for setting whether to show week number and setting the start day of week. Cleaned up the code a bit.
Change-Id: Iaa7154c6912a68cd91df3ac881c324096394ea24
2010-12-28 02:40:23 -08:00
Dianne Hackborn
4e24aac6ae Add some standard definitions for device heaps.
These can be included as desired by particular devices to configure
their Dalvik heap in a standard way.

Change-Id: I487c751d7c583b0e93552f16ab43a93314219778
2010-12-23 15:41:16 -08:00
Martin Hibdon
6bcda6387f Correctly save Activity's state in saveInstanceState
Prior to this change, saveInstanceState would
call directly to Activity.onSaveInstanceState(),
rather than performSaveInstanceState().
This meant that saveManagdDialogs() was not called,
so Activities running under a LocalActivityManager
do not get their dialogs restored on configuration changes.

Change-Id: Id45110a8716a86958c14f4b1ea5a84c9cdf107f1
2010-12-22 13:05:52 -08:00
Svetoslav Ganov
28104e1de5 3298147 DatePicker dialog does not provide mechanism for specifying range from which to select
Change-Id: Ib5dd7db90ccc5b4d984914c481118049ac3648fe
2010-12-22 03:29:29 -08:00
Dianne Hackborn
0e3b8f421d Fix issue #3301572: onCreateLoader must not be a member class: VolumeMetadataLoader
Also some various cleanup.

Change-Id: I8e8616a86c50c86817f7ec9bb02a5954c1ccd84f
2010-12-21 11:12:09 -08:00
Dianne Hackborn
a2ea747faa More cleanup of Loader APIs.
- Remove old method names.
- Introduce onXxx() hooks to Loader.
- Improve debugging.

Change-Id: I3fba072a05c7023aa7d2c3eb4e126feb514ab6d8
2010-12-20 14:10:31 -08:00
Vasu Nori
6916b03e02 if a download dir doesn't exist, create it or fail fast
in HC, using DownloadManager public API, download directories
named by the constants Environment.DOWNLOAD_*
may ot exist. theyneed to be created or
the download request should fail ASAP.
bug:3297328

Change-Id: Ic87023d8fe98bd240744f66607a5400b7825e17e
2010-12-19 20:33:54 -08:00
Dianne Hackborn
8c972f2ce2 Merge "Some fixes to the new loader management." 2010-12-17 17:11:54 -08:00
Dianne Hackborn
f73c75ca20 Some fixes to the new loader management.
Change-Id: Ib882be5762b0ebeed9b027754159f401232718e9
2010-12-17 16:54:05 -08:00
Svetoslav Ganov
bf80562d22 Bug 3191746. atePicker TimePicker: Dark theme is used in a Light theme app
Change-Id: I20d0cca3b78af9db80854a57c88d6cab3b00f555
2010-12-17 16:00:18 -08:00
Dianne Hackborn
540d3d2662 Fixes for when onLoaderReset() is called.
Change-Id: Iab479926f11fa579757904032ada46c41686d560
2010-12-16 22:41:30 -08:00
Dianne Hackborn
c91893511d Fix issue #3272082: Contacts: when going back from edit view,
list UI is not ready yet

This involves some reworking of Loaders.

Loaders, in particular CursorLoader, are now expected to retain
their current data after being stopped.  This allows applications
to keep that data across onStop() -> onStart(), so when the user
returns to the app it doesn't have to wait for the data to reload
and thus cause flicker.

This includes various API changes to better reflect the new
semantics, plus a new LoaderCallbacks method to tell the application
when it is actually time to stop their use of a loader's data.

Note this is somewhat half-done, to help checking in the extensive
application changes that are required without causing build breakage.

Change-Id: Ib4b3bf8185a6da46e7f06ca125521d65e2e380a1
2010-12-16 20:09:13 -08:00
Dianne Hackborn
194157638a Fix launching of activities that I broke.
Change-Id: I39f4189bad6bdecdc7f9362410f36453fd816121
2010-12-15 00:20:27 -08:00
Dianne Hackborn
4f3867e3ce Time to remove some old APIs!
Change-Id: I73ca23b0d5c7971a00dfa05357f9b630d9b6ebc8
2010-12-14 22:19:03 -08:00
Vasu Nori
a738671790 Merge "bug:3264401 changes to support usage of new downloads dir in /data" 2010-12-14 17:57:41 -08:00
Dianne Hackborn
ad0b61ca67 Merge "Fix Dialog generating multiple onCancel()." 2010-12-14 17:51:44 -08:00
Dianne Hackborn
114405e0ea Fix Dialog generating multiple onCancel().
Issue #3169193: com.google.android.youtube: java.lang.NullPointerException
at com.google.android.youtube.async.UserAuthorizer$3.onCancel(UserAuthorizer.java:324)

A little protection against calling onCancel() after a dialog has been
dismissed.

Change-Id: I7a64c94703da012ce303308563e4a8ed3cb125d3
2010-12-14 17:49:14 -08:00
Dianne Hackborn
7ab7d83254 Merge "Work around issue #3241701: crash in ActivityThread.handleWindowVisibility" 2010-12-14 17:47:39 -08:00
Brad Fitzpatrick
4e920f70f3 Add MODE_MULTI_PROCESS flag to Context.getSharedPreferences()
Also, changes to make this testable with CTS:

-- special PENALTY_DEATH StrictMode fast path that doesn't use
   the Looper idling to "time" the violation.  Only used when
   death is the only violation,

-- make PENALTY_DEATH throw a RuntimeException instead of
   killing its process with a signal.  this means we can catch
   it in CTS tests, but it's also more consistent with
   PENALTY_NETWORK_DEATH in Honeycomb.

-- make FileUtils.getFileStatus() invoke StrictMode, which isn't
   (yet?) aware of I/O in native code.  so help it out.

CTS test for MODE_MULTI_PROCESS is in I6154edab

Change-Id: Icf93f9dfb0ece06b16781e4803dd2c17df3cf1b3
2010-12-14 16:27:21 -08:00
Amith Yamasani
c9ecb73ccd Add a way to insert a parent bread crumb so that deep linked settings can navigate up.
Bug: 3236568

This adds a way to insert a title as well as get a callback when that title is clicked.
It is not really on the backstack and clicks must be handled via the listener interface.
2010-12-14 15:17:32 -08:00
Vasu Nori
f83e6e4b7a bug:3264401 changes to support usage of new downloads dir in /data
Change-Id: I209a624523f727d47a4a8f758c13df5d4eac614f
2010-12-14 15:10:32 -08:00
Dianne Hackborn
bfddc0fe77 Work around issue #3241701: crash in ActivityThread.handleWindowVisibility
Change-Id: I9d5df3605f3d216e651e0a294409f82dea3968ad
2010-12-14 11:28:01 -08:00
Christopher Tate
001667313f Merge "Don't restore wildly wrong sized wallpapers" 2010-12-14 10:31:56 -08:00
Dianne Hackborn
d2835935d2 Fix issue #3258849: Grab thumbnail when exiting an app via back
Also issue #3281400: Rotating a retained instance fragment leaks the fragment manager

And turn off fragment debug logging.

Change-Id: Ibdd7db82bb35618021bcba421ba92ced7cd691c2
2010-12-13 20:41:17 -08:00
Christopher Tate
3f64f8d8fc Don't restore wildly wrong sized wallpapers
If the dimensions of the original are sufficiently different from the
device's preferred dimensions, just don't restore the image.  This
avoids bad letterboxing / clipping on e.g. phone <-> tablet data
migration.

The expansion/shrinkage ratios used here allow restores of saved
wallpaper images among HVGA devices, among WVGA variants, and
among tablets; but skip restoring wallpapers across those
categories (where severe clipping or letterboxing would occur).

Bug 3261863

Change-Id: I75e75d6401d18f1df10d75796ee04e21d2302cfa
2010-12-13 16:41:24 -08:00
Leon Scroggins
3db6af9237 Merge "Do not loop forever." 2010-12-13 13:02:39 -08:00
Dianne Hackborn
30d7189067 Fix issue #3274841: Orientation change problem with a paused activity
Plus a bunch of debug output improvements.

And some new Intent helpers for dealing with restarting an app.

Change-Id: I50ec56bca6a86c562156b13fe8a6fdf68038a12e
2010-12-13 12:57:02 -08:00
Leon Scroggins
d75e64af99 Do not loop forever.
Bug:3279066
Change-Id: I5222c465af2345f643bfd528d580d32ab9ba328e
2010-12-13 15:48:40 -05:00
Nick Pelly
d250746716 resolved conflicts for merge of 1d0d1188 to master
Change-Id: I80413d5a54a0284ab6f685c4c6197a2c009ea717
2010-12-13 12:22:34 -08:00
Nick Pelly
1d0d1188d7 am ae56a851: Merge "Make getSystemService(NFC_SERVICE) the NFC entry point." into gingerbread
* commit 'ae56a851624c2b2e78da8a2c339d2caa64c4f981':
  Make getSystemService(NFC_SERVICE) the NFC entry point.
2010-12-10 17:19:45 -08:00
Nick Pelly
50b4d8f643 Make getSystemService(NFC_SERVICE) the NFC entry point.
This gives NFC service a handle to the application context.

Deprecate NfcAdapter.getDefaultAdapter(), it does not provide a context.
Using this method will print a warning, and will later throw an exception
if a method that requires a context is called. No 2.3 API's will fail, but
new API's that do require a context might fail.

Also add helper NfcAdapter.getDefaultAdapter(Context).

Change-Id: I9a6378de4ef4b61ad922f8d53e64e2a1a1d5d60c
2010-12-10 17:12:33 -08:00
Dianne Hackborn
bca1c4ffad Merge "Fix issue #3271486: SetupWizward NullPointerException in" 2010-12-09 13:16:49 -08:00
Dianne Hackborn
fb3806d68d Fix issue #3271486: SetupWizward NullPointerException in
andriod.app.ActivityThread.performStopActivityInner

Change-Id: Ifce73b7fc48fedb4767d759f70c98fcdee510f36
2010-12-09 13:14:12 -08:00
Christopher Tate
a58fd15a5b Merge "Add a couple of transport-descriptive methods to IBackupManager" 2010-12-09 13:06:46 -08:00
Christopher Tate
f5e1c29637 Add a couple of transport-descriptive methods to IBackupManager
Privileged callers can now ask the transport for a string describing
its current state, and for an Intent that can be passed to startActivity()
in order to bring up its exported configuration UI.  These will be used
in Settings in order to e.g. show the user the currently active account
being used for backup, and allow the user to choose an account.

The data being funnelled through IBackupManager here are the ones
already exposed by the transports in their implementation of the
IBackupTransport interface.

Bug: 2753632

Change-Id: I2227a2b111d8d0ddf221d63020e20c1316fff55b
2010-12-09 12:58:24 -08:00
Andy Stadler
e9362fa157 Merge "API CHANGE - Add hasGrantedPolicy() API" 2010-12-09 10:05:27 -08:00
Dianne Hackborn
fe0b5a5260 Merge "Fix not saving state when restarting an activity." 2010-12-09 09:28:26 -08:00
Dianne Hackborn
e2b0480f5e Fix not saving state when restarting an activity.
Change-Id: I4c9e93e9523c9c62e3a15e6e4587ffad06280545
2010-12-09 09:24:55 -08:00
Andy Stadler
c25f70a440 API CHANGE - Add hasGrantedPolicy() API
* Allows an app to detect that it needs to have additional policies granted
* Add "refreshing" parameter to setActiveAdmin() to handle this case
* Minor cleanups to eliminate warnings (mostly for unused things)

Bug: 3253179
Change-Id: I4bf639bf560557130bf98e8cfb75f996fac416f1
2010-12-09 09:22:06 -08:00
Amith Yamasani
3c9f519f89 Move the breadcrumbs to the right pane.
Bug: 3236568
2010-12-08 23:44:38 -08:00
Adam Cohen
5a242ec2cf Added some pieces for Wallpaper previews
Change-Id: I48cd80108e5a555a1ca6180e29f67a87e05e9683
2010-12-08 19:37:59 -08:00
Dianne Hackborn
9d0718042f Fix issues #3257701 and #3267312
3257701 Preference headers have duplicated "title" and "summary" if
        title is not loaded from a resource
3267312 Fragment.onConfigurationChanged doesn't get called

Change-Id: I76e346ba88aa632ebb9aa413a2ce2645ebf357cd
2010-12-08 14:52:58 -08:00
Dianne Hackborn
0aae2d4e00 Rework activity lifecycle so onSaveInstanceState() is after onPause().
The goal is to fix a bunch of fragment-related bugs caused by various
things trying to do fragment transactions after onPause()...  which
currently throws an exception, since this is after the activity's state
has been saved so the new fragment state can be lost.

The basic change is relatively simple -- we now consider processes
hosting paused or stopping activities to be unkillable, and the client
code now does the onSaveInstanceState() as part of stopping the
activity.

For compatibility, if an app's targetSdkVersion is < HONEYCOMB, the
client side will still call onSaveInstanceState() prior to onPause()
and just hold on to that state until it needs to report it in once
being stopped.

Also included here is a change to generate thumbnails by taking
screenshots.  The code for generating thumbnails by re-rendering
the view hierarchy is thus removed.

Change-Id: Iac1191646bd3cadbfe65779297795f22edf7e74a
2010-12-08 00:35:27 -08:00
Svetoslav Ganov
50f34d14f6 Adding DatePciker widget based on the Calednar team code. Updated DatePciker and DatePickerDialog as the second part of the Time/Date pciker refresh feature.
Change-Id: Id32c614bcd799463ca33bf08fb7d5cf44f8326a6
2010-12-07 13:34:23 -08:00
Brad Fitzpatrick
4cd50b8d76 Make getSharedPreference() async, blocking on first access.
Bug: 3177046
Change-Id: Ibc36a1e196afd39c4f9da513a2bf4ba9e2c72177
2010-12-07 10:50:36 -08:00
Adam Powell
cf0357639e Clean up button bar styles
Change-Id: I65b6600f72b92db024f83b63d3ea91abc1cbb96c
2010-12-06 17:23:26 -08:00