284 Commits

Author SHA1 Message Date
Mathias Agopian
83c64e6b62 frameworks/base refactoring
create the new libandroidfw from parts of libui and libutils

Change-Id: I1584995616fff5d527a2aba63921b682a6194d58
2012-02-20 22:38:43 -08:00
Mathias Agopian
b93a03f841 frameworks/base refactoring.
First step. Move libui includes to their new home: androidfw.

Change-Id: Ic042b52fdba72f30edc3cc6339bf30b4c1b99662
2012-02-17 15:36:10 -08:00
Jeff Brown
62d1058cc9 Merge "Remove the input dispatcher throttle." 2012-02-13 10:26:33 -08:00
Mike Lockwood
a21e945502 BatteryService: Don't fail to register native methods if kernel power supply driver is missing
Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 12:00:32 -08:00
Mike Lockwood
b01e8bf57b New Serial Manager API:
SerialManager: provides access to serial ports
SerialPort: for reading and writing data to and from serial ports

IO with both array based and direct ByteBuffers is supported.

Accessing serial ports requires android.permission.SERIAL_PORT permission

Each platform must configure list of supported serial ports in the
config_serialPorts resource overlay
(this is needed to prevent apps from accidentally accessing the bluetooth
or other system UARTs).

In addition, the platform uevent.rc file must set the owner to the
/dev/tty* files to "system" so the framework can access the port.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 10:51:19 -08:00
Jeff Brown
308028049a Remove the input dispatcher throttle.
This is part of a series of changes to improve input system pipelining.

Bug: 5963420
Change-Id: Iab33594bc5df8aa05232ef64c64e98fc61c5bf52
2012-02-07 18:38:11 -08:00
Steve Block
ec193dec4d Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGE
See https://android-git.corp.google.com/g/157519

Bug: 5449033
Change-Id: I8ceb2dba1b031a0fd68d15d146960d9ced62bbf3
2012-01-09 21:36:22 +00:00
Steve Block
3762c31172 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Steve Block
8564c8da81 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2012-01-06 10:07:54 +00:00
Steve Block
6215d3ff4b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Steve Block
5baa3a62a9 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Mathias Agopian
3f15700a01 split ComposerService out of SurfaceComposerClient.h
Change-Id: I1eb691f7ca263d5895d871ab675bb5826e0323c6
2011-11-28 15:21:57 -08:00
Jeff Brown
1e08fe90df Eliminate hw.keyboards system properties.
Stop using system properties to publish information about
the key character map path.  Instead, we can retrieve it
on demand by asking the window manager.

It was possible to exhaust the supply of system properties
when repeatedly adding and removing input devices.

Bug: 5532806
Change-Id: Idd361a24ad7db2edc185c8546db7fb05f9c28669
2011-11-15 18:00:10 -08:00
Dima Zavin
98e044a609 BatteryService(jni): properly handle read's return value
Change-Id: I10f5cf3728424e7f5a0c1b460049102fd00a6246
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-28 23:15:11 -07:00
Jeff Brown
d5bb82d18c DO NOT MERGE. Improve screenshot chord debouncing.
Bug: 5011907

Introduce a 150ms delay in handling volume down keys
while waiting to see if a power key will follow.

Don't trigger the screenshot chord if both volume up and
volume down are pressed together.

Don't trigger the long-press power menu if volume keys are
also pressed.

Require the user to press both keys in the chord within
the debounce time and continue long-pressing them in order
to trigger the screenshot action.

Change-Id: I248968d37b73c09d6d08e7f62667c443eba32da0
2011-10-12 15:05:59 -07:00
Jeff Brown
cc4f7db698 Fix input channel leak.
Bug: 5156144

Input channels could leak or simply live longer than they should
in some cases.

1. Monitor channels (used by the pointer location overlay) are never
   unregistered, so they would leak.

   Added code to handle failures in the receive callback by closing
   the input channel.

2. The DragState held onto its input window and application handles
   even after the input channel was disposed.

   Added code to null these handles out when they are no longer needed.

3. Input channels previously used as input event targets would stick
   around until the targets were cleared (usually on the next
   event).

   Added code to detect when the input dispatcher is in
   an idle state and to proactively clear the targets then
   to ensure that resources are released promptly.

4. Native input window handles held onto the input channel even
   after the input window was removed from the input dispatcher.
   Consequently, the input channel would not be disposed until
   the input window handle itself was freed.  Since the input
   window handle is held from managed code, this meant that the
   window's input channel could stick around until the next GC.

   Refactored the input window handle to separate the properties
   (info) and identify (handle) state into different objects.
   Then modified the dispatcher to release the properties (info)
   when no longer needed, including the input channel.

