1780 Commits

Author SHA1 Message Date
Jeff Sharkey
e7bb71d269 Disable verbose NetworkStats logging.
Bug: 6076584
Change-Id: I4efcda2b474f623f4fe70db8b43b0aa69017d749
2012-02-28 15:13:08 -08:00
Jeff Sharkey
1d29a3064f Move NetworkStatsFactory to faster ProcFileReader.
Less GC overhead, and about 8x faster parse times.  Verified that
tests pass.

Change-Id: Iff1d374f36103395a193176a88a57eebffa93c56
2012-02-27 18:08:13 -08:00
Jeff Sharkey
453dafa663 Suppress StrictMode when reading /proc/ files.
Bug: 6077051
Change-Id: If4f23e947d8b91f9f124baa0460600a6b9353732
2012-02-27 17:42:34 -08:00
Adam Powell
c4e57e23f9 Fix bug 6065890 - Correct callback sequence for action bar tab switching
Keep the callback behavior consistent when action bar tabs collapse
into a spinner.

Change-Id: Ia82e55d816a92b7ec746e1d25486bc9d2c0778f4
2012-02-24 19:25:43 -08:00
Adam Powell
b98a81f86a Add support for optional titles in action modes
Optional titles will only be displayed in the CAB if they entirely fit
instead of ellipsizing.

Fixes bug 5821883

Change-Id: I0cfd6d4fd34a4fa9f520499d577706da30606811
2012-02-24 16:59:03 -08:00
Dianne Hackborn
0aec3ea6de am 911b505f: am dc5fa185: am 133dc2d7: Merge "Fix issue #6048808: sometimes auto-correct is inactive" into ics-mr1
* commit '911b505f11c719906985f169a4f45930bdec8695':
  Fix issue #6048808: sometimes auto-correct is inactive
2012-02-24 15:44:55 -08:00
Dianne Hackborn
dc5fa1859d am 133dc2d7: Merge "Fix issue #6048808: sometimes auto-correct is inactive" into ics-mr1
* commit '133dc2d7aecc68990c363c861716b134910a4ced':
  Fix issue #6048808: sometimes auto-correct is inactive
2012-02-24 15:38:07 -08:00
Dianne Hackborn
7663d80f6b Fix issue #6048808: sometimes auto-correct is inactive
My previous change to speed up the time the IME is dismissed was
fundamentally flawed.  That change basically switched the order
the application called the input method manager service from doing
startInput() and then windowGainedFocus(), to first windowGainedFocus()
and then startInput().

The problem is that the service relies on startInput() being done
first, since this is the mechanism to set up the new input focus,
and windowGainedFocus() is just updating the IME visibility state
after that is done.  However, by doing the startInput() first, that
means in the case where we are going to hide the IME we must first
wait for the IME to re-initialize editing on whatever input has
focus in the new window.

To address this, the change here tries to find a half-way point
between the two.  We now do startInput() after windowGainedFocus()
only when this will result in the window being hidden.

It is not as easy as that, though, because these are calls on to
the system service from the application.  So being able to do that
meant a fair amount of re-arranging of this part of the protocol
with the service.  Now windowGainedFocus() is called with all of
the information also needed for startInput(), and takes care of
performing both operations.  The client-side code is correspondingly
rearranged so that the guts of it where startInput() is called can
instead call the windowGainedFocus() entry if appropriate.

So...  in theory this is safer than the previous change, since it
should not be impacting the behavior as much.  In practice, however,
we are touching and re-arranging a lot more code, and "should" is
not a promise.

Change-Id: Icb58bef75ef4bf9979f3e2ba88cea20db2e2c3fb
2012-02-24 13:18:23 -08:00
Daniel Sandler
3f0c58eb70 Merge "New notification priority and related APIs." 2012-02-24 10:53:42 -08:00
Daniel Sandler
2561b0b10a New notification priority and related APIs.
This change introduces a few new bits of data on
Notification that will help the Notification Manager and
System UI route and display them more intelligently:

 -> priority: an integer in a predefined range that
    indicates the app's best guess as to the relative
    importance (to the user, right now) of that information

 -> kind: a tag (really, set of tags) indicating the general
    type of notification (realtime, asynchronous, etc)

 -> extras: a Bundle of additional key/value pairs
    associated with this notification (currently @hidden)

