Added the concept of pointer properties in a MotionEvent.
This is currently used to track the pointer tool type to enable
applications to distinguish finger touches from a stylus.
Button states are also reported to application as part of touch events.
There are no new actions for detecting changes in button states.
The application should instead query the button state from the
MotionEvent and take appropriate action as needed.
A good time to check the button state is on ACTION_DOWN.
As a side-effect, applications that do not support multiple buttons
will treat primary, secondary and tertiary buttons identically
for all touch events.
The back button on the mouse is mapped to KEYCODE_BACK
and the forward button is mapped to KEYCODE_FORWARD.
Added basic plumbing for the secondary mouse button to invoke
the context menu, particularly in lists.
Added clamp and split methods on MotionEvent to take care of
common filtering operations so we don't have them scattered
in multiple places across the framework.
Bug: 4260011
Change-Id: Ie992b4d4e00c8f2e76b961da0a902145b27f6d83
Views requesting lights out mode will cause the navbar to
disappear (this is useful for viewing videos/photos/etc
using every pixel of the screen).
But there's a catch: any user activity at all will cause the
lights to come back on and the navbar to return.
Change-Id: I535ed3ba9ae7fab3282c402be256add765395b6f
Add a method on ViewGroup to determine whether it supports scrolling.
This allows us to show the pressed feedback immediately in many cases,
improving responsiveness of buttons, etc.
This patch also lengthens the timeout in order to reduce flashes
when the user is scrolling.
Change-Id: Ieb91ae7a1f8e8f7e87448f2a730381a53947996f
Split action bar implementation details. Factor out common components
into AbsActionBar. Layout rules for the lower half of split action
bars.
Change-Id: I6bc39ba6c343055597880a7d4663dd8f30aa4999
- Use Protocol for BASE of CMD's.
- Add synchronous connect methods.
- Back port sha1 c23971b3e4f92ac31996d4f9f32eef3cb4ef65fd from master
Change-Id: If0b3f6cbbb8d4268cad6ca19d26ab2ee42390d86
Apply (or extend) the theme Theme.Holo.SplitActionBarWhenNarrow or
Theme.Holo.Light.SplitActionBarWhenNarrow to enable splitting the
action bar across both the top and bottom of the screen. This places
the action menu along the bottom, leaving more room at the top for
titles, navigation, and custom views and more room at the bottom for
menu items.
TODO: Refine layout of the action menu when placed at the bottom of
the screen. Make action modes split as well.
Change-Id: I92c91f99c533f26aecf6b828ed041386c4f16922
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
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
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
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
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
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
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
("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