7. The pointer location overlay does not actually use its
   standard input channel, only the monitor input channel.

   Added INPUT_FEATURE_NO_INPUT_CHANNEL to allow windows to
   request that they not be provided with an input channel
   at all.

Improved some of the error handling logic to emit the status
code as part of the exception message.

Change-Id: I01988d4391a70c6678c8b0e936ca051af680b1a5
2011-08-30 21:40:28 -07:00
Jeff Brown
daf4a127ba Add a "show touches" option for demos and presentations.
Bug: 4569045

Change-Id: I8726ea292dd7def790a5e40d7d7e58968974f896
2011-08-26 17:14:14 -07:00
Jeff Brown
65fd251c39 Input system bug fixes, particularly for stylus.
Bug: 5049148

Finished stylus support, including support for indirect stylus
and mouse tools.

Added TILT axis.  When stylus tilt X/Y is available, it is transformed
into an orientation and tilt inclination which is a more convenient
representation and a simpler extension to the exiting API.

Touch devices now only report touch data using a single input
source.  Previously touch devices in pointer mode would report
both absolute touch pad data and cooked pointer gestures.
Now we just pick one.  The touch device switches modes as needed
when the focused application enables/disables pointer gestures.
This change greatly simplifies the code and reduces the load
on the input dispatcher.

Fixed an incorrect assumption that the value of ABS_(MT_)DISTANCE
would be zero whenever the stylus was in direct contact.  It appears
that the correct way to determine whether the stylus is in direct
contact (rather than hovering) is by checking for a non-zero
reported pressure.

Added code to read the initial state of tool buttons and axis values
when the input devices are initialized or reset.  This fixes
problems where the input mapper state might have the wrong initial
state.

Moved responsibility for cancelling pending inputs (keys down,
touches, etc.) to the InputDispatcher by sending it a device reset
notification.  This frees the InputReader from having to synthesize
events during reset, which was cumbersome and somewhat brittle
to begin with.

Consolidated more of the common accumulator logic from
SingleTouchInputMapper and MultiTouchInputMapper into
TouchInputMapper.

Improved the PointerLocation output.

Change-Id: I595d3647f7fd7cb1e3eff8b3c76b85043b5fe2f0
2011-08-19 15:02:26 -07:00
Jeff Brown
89ef0720ee Add input system to Watchdog.
Bug: 5094994

Change-Id: I153866958efc64ac19bda8b997c1c9f6ad425ec4
2011-08-10 16:25:21 -07:00
Mike Lockwood
2b15cb21b3 Resolve merge conflict for '75f1fdec':
GPS Provider Service changes

    GPS engine needs to receive network state changes from Android fw.

    Added db query for the current APN, also added a new parameter
    between JNI / HAL to the new method in AGpsRilInterface struct
    for gps engine to receive APN from GPSLocationService

Conflicts:
	services/java/com/android/server/location/GpsLocationProvider.java

Change-Id: I33c45027f1571493d3525324f62d199517c4960c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-08-04 11:40:25 -04:00
Mike Lockwood
75f1fdec3e am 0b3af353: am a82ee49a: am 8f5dd9ad: Merge "GPS Provider Service changes"
* commit '0b3af353dcf61177158934a11404cf2914038696':
  GPS Provider Service changes
2011-08-04 07:53:53 -07:00
Kevin Tang
a5fe6b2efe GPS Provider Service changes
GPS engine needs to receive network state changes from Android fw.

Added db query for the current APN, also added a new parameter
between JNI / HAL to the new method in AGpsRilInterface struct
for gps engine to receive APN from GPSLocationService

Change-Id: I62e35c948d2ac1961771d1a10581a3b8e695c05a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-08-04 10:33:35 -04:00
Mike Lockwood
b7d95a46df am 21700fed: am 5f7203eb: am 5a27a754: am bd1dee94: Merge "gps: Adding ip address for AGps"
* commit '21700fedfe29f6a0a752d2bea46142038e69136c':
  gps: Adding ip address for AGps
2011-07-28 14:06:07 -07:00
Mike Lockwood
21700fedfe am 5f7203eb: am 5a27a754: am bd1dee94: Merge "gps: Adding ip address for AGps"
* commit '5f7203eb258503bc5d2ba29176bdf483a68a93b8':
  gps: Adding ip address for AGps