The notification manager takes these data into account when
assigning to each notification a score which is passed with
the notification on to the system UI, where it can be used to
affect presentation. For example:

  - Spammy apps (identified explicitly by the user or by
    some other means) will have their notifications scored
    very negatively by the notification manager, allowing
    the UI to suppress them
  - Notifications of higher score might be shown larger
    or in a different way
  - Very important notifications (indicated by a very high
    score) might interrupt the user during an otherwise
    important task (videochat, game, etc)

Implementation note: This replaces/extends the old internal
notion of "priority", which was mostly used to organize
ongoings and system notifications at the top of the panel.

Change-Id: Ie063dc75f198a68e2b5734a3aa0cacb5aba1ac39
2012-02-24 13:47:00 -05:00
Adam Powell
1f0f9d28a1 am c0d0dddc: am fef000e3: am 482ae5f2: Bug 6021294 - Contextual action bar animation tweaks
* commit 'c0d0dddc20827846dcf3235f7307ad76d2893ba6':
  Bug 6021294 - Contextual action bar animation tweaks
2012-02-23 07:30:01 -08:00
Jean-Baptiste Queru
68e696b137 am 058bd2ec: am 1d4c4d42: am 44c1f012: Merge "Return error code when composing PDU fails"
* commit '058bd2ecbcf8057511b00685eddc4ff5061bdbc1':
  Return error code when composing PDU fails
2012-02-23 07:29:46 -08:00
Jean-Baptiste Queru
d7170f3262 am 4b3ec09b: am 99ccf407: am c2461eb3: Merge "Add support for bmp and wav content types in MMS"
* commit '4b3ec09b8199d3c70fbb025a73e8f0a46dcd22c9':
  Add support for bmp and wav content types in MMS
2012-02-23 07:29:42 -08:00
Jean-Baptiste Queru
00ef7e8f2f am 50ff08a2: am 8a33803d: am a1ee18f1: Merge "Increase PDU parts buffer size for performance reasons"
* commit '50ff08a24e7a94c196f9b5c0b5b9ebdc03064a36':
  Increase PDU parts buffer size for performance reasons
2012-02-23 07:29:15 -08:00
satok
5c9b4329f3 Merge "Refactor sentence level spell checking APIs" 2012-02-21 22:59:12 -08:00
satok
d404fe1105 Refactor sentence level spell checking APIs
Support sentence level spell checking APIs: Step 1

Change-Id: I31c0b88e7885f33a0694ab60b8f2dbceeffe42f1
2012-02-22 15:35:46 +09:00
Adam Powell
f821819a88 Fix bug 5971117 - Action bar does not update icon used for collapsible
action views

Change-Id: Ib25cd40b046ab4b7dc382476345f95727fde3955
2012-02-21 17:10:10 -08:00
Adam Powell
c0d0dddc20 am fef000e3: am 482ae5f2: Bug 6021294 - Contextual action bar animation tweaks
* commit 'fef000e3fa968a8dd165753f16c1c4cd38d59f33':
  Bug 6021294 - Contextual action bar animation tweaks
2012-02-17 15:26:56 -08:00
Adam Powell
8035db11ef am 482ae5f2: Bug 6021294 - Contextual action bar animation tweaks
* commit '482ae5f2388a07d60d7f3b54432120172af25eee':
  Bug 6021294 - Contextual action bar animation tweaks
2012-02-17 15:25:29 -08:00
Adam Powell
482ae5f238 Bug 6021294 - Contextual action bar animation tweaks
Remove the right-to-left cascade effect from action mode menu
items. Animation time is now fixed at 300ms for scaling in menu items.

Change-Id: I8eef2ed9f93c2af804663dd5e6b3f4915ed45cb1
2012-02-17 15:18:01 -08:00
Jean-Baptiste Queru
1d4c4d42ed am 44c1f012: Merge "Return error code when composing PDU fails"
* commit '44c1f012c4ffa75853a068963b212ee1c965b6ea':
  Return error code when composing PDU fails
2012-02-17 13:18:34 -08:00
Jean-Baptiste Queru
99ccf407bf am c2461eb3: Merge "Add support for bmp and wav content types in MMS"
* commit 'c2461eb32ebad522a946e9fef9c31e886d98124a':
  Add support for bmp and wav content types in MMS
