1282 Commits

Author SHA1 Message Date
Adam Powell
dae7824c4b Action bar work for phones
Drop tabs to a second row at < w480dp

Make 9-patches for the cab's "done" button thinner

Add a "disable home" display option to the action bar to turn off
focus and touch feedback when tapping home would do nothing

Change-Id: Ib2eedf311655f02055357321e2e9ad5b9037fed1
2011-04-25 17:42:45 -07:00
Adam Powell
d0f650c6c3 Fix mipmap selection for action bar icons
Change-Id: I6d34dabb5289284fd5821695ad14d8bdeb97e50d
2011-04-22 16:05:17 -07:00
Adam Powell
45c515b0e9 Action bar work for phones
Tweak sizing and layouts for action bar on smaller devices. The action
bar's size is now partially dependent on form factor and orientation
to conserve screen space, especially in landscape mode.

Alter the max action menu items for smaller devices. Disallow text on
action menu items with a horizontal width of less than 480dp when an
icon is available.

Remove the "Done" text on the action mode close button. (TODO: get a
properly sized 9-patch resource for this - the current one has an
intrinsic width that is too large.)

When setting an action bar icon as a resource ID, the bar will attempt
to load a mipmapped resource that is the closest available for the
target size.

Change-Id: I2498c640666ade310fdd1d3a2078bd4000b392a2
2011-04-21 19:23:27 -07:00
Adam Powell
a86b350977 Fix bug 4329016 - Refresh menus properly while in batch update mode
Change-Id: Ia4a4feffb0a77a99e0b241c9cf1d737577d9154d
2011-04-21 14:49:23 -07:00
Adam Powell
696cba573e Refactor menu internals.
In the old world, MenuBuilder and MenuItemImpl were responsible for
generating views for any presentation of a menu. MenuBuilder needed to
know any types and resources involved, and the implied caching
semantics did not work well for menus presented within AdapterViews.

In the new world, the MenuPresenter interface takes over the
responsibility of generating views or adapters for menu
items. MenuBuilder/MenuItemImpl still provide extra metadata tracking
used by these presenters. Mutiple presenters may be active for a
single menu at a time. All of this remains internal framework
implementation details.

BaseMenuPresenter provides a simple base for presenters that treats
the host MenuView more like an AdapterView. This allows for less
rebuilding of views when items are added/removed.

Callbacks have been restructured. Calls that relate to the menu itself
are still handled by MenuBuilder.Callback, but calls related to a
specific presentation of a menu are handled by MenuPresenter.Callback
objects attached to a MenuPresenter.

Also add API to programmatically set divider options for LinearLayout
and hidden API so that ActionBarView can have finer-grained control
over divider placement.

Change-Id: I2265b86a084279822908021aec20dfbadc1bb56b
2011-04-19 13:49:39 -07:00
Wink Saville
343c1ad720 am 37677849: am 64c42cae: Rename HierarchicalStateMachine and HierarchicalState to StateMachine and State.
* commit '37677849998e6c9a39afe0a730b2f0131a371f3b':
  Rename HierarchicalStateMachine and HierarchicalState to StateMachine and State.
2011-04-18 15:28:47 -07:00
Wink Saville
64c42cae44 Rename HierarchicalStateMachine and HierarchicalState to StateMachine and State.
Change-Id: Ib4b33894da75f5f156066092fb145b478e52f7d7
2011-04-18 14:55:10 -07:00
Dianne Hackborn
230c323231 Merge "More battery stats improvements." 2011-04-15 12:54:15 -07:00
satok
68f1b78b7b Add an API to get the last used input method subtype
Bug: 4075039

- Voice input requires to know the last used input method subtype.

Change-Id: I603a4fb88a2af5195e52188adfa6585ad80304fa
2011-04-15 13:49:33 +09:00
Dianne Hackborn
1fadab5c36 More battery stats improvements.
We now write to the parcel using deltas.  For common situations,
it only takes 4 bytes to write a delta (new command, time delta,
significant state changes, flags indicating additional state that
follows).

Increasing the buffer size to 128K, this give us 32,768 samples
if they all fit in the smallest delta.  A device that is doing
something every minute (like acquiring a wake lock or doing a
wifi scan) for our max target battery life of 30 days would
generate 43,200 samples.

Also some turning to the maximum time between samples at which
we decide to completely collapse two samples.

