12776 Commits

Author SHA1 Message Date
Dianne Hackborn
6023873463 am 2dda21b9: Merge "Another stab at fixing issue #3149290 java.lang.RuntimeException:..." into gingerbread
* commit '2dda21b93f8a8e0fb70de44eae826bc68349813c':
  Another stab at fixing issue #3149290 java.lang.RuntimeException:...
2010-12-22 18:37:08 -08:00
Dianne Hackborn
7becaeea7b Another stab at fixing issue #3149290 java.lang.RuntimeException:...
...Unable to pause activity
{com.android.settings/com.android.settings.applications.StorageUse}

Change-Id: Ibfa28a1c5af50dd150dfcafe71e905426d312643
2010-12-22 18:29:32 -08:00
Jeff Brown
eb9f7a01b0 Fix policy issues when screen is off. (DO NOT MERGE)
Rewrote interceptKeyBeforeQueueing to make the handling more systematic.
Behavior should be identical except:
- We never pass keys to applications when the screen is off and the keyguard
  is not showing (the proximity sensor turned off the screen).
  Previously we passed all non-wake keys through in this case which
  caused a bug on Crespo where the screen would come back on if a soft key
  was held at the time of power off because the resulting key up event
  would sneak in just before the keyguard was shown.  It would then be
  passed through to the dispatcher which would poke user activity and
  wake up the screen.
- We propagate the key flags when broadcasting media keys which
  ensures that recipients can tell when the key is canceled.