2012-02-17 13:18:31 -08:00
Jean-Baptiste Queru
44c1f012c4 Merge "Return error code when composing PDU fails" 2012-02-17 11:36:52 -08:00
Jean-Baptiste Queru
c2461eb32e Merge "Add support for bmp and wav content types in MMS" 2012-02-17 11:03:35 -08:00
Jean-Baptiste Queru
8a33803df5 am a1ee18f1: Merge "Increase PDU parts buffer size for performance reasons"
* commit 'a1ee18f1413471813f36a1d05927f5513c8931f5':
  Increase PDU parts buffer size for performance reasons
2012-02-17 10:13:05 -08:00
Matthias Thomae
9962ca12fb Increase PDU parts buffer size for performance reasons
Changed the size of the temporary buffer used when storing a PDU part
to 8192 bytes instead of the previous 256 bytes. This greatly
decreases the time needed to store relatively large PDU parts. The
times to store PDU parts were so long that we frequently ended up with
an ANR. This change resulted in a total time usage of ~1000 ms instead
of ~10000 ms for ~500 kB worth of data.

Change-Id: Ia02cb28e4fd9dfe3aaa1fa30ff37659951cbed93
2012-02-17 11:56:27 +01:00
Jeff Brown
50eb3b9bf9 Merge "Encapsulate the ViewRootImpl's handler." 2012-02-16 19:43:43 -08:00
Matthias Thomae
54c3ce2f14 Return error code when composing PDU fails
When the PduComposer fails to make the message body,
a successful result code was still returned.

Change-Id: I8a677afeeae8811c3b0fae61209c5348df1e39d9
2012-02-16 11:17:39 +01:00
Jeff Brown
a175a5b7ea Encapsulate the ViewRootImpl's handler.
This change makes it much easier to make sense of the messages that
get posted to the ViewRootImpl's handler by encapsulating their point
of dispatch within the ViewRootImpl itself.

As part of this change, the View.AttachInfo now carries a reference
to the ViewRootImpl itself, which simplifies some code that used
to try to find the ViewRootImpl by getting the root view's parent.

In principle, it might have been nice to hide the ViewRootImpl from
the View hierarchy but in practice the two were coupled in many ways.

Change-Id: I51ebccdf5f8c8c505cd6f17cdf594174d041dc54
2012-02-15 19:32:16 -08:00
Steven Ross
c9237f41a4 Removing dependence on enable_facelock
With this change, FaceUnlock is enabled by default when installed
fixes 5989485

Change-Id: Icbce3237ff533e8b7b88faf592ac4a1e143d5dc3
2012-02-14 09:27:00 -05:00
satok
688bd47fcc Add an api to switch to the next IME and subtype
Bug: 5975302

Change-Id: I48aa4220159c65f456d61a324efcdf0a1ceec91c
2012-02-10 16:44:12 +09:00
Tom Taylor
3b259a0963 CrespoMMS appears after delay in the thread
Bug 5032682

Part A of several parts to speed up sending MMS's. In this change, don't
allow multiple threads to write out the same pdu at the same time. This
was causing problems between the thread sending the mms message and the
UI trying to refresh and display the in-progress-sending message.

Change-Id: I862081619e6b6808caaba86a3b48820e0ef75aba
2012-02-06 16:57:39 -08:00
Jim Miller
c7aab1a9f1 Merge "Fix 5907223: Fix lock screen glitch caused on devices with a system bar" 2012-02-02 19:25:06 -08:00
Jim Miller
bf032650e3 Fix 5907223: Fix lock screen glitch caused on devices with a system bar
This fixes a regression caused by making the lock screen window slippery where
dragging the target over the system bar would incorrectly cause it to
snap to an invisible target.  It now interprets MotionEvent.ACTION_CANCEL
the same as an "up" event and resets to the initial state.

Change-Id: I9a3c195371d64e1a4613f6f1fb0a043e9a47a601
2012-02-02 16:22:29 -08:00
Romain Guy
74d7ca133a Proper equals/hashCode impls in Rect and RectF
Change-Id: Ief52d84f134018af4dfd19674de12736c056e3f8
2012-01-31 10:50:38 -08:00
Jim Miller
ce4a0c6f16 Fix 5906830: Update the clock earlier when lock screen comes back from suspend.
This attempts to fix an issue where sometimes the time shown on lock
screen was really old.  The code now sets the time immediately when the
screen turns on.