Change-Id: I074a698d27ccf9389f9585abfc983af2f5ba7a54
2011-04-14 18:02:16 -07:00
Dianne Hackborn
0ffc988a7f Rewrite battery history storage.
We now write battery history directly into a buffer, instead of
creating objects.  This allows for more efficient storage; later
it can be even better because we can only write deltas.

The old code is still there temporarily for validation.

Change-Id: I9707d4d8ff30855be8ebdc93bc078911040d8e0b
2011-04-14 10:57:22 -07:00
Wink Saville
37e344cbe2 am 1b00dc66: am 3156a8c1: Merge "Move ProcessedMessage into HierarchicalStateMachine." into honeycomb-LTE
* commit '1b00dc66d4b61b9a2bf44f76a9d3f54be91a2dbf':
  Move ProcessedMessage into HierarchicalStateMachine.
2011-04-11 12:11:14 -07:00
Wink Saville
d3059487ab Move ProcessedMessage into HierarchicalStateMachine.
ProcessedMessage is really private to HSM and so moving
it into the HSM class.

Change-Id: Ida476fc7aae5e9bfb6ac632dac979e11f489b6fc
2011-04-11 11:51:28 -07:00
Brian Carlstrom
ceb889711f Merge "Tolerate missing AccountManager resource, not just missing resource name" 2011-04-08 10:28:34 -07:00
satok
b3fc1a5b8b Rename CorrectionSpan to SuggestionSpan
Change-Id: I004b2e012b2de4de959a31da1f55b63ca7c14199
2011-04-08 13:43:19 +09:00
Joe Onorato
43a17654cf Remove the deprecated things from Config.java. These haven't been working since before 1.0.
Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
2011-04-07 19:23:05 -07:00
Brian Carlstrom
46703b0995 Tolerate missing AccountManager resource, not just missing resource name
In addition to the primary change in the subject, also some minor cleanup of javadoc, typos, CloseGuard warning, etc found while working on a new AbstractAccountAuthenticator.

Change-Id: I73f3408773a43a0021a15f8d051fd3dbbdf898a5
2011-04-07 11:58:37 -07:00
Brian Carlstrom
08065b9f09 Tracking merge of dalvik-dev to master
git cherry-pick --no-commit  a80febd83c8bf0b6717da2a7136179bdc906a5b7

git cherry-pick --no-commit  5e642b41cf44c5da7afdd95ab3d5e2bdbf7b31dd

git cherry-pick --no-commit  4886db14c9eee4b6fee69bd54c57c5af04709c4c

git cherry-pick --no-commit  560c685e448769904047507b9484ce8111967d7e

git cherry-pick --no-commit  63dde7a2fcfa53dc531558635b64cea613d3cdb4

git cherry-pick --no-commit  74e5cb91060a379d98dd3a333b5f231bfb4f502e

git cherry-pick --no-commit  1cc8c9708b555e2e338b7798d38887a2fefcfea6

git cherry-pick --no-commit  09625a21f5abe0c0db15757f58585d552d62c3d7

git cherry-pick --no-commit  fcb02dfe0f5a2bb7c07e6d6fc69f756a484b5458

git cherry-pick --no-commit  a68cb7fa3ab42854768b8145ff85231663770292

git cherry-pick --no-commit  716beb1c131dd2c6b805d4f681debaa20075010c

git cherry-pick --no-commit  8c29b1097a7afe3a77e27546a56e396f3620a4ec

git cherry-pick --no-commit  9c6a1a55d1c8086c1cc57464eea43725694ff70c

git cherry-pick --no-commit  b14f5ea5c57acdd009ba5b51f1bbe430f3d353b8

Change-Id: I8cc94175441b009e23549762d6baee1dbace4881
2011-04-01 16:00:23 -07:00
Brian Carlstrom
07fe409787 Merge "SamplingProfilerIntegration and SamplingProfiler improvements (3/3)" 2011-03-29 22:35:40 -07:00
Brian Carlstrom
ed7e00729f SamplingProfilerIntegration and SamplingProfiler improvements (3/3)
Summary:

frameworks/base
- fix profiling to collect data beyond the first snapshot
- avoid many small files, accumulate data over process lifetime

libcore:
- add support for VM specific sampling, trying to cut down overhead
- added support for converting snapshot files to text format
- fixed race in profiler when stopping

dalvik
- added VMStack.setThreadStackTrace interface for filling a stack
  trace into an existing StackTraceElement[]

Details:

frameworks/base

    Changed snapshots from text to binary hprof format (bumping version to 3)
    Changed from one file per snapshot to one file per process lifetime.
    Restart profiling after snapshot.

	core/java/com/android/internal/os/SamplingProfilerIntegration.java

    Add quick test in maybeSnapshot to avoid doing work when the
    SamplingProfilerIntegration is disabled. Make maybeSnapshot
    private. Remove unneeded memory allocation in handleLowMemory.

	core/java/android/app/ActivityThread.java

libcore

    Added ThreadSampler interface. This allows VM specific thread
    sampling optimizations. The portable version continues to use
    Thread.getStackTrace().

	dalvik/src/main/java/dalvik/system/profiler/ThreadSampler.java
	dalvik/src/main/java/dalvik/system/profiler/PortableThreadSampler.java
	dalvik/src/main/java/dalvik/system/profiler/SamplingProfiler.java

    Add VMStack.setThreadStackTrace and use in new DalvikThreadSampler
    to avoid allocating a full stack trace when only a limited depth
    is desired.

	dalvik/src/main/java/dalvik/system/profiler/DalvikThreadSampler.java
	dalvik/src/main/java/dalvik/system/VMStack.java

    Refactored BinaryHprof.readMagic out of BinaryHprofReader so it
    can be used by HprofBinaryToAscii converter to probing file
    types. Added magic number constant to be shared between readMagic
    and BinaryHprofWriter.

	dalvik/src/main/java/dalvik/system/profiler/BinaryHprof.java
	dalvik/src/main/java/dalvik/system/profiler/BinaryHprofReader.java
	dalvik/src/main/java/dalvik/system/profiler/BinaryHprofWriter.java
	dalvik/src/main/java/dalvik/system/profiler/HprofBinaryToAscii.java

    Removed unneeded HprofWriter interface. Changed to simpler static
    interface to write HprofData to binary and text formats.

	dalvik/src/main/java/dalvik/system/profiler/HprofWriter.java
	dalvik/src/main/java/dalvik/system/profiler/AsciiHprofWriter.java
	dalvik/src/main/java/dalvik/system/profiler/BinaryHprofWriter.java
	dalvik/src/test/java/dalvik/system/profiler/SamplingProfilerTest.java

    Added support for reading snapshot files created by
    SamplingProfilerIntegration by stripping the text header to allow
    easier conversion to the text format.

	dalvik/src/main/java/dalvik/system/profiler/HprofBinaryToAscii.java

    Fixed race between Sampler and
    SamplingProfiler.stop. SamplingProfiler.stop previously simply
    called the Sampler's TimerTask.cancel method, but this does not
    wait for a currently running Sampler to finish. The TimerTask
    documentation says the only reliable way to do this is to have the
    run() cancel itself, so that is what is now done, with new code to
    ensure that SamplingProfiler.stop does not return until the
    Sampler has been terminated.

	dalvik/src/main/java/dalvik/system/profiler/SamplingProfiler.java

dalvik

   Refactored VMStack_getThreadStackTrace to create helper getTraceBuf
   used to implement new VMStack_setThreadStackTrace. The new version
   interface fills an existing StackTraceElement[], avoid allocating
   unnecessary StackTraceElements.

	vm/native/dalvik_system_VMStack.c

   Refactor dvmGetStackTraceRaw to create dvmSetStackTraceRaw which
   fills in an existing, potentially smaller, StackTraceElement[].

	vm/Exception.c
	vm/Exception.h

   Change stack depths to be unsigned to avoid signed/unsigned comparison warnings.

	vm/Ddm.c
	vm/Exception.c
	vm/Exception.h

Change-Id: I4b90255e4e1d33ea2b569321c4968b0f3369f251
2011-03-29 11:24:37 -07:00
satok
e3797a15fb Removed APIs for setCorrectionSpan from InputConnection
("setCorrectionSpan" was added in Id3abc9ea4d11753cd )

Also..
- Added a class java doc for CorrectionSpan
- Removed FLAG_DEFAULT
- Changed the return type of getSuggestions from Array<CharSequence> to String[]

Change-Id: If5eb091e307a7a40c5b4a70ec1fe6059ecd9fb2d
2011-03-26 07:20:34 +09:00
Adam Cohen
ba08462ebe Merge "Modifying RemoteViewsFactory interface" 2011-03-25 11:19:34 -07:00
Brian Carlstrom
4ad06c32bd Merge "Tracking SamplingProfiler change in libcore" 2011-03-24 20:38:05 -07:00
Adam Cohen
2625feae79 Modifying RemoteViewsFactory interface
-made onDestroy() one way
-moved uncaught exception handling to the application process