- We ignore endcall or power if canceled (shouldn't happen anyways).

Changed the input dispatcher to not poke user activity for canceled
events since they are synthetic and should not wake the device.

Changed the lock screen so that it does not poke the wake lock when the
grab handle is released.  This fixes a bug where the screen would come
back on immediately if the power went off while the user was holding
one of the grab handles because the sliding tab would receive an up
event after screen turned off and release the grab handles.

Bug: 3144874
Change-Id: Iebb91e10592b4ef2de4b1dd3a2e1e4254aacb697
2010-12-22 16:00:21 -08:00
Alon Albert
d41fe75f09 Improved ignore-backoff handling
Allow a non-epidited ignore-backoff op to pass through
an expidited backed off op.

To do this, I first refactored the complicated if statement:

            if (best == null
                    || ((bestSyncableIsUnknownAndNotARetry == syncableIsUnknownAndNotARetry)
                        ? (best.expedited == op.expedited
                           ? opRunTime < bestRunTime
                           : op.expedited)
                        : syncableIsUnknownAndNotARetry)) {
                best = op;
                bestSyncableIsUnknownAndNotARetry = syncableIsUnknownAndNotARetry;
                bestRunTime = opRunTime;
            }

Into a more readable:
            boolean setBest = false;
            if (best == null) {
                setBest = true;
            } else if (bestSyncableIsUnknownAndNotARetry == syncableIsUnknownAndNotARetry) {
                if (best.expedited == op.expedited) {
                    if (opRunTime < bestRunTime) {
                        //  if both have same level, earlier time wins
                        setBest = true;
                    }
                } else {
                    if (op.expedited) {
                        setBest = true;
                    }
                }
            } else {
                if (syncableIsUnknownAndNotARetry) {
                    setBest = true;
                }
            }
            if (setBest) {
                best = op;
                bestSyncableIsUnknownAndNotARetry = syncableIsUnknownAndNotARetry;
                bestRunTime = opRunTime;
            }

The refactoring was all done automatically with IntelliJ to avoid human error
in the conversion.

After verifying this code still behaved as expected including the error
condition in the bug, I added handling for the cases when a non-expidited op
may override an expedited op if certain conditions occur, specificaly, if the
expidited op is backed off and the non-expidited op is not.

Finally, refactored to make it testable and added tests and logging.

Bug: 3128963

Change-Id: I131cbcec6073ea5fe425f6b5aa88ca56c02b6598
2010-12-22 14:40:43 -08:00
Jeff Hamilton
7a9f17c356 am 3ce86481: Remove canBeFormatted().
* commit '3ce86481cbde92e2cb6fe3a46cbedd8b2a5c4b48':
  Remove canBeFormatted().
2010-12-22 09:42:16 -08:00
Jeff Hamilton
3ce86481cb Remove canBeFormatted().
It's not easy to determine if this
is possible, so instead apps should
attempt a format and handle errors
in the format request.

Change-Id: I078a208b849e71ef3fb6b5970a9111ece4a2d201
2010-12-22 11:31:21 -06:00
Gilles Debunne
1cbb9a06c8 Ran fixPngMetaTags on all the core/res assets.
This removes the empty iTxt meta tags in png which are not supported by
Java 1.5. This script should be run every time the SDK is released.

Bug 3069421

Change-Id: I1610e52597937040f9da343046cd98aa075f728d
2010-12-21 16:46:21 -08:00
Gilles Debunne
e0cf3b3430 Asset cleanup. DO NOT MERGE
Assets moved from drawable to drawable-mdpi. Hdpi version created.

Change-Id: Iec08f79e22688a7b5dfc149aed68617ebf217564
2010-12-21 15:17:04 -08:00
Dianne Hackborn
20c915d803 am 5261cea2: Merge "Fix issue #3224616: TimeUtils.formatDuration() can drop 0s." into gingerbread
* commit '5261cea2e0cd61801e102114039a19ab449b53fe':
  Fix issue #3224616: TimeUtils.formatDuration() can drop 0s.
2010-12-21 13:33:06 -08:00
Dianne Hackborn
5261cea2e0 Merge "Fix issue #3224616: TimeUtils.formatDuration() can drop 0s." into gingerbread 2010-12-21 13:27:15 -08:00
Ola Olsson
145e6c4975 The phone is crashing when unknown mime content is transferred.
The content resolver does not take care of the IllegalStateException
that is thrown in getType and that needs to be fixed.

Change-Id: I3e66f1aa259ab91fb9233e1ba07faa1ab6c3f2dd
2010-12-21 08:52:22 +01:00
Bjorn Bringert
f5f7510486 Fix issue #3224616: TimeUtils.formatDuration() can drop 0s.
Integrated from master.

Change-Id: Ie12dd25cce03c06fafb7df1335266322df43b038
2010-12-20 15:23:02 -08:00
Mike LeBeau
0655b31d75 am 12b82c8d: Merge "Unhide RecognizerResultsIntent. This API was reviewed for Froyo, but we didn\'t want to make it public then because it wasn\'t until our first Market release of Voice Search that the APIs would be in use by our app." into gingerbread
* commit '12b82c8da7bc477e591b12d8b7e469a9ba6dd574':
  Unhide RecognizerResultsIntent. This API was reviewed for Froyo, but we didn't want to make it public then because it wasn't until our first Market release of Voice Search that the APIs would be in use by our app.
2010-12-20 11:58:01 -08:00
Martijn Coenen
07249236fc am ab82a5b9: Clean up and polish Mifare Classic tech.
* commit 'ab82a5b9a841cf052310e8500224932b9f5e3cad':
  Clean up and polish Mifare Classic tech.
2010-12-20 11:30:12 -08:00
Nick Pelly
623baf8edb am 29f9ee97: Merge "Need to check ndef before writing ndef." into gingerbread
* commit '29f9ee973eefea3c68382ed38e69db1f1a396f3f':
  Need to check ndef before writing ndef.
2010-12-20 11:29:40 -08:00
Mike LeBeau
52af3a4f9a Unhide RecognizerResultsIntent. This API was
reviewed for Froyo, but we didn't want to make it
public then because it wasn't until our first
Market release of Voice Search that the APIs would
be in use by our app.

http://b/3135351

Change-Id: I49053717cac08e3976c22e3a105139b6755aadb8
2010-12-20 10:50:31 -05:00
Martijn Coenen
ab82a5b9a8 Clean up and polish Mifare Classic tech.
- It's useful to have accessors at block level, so apps don't really have to know
  about the sector structure (and how many blocks there are in a sector).
- There's no way to tell whether a read/write/ didn't work because of auth
  failure. The documentation should be changed to make this point clear.
- Added increment/decrement commands, for atomic increment/decrement of value blocks.

Change-Id: I590feacbcd1443f1be7a86ab046a5b1f33e2e04c
2010-12-17 13:20:32 -08:00
Martijn Coenen
01d159aa2c Need to check ndef before writing ndef.
Regression due to all the (re)connect changes.

Change-Id: I637618f63518965e893a5a59db61002271666fa4
2010-12-16 16:34:56 -08:00
Martijn Coenen
12e5c1a21e am c58c3f1a: Implement additional Mifare Ultralight convenience methods.
* commit 'c58c3f1ae27c0c7f560bd381180397d7f6a2ebed':
  Implement additional Mifare Ultralight convenience methods.
2010-12-16 16:04:47 -08:00
Martijn Coenen
bf76b52f05 am 0d27f999: Expose reconnect(), to allow applications to reset tag state.
* commit '0d27f999f4b1ad51da11946800b40d2978fc6326':
  Expose reconnect(), to allow applications to reset tag state.
2010-12-16 16:04:41 -08:00
Martijn Coenen
9dce44ffbb am 4049f9d0: Implement multi-tech connect, enfore tech exclusivity.
* commit '4049f9d00a86f848d42d2429068496b31a6795ad':
  Implement multi-tech connect, enfore tech exclusivity.
2010-12-16 16:04:28 -08:00
Martijn Coenen
c58c3f1ae2 Implement additional Mifare Ultralight convenience methods.
Change-Id: I8d9dfadb5911b2d11d1ba6dcf1381decbb8386ef
2010-12-15 16:41:38 -06:00
Martijn Coenen
0d27f999f4 Expose reconnect(), to allow applications to reset tag state.
Change-Id: Ib5432e7f6b6aaf6ec1cb06693592cb7c6440a6f8
2010-12-15 16:41:38 -06:00
Martijn Coenen
4049f9d00a Implement multi-tech connect, enfore tech exclusivity.
- The NfcService now allows for connecting to a specific technology;
- The "active" parts of technology classes may not be used at the same time.

Change-Id: Ibb569f51cc6da4f3e24df9d0850c6f49a022b0c2
2010-12-15 16:41:38 -06:00
Dianne Hackborn
b32ea25529 am 7daaa98c: Merge "Fix issue #3149290: java.lang.RuntimeException: Unable to pause activity" into gingerbread
* commit '7daaa98c6531373a2a742c1360f0a2795de0619f':
  Fix issue #3149290: java.lang.RuntimeException: Unable to pause activity
2010-12-15 12:58:54 -08:00
Dianne Hackborn
99441c45e4 Fix issue #3149290: java.lang.RuntimeException: Unable to pause activity
{com.android.settings/com.android.settings.applications.StorageUse}

AbsListView could call mAdapter.getItemId() if a save state happened
after the data changed but before a layout occurred.

Change-Id: Ica020971dc458dff79b56dd810733e217f4f7da6
2010-12-15 11:02:55 -08:00
Costin Manolache
7afa161368 am a848d344: Merge "Fix bug in permission grant system." into gingerbread
* commit 'a848d3445090e114cbfe61f1c7449122a665fba6':
  Fix bug in permission grant system.
2010-12-14 10:14:10 -08:00
Costin Manolache
a848d34450 Merge "Fix bug in permission grant system." into gingerbread 2010-12-14 10:07:26 -08:00
Brad Fitzpatrick
2d5b11aba0 am 0927c902: Merge "Fix StrictMode javadoc copy/paste error." into gingerbread
* commit '0927c9026537166cec36b2f9bb8a764ef8a7c606':
  Fix StrictMode javadoc copy/paste error.
2010-12-13 15:27:25 -08:00
Brad Fitzpatrick
0927c90265 Merge "Fix StrictMode javadoc copy/paste error." into gingerbread 2010-12-13 15:25:09 -08:00
Nick Kralevich
30ad1e576a am 9dbef975: Merge "Avoid leaking sockets." into gingerbread
* commit '9dbef975f0f4370dfe48a0fb040e3d8d1eb91d87':
  Avoid leaking sockets.
2010-12-13 15:05:20 -08:00
Nick Kralevich
9dbef975f0 Merge "Avoid leaking sockets." into gingerbread 2010-12-13 15:03:28 -08:00
Dianne Hackborn
78e9f4cbae am e4a59519: Fix issue #3154576: battery stats checkin should include UID -> packages+ map
* commit 'e4a5951925f16f18dae91ed65567e96528f17fee':
  Fix issue #3154576: battery stats checkin should include UID -> packages+ map
2010-12-13 14:37:09 -08:00
Nick Kralevich
2ed20f8768 Avoid leaking sockets.
When a DNS lookup fails, we end up creating a datagram socket
but never properly close it.  This wastes limited valuable file
descriptors and causes CTS test failures.  Generally, we should
ensure that sockets or files are opened in a try block, and closed
in a finally block.

Bug: 3276283
Change-Id: I3432f3bc061268c7367948230f6edbdfcec55892
2010-12-13 14:32:17 -08:00
Dianne Hackborn
e4a5951925 Fix issue #3154576: battery stats checkin should include UID -> packages+ map
Includes some other small fixes to battery collection and a few
other things.

Output of package info looks like this:

5,0,i,uid,1000,com.android.settings
5,0,i,uid,1000,com.android.providers.subscribedfeeds
5,0,i,uid,1000,com.android.providers.settings
5,0,i,uid,1000,com.android.server.vpn
5,0,i,uid,1000,android
5,0,i,uid,1000,com.android.systemui
5,0,i,uid,1000,com.google.android.backup
5,0,i,uid,1001,com.android.phone
5,0,i,uid,1001,com.android.providers.telephony
5,0,i,uid,1022,com.android.nfc
5,0,i,uid,10021,com.google.android.location
5,0,i,uid,10021,com.google.android.syncadapters.calendar
5,0,i,uid,10021,com.google.android.gsf
5,0,i,uid,10021,com.google.android.syncadapters.contacts
5,0,i,uid,10026,com.android.providers.downloads.ui
5,0,i,uid,10026,com.android.providers.media
5,0,i,uid,10026,com.android.providers.drm
5,0,i,uid,10026,com.android.providers.downloads
5,0,i,uid,10032,com.android.launcher
5,0,i,uid,10039,com.google.android.gm
5,0,i,uid,10041,com.google.android.gallery3d
5,0,i,uid,10049,com.android.providers.calendar

Change-Id: I9e38f254eef146339113ad270f5c6e8b60fb7a1d
2010-12-13 14:31:40 -08:00
Brad Fitzpatrick
320274c5f1 Fix StrictMode javadoc copy/paste error.
Change-Id: Idd49111f0a1af6f331cffa0972191b2d4e25a385
2010-12-13 14:07:39 -08:00
Jean-Baptiste Queru
6d13b146e0 am e78a0009: resolved conflicts for merge of 4b94c451 to stage-korg-master
* commit 'e78a000955c283509ee8a21b8b7e448060ac8dd8':
  Added dropbox broadcast notification
2010-12-13 13:10:23 -08:00
Jean-Baptiste Queru
e78a000955 resolved conflicts for merge of 4b94c451 to stage-korg-master
Change-Id: I07b974f96ca598677e58623050e4668822e68f23
2010-12-13 13:06:13 -08:00
Martijn Coenen
6c2471649b am e3f6336b: Fixed API for active NDEF reading and NDEF formatting.
* commit 'e3f6336bcffc250da90ec864bccfa73ad1d016b9':
  Fixed API for active NDEF reading and NDEF formatting.
2010-12-13 08:14:01 -08:00
Martijn Coenen
e3f6336bcf Fixed API for active NDEF reading and NDEF formatting.
- Added getNdefCached() to return the message read at discovery time.
- Fixed format() to check ndef before doing the write:
  libnfc actually requires a checkNdef to be done before writing.

Change-Id: I9b3108299c05539bdef92dd74f62f911fb5a16bf
2010-12-13 09:58:58 -06:00
Jeff Hamilton
80c78a896f am 641dd621: First pass at advanced NFC tag dispatching APIs and other cleanup.
* commit '641dd62155fd2eeddd93b2036154b13c05b70ba2':
  First pass at advanced NFC tag dispatching APIs and other cleanup.
2010-12-11 20:58:38 -08:00
Jeff Hamilton
641dd62155 First pass at advanced NFC tag dispatching APIs and other cleanup.
Change-Id: I022fcd481274a2f68d93218026e77551cfae8cae
2010-12-10 22:48:16 -06:00
Martijn Coenen
41e74b991b am b79173f6: Changed technology close() to reconnect to the tag instead of physical disconnect.
* commit 'b79173f6602359d00a1a89f4d6505a44d461d796':
  Changed technology close() to reconnect to the tag instead of physical disconnect.
2010-12-10 20:40:40 -08:00
Martijn Coenen
2019f53396 am fc5a3b6c: Changed transceive on all technologies to "raw", except for Mifare classes.
* commit 'fc5a3b6cfb85679e82a39730c7154b55b0711a0c':
  Changed transceive on all technologies to "raw", except for Mifare classes.
2010-12-10 20:40:34 -08:00
Martijn Coenen
25556f6669 am 3300e4c3: Implemented isWritable() to indicate NDEF capability container r/w state.
* commit '3300e4c3ea2f2317532ded6f9e79d6ad9e038679':
  Implemented isWritable() to indicate NDEF capability container r/w state.
2010-12-10 20:40:26 -08:00
Martijn Coenen
b79173f660 Changed technology close() to reconnect to the tag instead of physical disconnect.
Change-Id: I8935e4aae452adeec472c0b3ff3c77f1400a264e
2010-12-10 22:07:46 -06:00
Martijn Coenen
fc5a3b6cfb Changed transceive on all technologies to "raw", except for Mifare classes.
Change-Id: I3d680e37fec0ab84cdbb70d9fb6fff9527dd76a2
2010-12-10 22:06:35 -06:00
Martijn Coenen
3300e4c3ea Implemented isWritable() to indicate NDEF capability container r/w state.
Change-Id: Ie8bdf490c955e620f5e5029346fbe2e188ea4748
2010-12-10 22:02:09 -06: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