Change-Id: Ic4649ea342499aea82f997ba488bc2cb45987739
2012-01-27 17:15:18 -08:00
Jim Miller
fb9e364380 Merge "Fix 5620754: don't show pattern unlock after SIM unlock if not enabled." 2012-01-26 14:30:49 -08:00
Jim Miller
93708af132 Fix 5620754: don't show pattern unlock after SIM unlock if not enabled.
This fixes a bug where the device would show pattern unlock after the user
entered the SIM PUK unlock code.  The code now correctly determines that
the device isn't secure and thus shouldn't show the unlock screen.

Change-Id: I49fd749592154a4c5840038b92d54ca7ca086074
2012-01-25 18:26:12 -08:00
Gilles Debunne
3f696b264e Merge "Unbalanced batch edit begin and end leave TextView unresponsive" 2012-01-25 15:08:29 -08:00
Jeff Sharkey
629c6765ca Merge "Move network stats to FileRotator pattern." 2012-01-24 11:49:51 -08:00
Jeff Sharkey
63abc37356 Move network stats to FileRotator pattern.
Split existing network stats into two separate classes: a recorder
which generates historical data based on periodic counter snapshots,
and a collection of historical data with persistance logic.

Recorder keeps a pending history in memory until outstanding data
crosses a specific threshold.  Persisting is handled through a given
FileRotator.  This pattern significantly reduces disk churn and
memory overhead.  Separate UID data from UID tag data, enabling a
shorter rotation cycle.  Migrate existing stats into new structure.

Remove "xt" stats until iptables hooks are ready.  Avoid consuming
Entry values when recording into NetworkStatsHistory.  Assign
operation counts to default route interface.

Introduce "Rewriter" interface in FileRotator with methods to enable
rewriteAll().  Introduce IndentingPrintWriter to handle indenting in
dump() methods.

Bug: 5386531
Change-Id: Ibe086230a17999a197206ca62d45f266225fdff1
2012-01-24 11:13:14 -08:00
Fabrice Di Meglio
50aca29a0b Merge "Fix bug # 5863709 API request: Change param names of deleteSurroundingText to "before" and "after"" 2012-01-23 18:59:17 -08:00
Fabrice Di Meglio
0c95dd3f4f Fix bug # 5863709 API request: Change param names of deleteSurroundingText to "before" and "after"
Change-Id: I727fad9a59cda915899674569bfabd29b9f5da60
2012-01-23 15:06:42 -08:00
Andy McFadden
dc7bf5d8bf Don't use bootstrap loader directly
The VM is allowed to use null to represent the bootstrap class
loader, so attempting to call methods on it is a bad idea.  Use
the system class loader instead.

Change-Id: I9190848945f679d546d5fb30aba10fd27c7e5404
2012-01-23 09:51:42 -08:00
Christopher Tate
6de74ff2a4 Fix edge cases leading to backup hanging forever
Plug a couple of apparent code paths (one not obviously reachable, but
fixed here on general principles) that could lead to a backup pass
getting confused partway through and simply never properly completing.
In this state it would leave its wakelock held forever until next
reboot.  Bug 5828859.

Those fixes are a total of two lines of code. The rest of the patch
adds a textual journal of the most recently completed (or ongoing!)
backup pass's progress, with an eye to being able to isolate any such
issues that may crop up in the future.

Change-Id: If8a5e8aba11db5a1e618d8b9c9ba3038dd5377a1
2012-01-18 15:44:47 -08:00
Gilles Debunne
c478c171e9 Unbalanced batch edit begin and end leave TextView unresponsive
This is a fix for http://code.google.com/p/android/issues/detail?id=17508

Adding some logs and a forced GC, I'm now reliably able to reproduce it. Here is the scenario.

1. The IME handles an event. It retrieves the current InputConnection (IC) using
   ic = getCurrentInputConnection() and calls ic.beginBatchEdit();
2. The call is propagated to the UI thread and TextView's mBatchEditNesting
   is correctly increased through beginBatchEdit()