Change-Id: I958571a34eaa48b27e441e3a117c109fb2d2c644
2011-03-24 19:50:22 -07:00
Brian Carlstrom
a9602db3d5 Tracking SamplingProfiler change in libcore
Change-Id: Ic45a1570c01340a5406468a9d0f2a5357175fd80
2011-03-24 17:06:41 -07:00
Adam Powell
1147bb6989 Merge "Fix bug 4084399 - with usb keyboard, actionbar menuitems with icon+text take dpad focus twice in row" 2011-03-24 15:57:55 -07:00
Adam Powell
6bddd8771d Fix bug 4084399 - with usb keyboard, actionbar menuitems with
icon+text take dpad focus twice in row

Fix action menu item layout focusability so that only the full item is
focusable. Fix up listeners appropriately.

Change-Id: I127c36404894869a08c5f4472491e3e596563c5c
2011-03-24 15:56:07 -07:00
Jeff Brown
b7c25ce3ae Merge "Add MotionEvent.HOVER_ENTER and HOVER_EXIT." 2011-03-24 15:38:04 -07:00
Jeff Brown
a032cc0086 Add MotionEvent.HOVER_ENTER and HOVER_EXIT.
The input dispatcher sends a HOVER_ENTER to a window before dispatching
it any HOVER_MOVE events.  For compatibility reasons, the window will
*also* receive the HOVER_MOVE.  When the pointer moves into a different
window or the pointer goes down or when events are canceled for some reason,
the input dispatcher sends a HOVER_EXIT to the previously hovered window.

The view hierarchy behavior is similar.  All views under the pointer
receive onHoverEvent with HOVER_ENTER followed by any number of HOVER_MOVE
events.  When the pointer leaves a view, the view receives HOVER_EXIT.
Similarly, if a parent view decides to capture hover by returning true
from onHoverEvent, the hovered descendants will receive HOVER_EXIT.

The default behavior of onHoverEvent is to update the view's hovered
state by calling setHovered(true/false).  Views can query their current
hovered state using isHovered().

For testing purposes, the hovered state is mapped to the pressed
drawable state.  This will change in a subsequent commit with the
introduction of a new hovered drawable state.

Change-Id: Ib76a7a90236c8f2c7336e55773acade6346cacbe
2011-03-24 15:37:04 -07:00
Adam Powell
d814504979 Fix bug 3484000 - ActionBar visibility issue
Fix up action bar visibility state when shown without animation.

Change-Id: I51e56e2c983d7bb608bb6834d39ac2c5d926d63c
2011-03-24 14:18:27 -07:00
Adam Powell
07e1f988c0 Fix bug 4136071 - CAB causes the action bar to be shown, regardless of
previous state

Hide the action bar upon finishing a mode if it was hidden when the
mode started. If show() is called while the mode is active, the bar
will not hide when the mode finishes.

Change-Id: I7d9b593b9ecd9fa633251abebcdca0d85405252a
2011-03-24 11:12:58 -07:00
Adam Powell
1969b87990 Fix bug 4142917 - Add support for specifying a custom home icon in action bar
Add ActionBar methods for setting icon and logo.

Change-Id: I6151689138c734b7212c3469b8ba8f28f0fd5ec4
2011-03-22 14:11:06 -07:00
Carl Shapiro
8f4c49d86e Merge "Remove dead code from the Zygote initialization." 2011-03-21 17:04:25 -07:00
Carl Shapiro
f973eaae08 Remove dead code from the Zygote initialization.
Change-Id: Iad66437d6dae01ab94cfade86f3f7416a2896728
2011-03-21 16:49:16 -07:00
Daisuke Miyakawa
21c83b4d9f am f15b3db3: am 10221a22: am b02d3956: am e16a1bfa: Use system locale list.
* commit 'f15b3db3eb69683d23f379697cf86f8487845847':
  Use system locale list.
2011-03-18 11:31:10 -07:00
Daisuke Miyakawa
10221a22dd am b02d3956: am e16a1bfa: Use system locale list.
* commit 'b02d395650a9a5fb13812cefa0ada1501f5b6d62':
  Use system locale list.