2011-07-28 14:04:13 -07:00
Stephen Li
8efd74dbed gps: Adding ip address for AGps
Change-Id: Ic590187d159853de2f1bd2912e159f0a00d8fb10
2011-07-28 16:50:45 -04:00
Jeff Brown
bc68a59c02 Report the external display size to the input reader.
The input reader needs this information so that it knows how to
interpolate touches on an external touch screen.

Changed Display so that it asks the WindowManager what the real
display size is (as opposed to the raw display size).  This means
it now takes into the forced display size set by
adb shell am display-size.

Replaced all calls to getRealWidth() / getRealHeight() /
getRealMetrics() in the WindowManager and replaced them with direct
usages of the mCurDisplayWidth / mCurDisplayHeight so that the WM
doesn't end up making a reentrant Binder call into itself.

Fixed the table status bar HeightReceiver so that it updates the
height on all configuration changes since it is possible that the
display size changed independently of an external HDMI display
being plugged / unplugged.

Improved the Display class documentation to make the distinctions
betweeen the various sizes clearer.

Change-Id: I3f75de559d3ebffed532ab46c4ae52c5e7f1da2b
2011-07-25 20:10:12 -07:00
Mike Lockwood
d462ecf8f8 USB: Fix handling USB accessory attached when device is booting
Also defer anything that could start an activity from "system ready"
to "boot completed" time.

Bug: 5051683

Change-Id: I69db751cb991dd247bd0ac3c70a0d84c0d71f365
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-21 14:30:36 -07:00
Chia-chi Yeh
eb2591f8f7 Merge "VPN: Hook up the new control protocol and network state." 2011-07-14 15:22:59 -07:00
Chia-chi Yeh
97a61565ea VPN: Hook up the new control protocol and network state.
1. No more End-Of-Arguments.
2. Daemons close the control socket after they are initialized.
3. No more system properties.
4. ip-up-vpn now creates state to pass the configuration.
5. JNI methods are split again for legacy VPN.

Change-Id: I02fafdf01d425c965345ef712b2bd5fdee3a0cab
2011-07-14 15:07:42 -07:00
Jeff Brown
9302c8796f Refactor input dispatcher use of window/app handles.
This change moves the cached window and application input state
into the handle objects themselves.  It simplifies the dispatcher
somewhat because it no longer needs to fix up references to
transient InputWindow objects each time the window list is updated.

This change will also make it easier to optimize setInputWindows
to avoid doing a lot of redundant data copying.  In principle, only
the modified fields need to be updated.  However, for now we
continue to update all fields in unison as before.