3. A listener calls setText(), which imm.restartInput(this);
4. As a result, the InputMethodManager creates a new ControlledInputConnectionWrapper
   with a new InputConnection from the TextView
5. A GC happens at that point. The previous InputConnection is no longeri
   referenced by the InputMethodManager's mServedInputConnection.
   The weak reference in the previous ControlledInputConnectionWrapper is nulled.
6. The IME thread finishes its process and calls ic.endBatchEdit(); on its version
   of the original InputConnection.
7. The message is passed through the InputConnect, but when the weak reference in the
   original IInputConnectionWrapper is dereferenced, we get a null InputConnection in
   executeMessage().
8. As a result, the TextView's endBatchEdit() method is not called, leaving this TextView
   with a non zero mBatchEditNesting.
9. From now on, all edit actions on this TextView will be considered part of a nested edition
   and no invalidation is performed, which is the visible manifestation of this bug.

The core problem is that the begin/end batch edit contract is broken when:
1. These are initiated by the IME thread (as opposed to the UI thread)
2. The input connection is reset between these calls
3. A GC happens in the mean time and the WeakReference is lost (otherwise
   calling endBatchEdit on a no longer active InputConnection is fine

Solution to keep TextView's mBatchEditNesting balanced:

- The IMM should notify the IC when it is no longer used. We're using the
existing FINISH_INPUT_CONNECTION to do that.
- The InputConnection should keep track of its nesting contribution to the TextView.
When finished the IC makes sure its contribution is reset to 0.
Moreover, further asynchonous calls to begin/endBatchEdit that may arrive from the IME
should be ignored. This is achieved using a negative value as a flag.

Notes:

- finishComposingText may be too broad of a method to perform such a cleaning step
but is seems to only be called in cases where the IC will not be used anymore.
If that's too broad, we have to introduce a new method in the IC interface.

- This is has been implemented in EditableInputConnection and not in a more general
BaseInputConnection because this is where we have a notion of TextEdit, and the
nesting problem is here specific to TextView.
However, the same unbalanced begin/end problem will happen in these classes. They
should override finishComposingText as has been done here if that matters.

- We cannot re-use the TextView's mBatchEditNesting since it may take into account
batch edit from various sources and resetting it on InputConnection close could
then lead to an inconsistent negative count value.

Patch Set 2: added synchronized blocks around mBatchEditNesting

Change-Id: I1ec5518fdc16fb0551fbce9d13f5d92eb4bc78c0
2012-01-17 10:52:20 -08:00
Jeff Sharkey
a27a3e8ad7 Introduce FileRotator.
Utility that rotates files over time, similar to logrotate. There is
a single "active" file, which is periodically rotated into historical
files, and eventually deleted entirely. Files are stored under a
specific directory with a well-known prefix.

Bug: 5386531
Change-Id: I29f821a881247e50ce0f6f73b20bbd020db39e43
2012-01-13 15:27:28 -08:00
Danielle Millett
2931d8ace9 Merge "DO NOT MERGE - Cherry picking from master to MR1" into ics-mr1 2012-01-12 07:28:24 -08:00
Jim Miller
5437c220e2 am d3872f55: am 62fad768: Merge "Fix 4560303: Add setting to lock later when power button pressed" into ics-mr1
* commit 'd3872f55045b7ce7be7dd7ae5fff37d7988bdcb2':
  Fix 4560303: Add setting to lock later when power button pressed
2012-01-10 10:34:51 -08:00
Danielle Millett
de7a2f3054 DO NOT MERGE - Cherry picking from master to MR1
Fix 5783857: Device Policy Manager doesn't allow Face Unlock

This makes it so that if face unlock is enabled and then a device policy
manager that requires something more secure than face unlock is installed,
the user will be forced to choose a new acceptable lock type.

This was previously fixed for the case where the device had been reset, or
the shell was restarted after setting face unlock, but not for the case where the
device remained on between setting face unlock and setting up a device policy
manager.

Also changed the function ordering of saveLockPattern() so that the overloaded
wrapper function is next to the main function.

Change-Id: Ibed8c4ab137ebbc07fb143faef6f047bc6dc4474
2012-01-10 11:40:41 -05:00