2011-03-18 11:27:22 -07:00
Daisuke Miyakawa
b02d395650 am e16a1bfa: Use system locale list.
* commit 'e16a1bfa9cd9a9a0430e2fe890586ae451f0faaf':
  Use system locale list.
2011-03-18 11:23:00 -07:00
Daisuke Miyakawa
e16a1bfa9c Use system locale list.
Context's assets may be different from system's. We should
prefer system's to reflect PRODUCT_LOCALE.

Bug: 4104675
Change-Id: I968c3baf6bfeb945f1b71ec709d5088332482319
2011-03-17 19:56:13 -07:00
satok
adb435835f Add CorrectionSpan and APIs to pass a secure CorrectionSpan to TextView
- CorrectionSpan is a span which has suggestions made by IME.
This has a function to change the current IME to other IME specified
in this span. For security reasons, only the current IME
is allowed to use this function through InputConnection.
(IME token is used for checking the validity of it.).

- CorrectionSpan stores following information:

flags, subtype Id, InputMethodInfo Id, suggests, locale, original string

Change-Id: Id3abc9ea4d11753cdc4f483a2bb3128f49ba198a
2011-03-16 14:44:37 +09:00
Kenny Root
d022c23aed Merge "Revise free space checks for package installs" 2011-03-15 14:48:56 -07:00
Adam Powell
e196481d59 am fbe9ca72: am 1d233d97: Merge "Fix bug 4088936 - Tabs in the action bar don\'t seem to have a fading edge" into honeycomb-mr1
* commit 'fbe9ca72625e9789f334e96b731a6ce0e4153ada':
  Fix bug 4088936 - Tabs in the action bar don't seem to have a fading edge
2011-03-15 13:01:32 -07:00
Adam Powell
fbe9ca7262 am 1d233d97: Merge "Fix bug 4088936 - Tabs in the action bar don\'t seem to have a fading edge" into honeycomb-mr1
* commit '1d233d9708e39f5b57b231746df658567b153484':
  Fix bug 4088936 - Tabs in the action bar don't seem to have a fading edge
2011-03-15 12:51:07 -07:00
Adam Powell
c18c38f36e Fix bug 4088936 - Tabs in the action bar don't seem to have a fading edge
Change-Id: I23c736ad458c721dfa86563f66b42dd5d6ca708e
2011-03-15 11:57:46 -07:00
Brad Fitzpatrick
7fa77d8b23 am b81d7f83: am 33dd1bae: am 29d75c9a: Merge "Fixing improper boxing to Integer instead of Long."
* commit 'b81d7f833890498b6d5db9c16f32564cc88a4042':
  Fixing improper boxing to Integer instead of Long.
2011-03-15 11:44:43 -07:00
Brad Fitzpatrick
b81d7f8338 am 33dd1bae: am 29d75c9a: Merge "Fixing improper boxing to Integer instead of Long."
* commit '33dd1bae6ef16ed1cdc4d9f82f0c608cc7601af6':
  Fixing improper boxing to Integer instead of Long.
2011-03-15 11:42:58 -07:00
Brad Fitzpatrick
33dd1bae6e am 29d75c9a: Merge "Fixing improper boxing to Integer instead of Long."
* commit '29d75c9a10a1ff6d60e85a1931d042d3e24d9549':
  Fixing improper boxing to Integer instead of Long.
2011-03-15 11:30:08 -07:00
Brad Fitzpatrick
29d75c9a10 Merge "Fixing improper boxing to Integer instead of Long." 2011-03-15 11:03:29 -07:00
Kenny Root
62e1b4e9d4 Revise free space checks for package installs
Change-Id: Ie72bbab77aa89a50ec096edc1f471eab74829e67
2011-03-14 17:18:24 -07:00
Mike Lockwood
0c5820ad8e am 151c74b3: am e976ff4a: Merge "Add a dialog to ask user to start an application for a USB device or accessory" into honeycomb-mr1
* commit '151c74b3c679a1799d01f210a2a3f4a658154320':
  Add a dialog to ask user to start an application for a USB device or accessory
2011-03-14 07:10:07 -07:00
Mike Lockwood
151c74b3c6 am e976ff4a: Merge "Add a dialog to ask user to start an application for a USB device or accessory" into honeycomb-mr1
* commit 'e976ff4a2203e5a01c9a1c1a018ba9e5ab7777f7':
  Add a dialog to ask user to start an application for a USB device or accessory
2011-03-14 06:55:24 -07:00