It turns out that the input dispatcher was inappropriately retaining
pointers to InputWindow objects within the mWindows InputWindow
vector.  This vector is copy-on-write so it is possible and the
item pointers to change if an editing operation is performed on
the vector when it does not exclusively own the underlying
SharedBuffer.  This bug was uncovered by a previous change that
replaced calls to clear() and appendVector() with a simple use
of operator= which caused the buffer to be shared.  Consequently
after editItemAt was called (which it shouldn't have, actually)
the buffer was copied and the cached InputWindow pointers became
invalid.  Oops.  This change fixes the problem.

Change-Id: I0a259339a6015fcf9113dc4081a6875e047fd425
2011-07-14 04:11:21 -07:00
Mike Lockwood
c1b9bbb21c Remove some #ifdef HAVE_ANDROID_OS that were needed for the simulator build
Change-Id: I13d9f251f86c05ae5405f37adbf6b8e9660935ba
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-13 19:45:44 -04:00
Jeff Brown
bd882b1c87 Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
2011-07-11 22:12:16 -07:00
Chia-chi Yeh
c2b8aa0b4c VPN: rename some variables.
Change-Id: I7f15b5ab30f591e26242fca27af25f578809534c
2011-07-03 18:00:47 -07:00
Chia-chi Yeh
8bc003e2f6 Merge "VPN: merge JNI methods." 2011-07-02 16:37:25 -07:00
Chia-chi Yeh
3281034c1c VPN: merge JNI methods.
Legacy VPN needs to change routes by itself.

Change-Id: I4cf6639f2b00225810f49704ae05797fc70921d9
2011-07-02 16:16:03 -07:00
Jeff Brown
a4d1bc5172 Drop obsolete touch screen hacks.
Change-Id: I47354c37ee2cc2b36340eb709bb5043b3ba78ed9
2011-07-01 19:23:40 -07:00
Chia-chi Yeh
9c0835fd72 VPN: correct the netmask for IPv4.
Change-Id: Id6e955af129d55120676d0d9cfe75388671aa367
2011-06-30 22:59:18 -07:00
Chia-chi Yeh
f4e3bf892e VPN: refactor few JNI methods for the usage of legacy VPN.
Now default routes are handled in JNI instead of VpnBuilder.

Change-Id: Ib026bba6793b64aae0f8356df3d2aaae489d08b4
2011-06-30 12:41:11 -07:00
Mike Lockwood
9b9fb5cc08 GPS: Support for on-demand NTP time injection
Change-Id: I83db0249c13598070ed70b9f90207305b60b468f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-29 15:09:40 -04:00
Chia-chi Yeh
84bf7390ea VPN: make the file descriptor non-blocking by default.
Change-Id: I89899b2b6a8ac64a4a052ffd501cc0221fab3ffe
2011-06-16 19:01:28 -07:00
Jeff Brown
474dcb5c3d Add support for disabling pointer gestures.
Made it possible for individual windows to disable pointer gestures
while the window has focus using a private API.

Cleaned up the InputReader configuration code to enable in-place
reconfiguration of input devices without having to reopen them all.
This change makes changing the pointer speed somewhat nicer since the
pointer doesn't jump back to the origin after each change.

Change-Id: I9727419c2f4cb39e16acb4b15fd7fd84526b1239
2011-06-14 22:07:31 -07:00
Chia-chi Yeh
96c7e70000 VPN: do not allow zero prefix length in routing rules.
The public API splits default route into two narrower routes.
Add this check in case some one calls the private API.

Change-Id: Ie1fc0155b74415b971380bc8429cd74026c3fda0
2011-06-13 18:29:54 -07:00
Chia-chi Yeh
8ea928945b VPN: do not use gateway in routing rules.
The first release of this API only supports TUN interface, and
so far there is no plan for TAP. TUN works on IP frames which
makes gateway nearly useless. The only value to have a gateway
is that kernel may use it to select the source address. However
currently it does not work in IPv6, and even in IPv4 applications
can bind to any local address on the device. Remove it to keep
the API clear, and it can be added back at any time if needed.

Change-Id: If9086d20d885a3a7f7ab5f07afbcfeecb677bbea
2011-06-13 17:59:58 -07:00
Chia-chi Yeh
23a5e4bcdc VPN: tolerate duplicated routes.
Change-Id: I0f9efa8c3af3d4859358438745a5cd2c4ad376ca
2011-06-13 16:14:49 -07:00
Chia-chi Yeh
6ddd57491a VPN: fix a bad optimization of zeroing ifr_flags lately.
Change-Id: Ib7d89422ef0a9159ba912cf32b678821cb72a25a
2011-06-13 16:08:01 -07:00
Chia-chi Yeh
6224b5ec38 VPN: set IFF_NO_PI on TUN interface.
Packet info header (struct tun_pi) was required to support IPv6
in kernel prior to 2.6.26. Setting IFF_NO_PI will remove the header
from the packets sent/recieved via TUN file descriptor, so now they
are just raw IP packets.

Change-Id: I0b4ae9db23d3bc10995a00eb053527b499ad6eb6
2011-06-13 15:26:51 -07:00
Chia-chi Yeh
3663227a8b VPN: add MTU support.
Change-Id: Ia2f06ae1fcf065bde7dafd212b84b37a34f1a47e
2011-06-13 15:05:37 -07:00
Chia-chi Yeh
3667369807 VPN: use ParcelFileDescriptor.adoptFd() instead of doing it in JNI.
This removes the dependency of android_util_Binder.h.
This change also removes some redundant zeroing.

Change-Id: Ie9fedd471dfa198f9a3261e03651f945cefbbf61
2011-06-13 14:32:18 -07:00
Mike Lockwood
8df5fcfa62 am 6d60190a: am e502c536: am b3174c46: UsbService: Fix JNI reference leak
* commit '6d60190a3156e0ac69c800bbb10691b70ae9bd54':
  UsbService: Fix JNI reference leak
2011-06-10 10:32:16 -07:00
Mike Lockwood
b3174c46ad UsbService: Fix JNI reference leak
http://code.google.com/p/android/issues/detail?id=17365

Change-Id: Ice0174e0db2a785d32ac16694ebf3b7ddb1b7fb3
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-09 14:48:11 -04:00