summaryrefslogtreecommitdiffstats
path: root/services/jni
Commit message (Collapse)AuthorAgeFilesLines
* Re-implement orientation aware volume buttons at lower levelnadlabak2013-09-171-0/+31
| | | | | | | | | | | | | | | | | | | | Rework of http://review.cyanogenmod.org/31979 Fixes: 1. inconsistent volume button behaviour depending on app in use - the buttons were not swapped for some NDK/OPENSL ES apps like e.g. MX Player 2. the function of volume buttons on external input devices like BT/USB keyboards should not be affected by the main unit orientation This commit finishes http://review.cyanogenmod.org/18273 - use of system property has been replaced with config push via JNI as suggested during the original review. Patch Set 7: Circumvent the need for "keyboard.orientationAware = 1" idc Patch Set 8: Don't leak implementation details outside InputReader Change-Id: I19cc60cb0acb0005ab13fa069f52e3d468d694e7
* Add support for Samsung extended AGPSghepeu2013-07-231-2/+6
| | | | | | | | | | | | The AGPS implementation in the GPS chipset used in some Samsung devices (i9100, i9300) can make use of the Psc field. Adapt the relevant functions hiding the changes incompatible with other devices under the AGPS_USE_PSC #define. Credit to Qaweck from xda-developers forum for finding the meaning of the field. Change-Id: Ie4691c79ca379a1f5c0a87500c1b06b56ae7ac0d
* Correct executable bit for source filesKenny Root2013-04-131-0/+0
| | | | | | | | | | Many media files and source code files were marked as executable in Git. Remove those. Also a shell script and python script were not marked as executable. Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5 Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
* keyboard: adding functional alt/shift lightstbalden2013-04-131-0/+6
| | | | | | | | | | | This is useful for devices that has QWERTY keyboard and leds for the Alt/Shift (Fn/Caps) keys, like htc doubleshot. Depends on libhardware patch for the light ids: http://review.cyanogenmod.org/34902 Change-Id: I66ebc2d881438f5b51db77eaa885421e65a7da0d
* implement 1% battery on select devicesHashcode2013-03-051-4/+34
| | | | | | via ro.product.use_charge_counter=1 Change-Id: I6ae67e36382038c84cd017bc015c9b46b40a59da
* Merge "SystemUI: Add dock battery icon styles" into cm-10.1David van Tonder2013-02-081-80/+0
|\
| * SystemUI: Add dock battery icon stylesJorge Ruesga2013-02-081-80/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for dock battery icon styles. This changes does a refactor of DockBatteryController to extend BatteryController and create a new CircleDockBattery that extends CircleBattery (that listen for dock battery events) Patchset 2: Fully functional. Patchset 3: Fixed min icons. Rebased. Patchset 4: Create full device specific service in frameworks Move dock battery stuff from the framework to a device handler. Register/unregister DockBatteryController receivers Remove battery views if device doesn't support dock battery Refresh status on dock and screen on events Rebased Patchset 5: Transformers backwards compatibility Better main battery status detection (use status instead of plugged type) Fixed battery cluster space in status bar Rebased Patchset 6: Fix dock icons in ligths out mode Patchset 7: Fix code style Fix lockscreen status Fix lights out mode (typo) Fix images size Rebased Patchset 8: Fix icon images Fix status on full charge Rebased TF700T implementation: http://review.cyanogenmod.org/#/c/31298/ Change-Id: I9a576d1b279f1883f736ac3bcd2435c4b95a73de Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* | Revert GPS changes for now until issues are resolved.Steve Kondik2013-02-081-63/+20
|/ | | | | | | | | | | | | | Will do a refactoring to better isolate this code. Revert "GPS fixes" This reverts commit 84c6741f03118168aa61f2e028efae2ea4953a9f. Revert "Squashed commit of GPS changes from CodeAurora" This reverts commit 669786140ea7579dcbe05eb2d5199ebf161239a1. Change-Id: Ib1a55d1be8dbc933c690b2f06af206ab5511903c
* GPS fixesSteve Kondik2013-02-061-1/+0
| | | | | | | * Add gps user to ZygoteInit so QC drivers can set up their sockets. * Fix JNI method signature of reportAGpsStatus Change-Id: I6686ee715ff2db72edbcf4e4daad2feb1670090a
* Squashed commit of GPS changes from CodeAuroraDante Russo2013-02-051-20/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GpsLocationProvider: ipv6 support AGPS calls to accept ipv6 addresses Change-Id: If9187b8fd9e0ba22cd01722d5c04aabccebad38b GPS Provider changes Added support to delete aiding data test feature. Added more data catagories, to now at the total of 21 Change-Id: Icb15d21b8204323021c47eac5249cde128e38246 GPS provider - AGPS Dual APN support To support either SUPL or any WWAN connection - allow connction type at open request API; FW's support to dual AGPS connections Change-Id: Iecb07f31a99353f75c1a0c000bb6e39ef007f6bf Supporting IPv4v6 and IPv6 bearer types for ATL Change-Id: Ife8c72d9975ac58b9e4091cb95ad5a9763e01c3f gps: determine ip protocol type from telephony.db Instead of determining the ip protocol type from the type of ip address we have, the ip protocol type is looked up in telephony.db based on the carrier and apn. Change-Id: Ib0d76354515fb44f570668d5a4a42cccfa6fe78a CRs-Fixed: 376537 gps: get apn when supl is already active When supl is already active, get the apn and bearer and try to connect, instead of reporting failure. CRs-fixed: 401408 Change-Id: I2eed11e0a34a55d1b62d37f0a6c97b1f3f2fecae gps: allow xta data over default mobile connection If the default mobile data connection is up and connected, use that connection to download xta data. Change-Id: Ic5ff5422ac9baf83ac923faeb1f8b4fc9186c184 CRs-fixed: 399721 GpsLocationProvider: Support type wifi in i/F request. Add support in GpsLocationProvider for wifi type for i/F request. Change-Id: I44463e72857c06ae24626b8f3cd482ddac7c278b Conflicts: services/java/com/android/server/location/GpsLocationProvider.java gps: adding net_raw gid for IPC permission for AFW to have permission to call loc api Change-Id: Ifc7451659431fa1c1998f5d75bfa5f2018a5d054 gps: fixed singleshot session that doesn't stop When a single shot location is requested and a location is returned, the location request is not stopped and so it continues even when the requestor has stopped listening. This can cause gps tracking to continue in the backgroud and eat up battery. This is fixed by stoping the provider if there are no more update record associated with it when a location is returned. Change-Id: Ie437732ff06231a46724843af30e21ca3a1694ab gps: return dummy apn instead of null This change was missed during merge, which can cause exception(crash) if apn is returned as null. Change-Id: I15160c8f2f512cc75bbe1b7b7ef4695c201112d8
* Cleanup dock battery supportAlexander Hofbauer2013-01-241-33/+41
| | | | | | | | | | | | | | | Send an intent as soon as the device is undocked to get a timely update of the SystemUI. Adds a proper implementation of dock detection in BatteryService via "dock_battery/device/ec_dock". This will probably have to be rewritten in a more generic way to support other manufacturers as well (once we support other docks at all). Change-Id: Ib1088c118c8695fd93ba085d976ca1eb374ae71e Conflicts: packages/SystemUI/src/com/android/systemui/statusbar/policy/DockBatteryController.java
* Add support for external dock batteriesSteve2013-01-172-0/+76
| | | | | | Allows the external battery status to be read via framework. Change-Id: I1340071cecab8f1733e58e4f3ba0d304f861f311
* input: Add option to toggle pointer icon when using stylusSteve Kondik2013-01-031-0/+33
| | | | | | | | | | | | | * The visible pointer icon when hovering or drawing with the stylus is quite annoying when trying to actually draw with it. Turn it off by default and add an option to turn it on. Change-Id: Ib7f23e8b69589e3f875d150caf05065b64676e44 Conflicts: services/input/InputReader.cpp services/input/InputReader.h services/jni/com_android_server_input_InputManagerService.cpp
* power: Add CPU boosting interfaceSteve Kondik2012-12-271-0/+8
| | | | | | | | * Boosts CPU using Power HAL for the given duration. * Duration is given in microseconds. * Power HAL must implement POWER_HINT_CPU_BOOST. Change-Id: Ic79baf7e3d0f75483c2fe8a242b4c3d93368b68b
* gps: Add support for Qualcomm GPS hardwareSteve Kondik2012-12-072-0/+24
| | | | | | | * This ABI is changed, but we aren't using the new features in MR1. * Add a little translation for the changed fields and methods. Change-Id: Ieecc2235b42f64fc69d4651855f4e9edfe7d738d
* Fix a segfault when there is no power module.Jeff Brown2012-10-091-6/+8
| | | | | | | This can happen in the emulator. Bug: 7315152 Change-Id: I4a3f547127419fcd4dc4fc1c6f7ee869706cf12e
* Blank or unblank all displays as need.Jeff Brown2012-10-081-37/+19
| | | | | | | | Ensures that both the internal display and HDMI are blanked or unblanked in tandem. Bug: 7309812 Change-Id: Ie8b96d393e8bb20d23c92f3320142d9f7cf42aff
* Merge "Pass display arg to blank/unblank" into jb-mr1-devAndy McFadden2012-09-281-2/+4
|\
| * Pass display arg to blank/unblankAndy McFadden2012-09-271-2/+4
| | | | | | | | | | | | | | | | | | blank() and unblank() now take a display argument. For now, just pass the default display in. Bug: 7240511 Change-Id: I7747732471c9116cb6b3686bd95d5f32a63279a6
* | Bundle correlated switch changes atomically.Jeff Brown2012-09-271-6/+6
|/ | | | | | | This is a prerequisite for headset jack detection on Manta. Bug: 6548391 Change-Id: I549a194344511c0cee578b00f6a9ab5fdbdfb99c
* Use more reasonable warning thresholds for power on/off.Jeff Brown2012-09-251-6/+6
| | | | | | | | | | | | | | | To encourage vendors to make power on/off as efficient and responsive as possible, we log some warnings whenever it is too slow. The previous thresholds were a little unreasonable mainly because we wanted to understand how long the process tends to take even when it's fast. Raise the warning limit while still being aggressive about timings. Ideally we want the screen to turn on/off within no more than a few frames. Bug: 7167820 Change-Id: Id28dbf8c91cefa7ae7544b72887104af7aabccff
* Make input system aware of multiple displays.Jeff Brown2012-09-102-2/+11
| | | | | | | | | | | | | | | | | | | | The input system needs to know about the window that has focus, even if it is on a secondary display. So now we send it the list of all windows and indicate which display they are on. We filter the list of windows as necessary when delivering touch events. To keep things simple, monitor input channels and input filters are not supported except on the main display. We also do not pass the display id to applications; it is only used inside the input system for now. Properly scale touch coordinates based on the viewport. This will be needed to ensure that touch works on external display as well as when the internal display is being used to simulate a different resolution. Change-Id: I1815579a52fcc852c519b5391fc7ab8767c2dc59
* Make display manager tell input system about viewports.Jeff Brown2012-09-081-84/+42
| | | | | | | The window manager is no longer responsible for telling the input system about the display viewport. Change-Id: I932882bae55decef55f25093bb2a7ebac1620bb1
* Add plumbing for new surface flinger display API.Jeff Brown2012-08-273-98/+0
| | | | | | | | | | | | | | Cleaned up the implementation of Surface and SurfaceSession to use more consistent naming and structure. Added JNI for all of the new surface flinger display API calls. Enforced the requirement that all Surfaces created by the window manager be named. Updated the display manager service to use the new methods. Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
* Use new surface flinger API.Jeff Brown2012-08-271-1/+5
| | | | Change-Id: Ic888577408a59a36481a48010e19c5e77c24e211
* BatteryService: Fix comment to match codeScott Anderson2012-08-211-2/+2
| | | | | Change-Id: Ib4e30e7808ff3a2a8a49c000eac719a3a4273fdd Signed-off-by: Scott Anderson <saa@android.com>
* Merge "Plumb the switch code into Dalvik." into jb-mr1-devJeff Brown2012-08-201-11/+6
|\
| * Plumb the switch code into Dalvik.Jeff Brown2012-08-201-11/+6
| | | | | | | | | | Bug: 6548391 Change-Id: If0e918669ba27ca0e6561930d4abc427c34de42d
* | add wireless charger supportBrian Muramatsu2012-08-201-0/+12
|/ | | | | | | | | bug: 6879638 - add new enum value BATTERY_PLUGGED_WIRELESS - check for sys online file with contents "Wireless" Change-Id: I22dc3c40f50573c98643e7b5cbcb237d0216530d
* Power manager rewrite.Jeff Brown2012-08-154-62/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The major goal of this rewrite is to make it easier to implement power management policies correctly. According, the new implementation primarily uses state-based rather than event-based triggers for applying changes to the current power state. For example, when an application requests that the proximity sensor be used to manage the screen state (by way of a wake lock), the power manager makes note of the fact that the set of wake locks changed. Then it executes a common update function that recalculates the entire state, first looking at wake locks, then considering user activity, and eventually determining whether the screen should be turned on or off. At this point it may make a request to a component called the DisplayPowerController to asynchronously update the display's powe state. Likewise, DisplayPowerController makes note of the updated power request and schedules its own update function to figure out what needs to be changed. The big benefit of this approach is that it's easy to mutate multiple properties of the power state simultaneously then apply their joint effects together all at once. Transitions between states are detected and resolved by the update in a consistent manner. The new power manager service has is implemented as a set of loosely coupled components. For the most part, information only flows one way through these components (by issuing a request to that component) although some components support sending a message back to indicate when the work has been completed. For example, the DisplayPowerController posts a callback runnable asynchronously to tell the PowerManagerService when the display is ready. An important feature of this approach is that each component neatly encapsulates its state and maintains its own invariants. Moreover, we do not need to worry about deadlocks or awkward mutual exclusion semantics because most of the requests are asynchronous. The benefits of this design are especially apparent in the implementation of the screen on / off and brightness control animations which are able to take advantage of framework features like properties, ObjectAnimator and Choreographer. The screen on / off animation is now the responsibility of the power manager (instead of surface flinger). This change makes it much easier to ensure that the animation is properly coordinated with other power state changes and eliminates the cause of race conditions in the older implementation. The because of the userActivity() function has been changed so that it never wakes the device from sleep. This change removes ambiguity around forcing or disabling user activity for various purposes. To wake the device, use wakeUp(). To put it to sleep, use goToSleep(). Simple. The power manager service interface and API has been significantly simplified and consolidated. Also fixed some inconsistencies related to how the minimum and maximum screen brightness setting was presented in brightness control widgets and enforced behind the scenes. At present the following features are implemented: - Wake locks. - User activity. - Wake up / go to sleep. - Power state broadcasts. - Battery stats and event log notifications. - Dreams. - Proximity screen off. - Animated screen on / off transitions. - Auto-dimming. - Auto-brightness control for the screen backlight with different timeouts for ramping up versus ramping down. - Auto-on when plugged or unplugged. - Stay on when plugged. - Device administration maximum user activity timeout. - Application controlled brightness via window manager. The following features are not yet implemented: - Reduced user activity timeout for the key guard. - Reduced user activity timeout for the phone application. - Coordinating screen on barriers with the window manager. - Preventing auto-rotation during power state changes. - Auto-brightness adjustment setting (feature was disabled in previous version of the power manager service pending an improved UI design so leaving it out for now). - Interpolated brightness control (a proposed new scheme for more compactly specifying auto-brightness levels in config.xml). - Button / keyboard backlight control. - Change window manager to associated WorkSource with KEEP_SCREEN_ON_FLAG wake lock instead of talking directly to the battery stats service. - Optionally support animating screen brightness when turning on/off instead of playing electron beam animation (config_animateScreenLights). Change-Id: I1d7a52e98f0449f76d70bf421f6a7f245957d1d7
* Merge "screen-off animation won't be handled by SF anymore" into jb-mr1-devMathias Agopian2012-08-021-2/+1
|\
| * screen-off animation won't be handled by SF anymoreMathias Agopian2012-08-021-2/+1
| | | | | | | | Change-Id: I66ad02b07b1148c1610e9c29ba80450d49c22806
* | Start moving away from DisplayMetrics.DENSITY_DEVICE.Dianne Hackborn2012-08-011-3/+4
|/ | | | | | | | | | | | This puts in most of the infrastructure needed to allow us to switch between different densities at run time. The main remaining uses of the global are to initialize the Bitmap object (not sure what to do about that since it doesn't have anything passed in the constructor to get this information from), and being able to load drawables if we need a different density than what was preloaded by zygote. Change-Id: Ifdbfd6b7a5c59e6aa22e63b95b78d96af3d96848
* Move and rename user activity event type constants.Jeff Brown2012-07-272-4/+4
| | | | Change-Id: Ie565808796773b6896e71ddfac6aaaf8031de846
* update to new getDisplayInfo APIMathias Agopian2012-07-251-6/+2
| | | | Change-Id: I8051b4f9f23d3ef4791176de1bbcfafacae7d579
* Add display manager skeleton.Jeff Brown2012-07-253-0/+97
| | | | | | | | | | | | | The purpose of this change is to remove direct reliance on SurfaceFlinger for describing the size and characteristics of displays. This patch also starts to make a distinction between logical displays and physical display devices. Currently, the window manager owns the concept of a logical display whereas the new display manager owns the concept of a physical display device. Change-Id: I7e0761f83f033be6c06fd1041280c21500bcabc0
* Move power manager to a new package.Jeff Brown2012-06-184-5/+5
| | | | Change-Id: I5f5a6435e64354b7d6535e8e9a63934ba7a3f448
* PowerManagerService: call surfaceflinger blank and unblank through binderColin Cross2012-06-071-0/+3
| | | | | | | | | Synchronize with SurfaceFlinger during screen off and on to ensure that a black frame has been drawn on the display, and then trigger all early suspend handlers on devices that have early suspend, as well as PowerHAL operations. Change-Id: I8a5ad5a84c9e80ce5bb8f7f0b09b064e2b9ad4ef
* Tolerate missing power HAL module.Jeff Brown2012-05-161-14/+7
| | | | | Bug: 6492793 Change-Id: I092605456e734e3f91ee098a197f208c738a619c
* Tell power HAL when user activity occurs.Jeff Brown2012-05-111-0/+9
| | | | | Bug: 6435382 Change-Id: I78754158b057851fcba807ebbda143899da387ec
* Move power HAL interactions to PowerManagerService.Jeff Brown2012-05-112-9/+102
| | | | | | | | | | | | | | | | | This refactoring sets the stage for a follow-on change that will make use additional functions of the power HAL. Moved functionality from android.os.Power into PowerManagerService. None of these functions make sense being called outside of the system server. Moving them to the PowerManagerService makes it easier to ensure that the power HAL is initialized exactly once. Similarly, moved ShutdownThread out of the policy package and into the services package where it can tie into the PowerManagerService as needed. Bug: 6435382 Change-Id: I958241bb124fb4410d96f5d5eb00ed68d60b29e5
* Separate the internal and external display rotations.Jeff Brown2012-05-021-8/+16
| | | | | | | | | | | When attached to an HDMI touch screen, the input system needs to know the size and rotation of the external display independent of the internal display. The size was already being reported separately but not the rotation. The inconsistency can cause problems if the internal display's natural rotation is portrait but the external display's natural rotation is landscape. Change-Id: Id344f04c1ba032625f6265766be66f9ddaa2cc0b
* Improve handling of built-in keyboard.Jeff Brown2012-05-011-33/+0
| | | | | | | | | | | | | | | | | The window manager policy made some incorrect assumptions about the meaning of the Configuration.keyboard field. We need to be more careful about distinguishing between built-in and external keyboards. Most of this change is to move the determination of the parts of the Configuration related to input devices into the WindowManagerService leveraging new features of the InputManagerService to good effect. Then we plumb through the flag that indicates whether a device is internal or external so that we can be more particular about how the lid switch effects changes to the Configuration. Bug: 6424373 Change-Id: I36a1c22ade35e578955465a25940a33f227b9763
* UsbService: Add support for accessory initiating USB audio supportMike Lockwood2012-04-261-0/+13
| | | | | Change-Id: I0e468f4b841de9e1ca7b75a05fc58299dbc78222 Signed-off-by: Mike Lockwood <lockwood@google.com>
* Get alias for Bluetooth devices.Jeff Brown2012-04-201-7/+32
| | | | | | | | | | | Bluetooth devices can be renamed by the user. Make the input system aware of the user-specified name and transparently pass it down to applications. This enables the keyboard layout picker Settings UI to use device names that are consistent with what the user set in the Bluetooth UI. Bug: 6363157 Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
* Support loading keyboard layout overlays from resources.Jeff Brown2012-04-172-1/+48
| | | | | | | | | | | | | | | | | | | | | | Added the concept of a keyboard layout overlay, which is a key character map file that has "type OVERLAY". Added support for loading keyboard layout overlays from resources dynamically. The layouts are reloaded whenever they are changed in the Settings application or an application is installed. This is somewhat more aggressive than necessary so we might want to optimize it later. Before system-ready, the input system uses just the generic keyboard layouts that are included on the device system image. After system-ready, it considers the user's selected keyboard layout overlay and attempts to load it as necessary. We need to wait until system-ready before doing this because we need to be in a state where it is safe to start applications or access their resources. Bug: 6110399 Change-Id: Iae0886d3356649b0d2440aa00910a888cedd8323
* Add support for input devices that have vibrators.Jeff Brown2012-04-131-0/+36
| | | | | | | | | | Added a getVibrator() method to InputDevice which returns a Vibrator associated with that input device. Its uses the same API as the system vibrator which makes it easy for applications to be modified to use one or the other. Bug: 6334179 Change-Id: Ifc7f13dbcb778670f3f1c07ccc562334e6109d2e
* Notify applications when input devices change.Jeff Brown2012-04-121-34/+44
| | | | | | | | | | | | | | | | | This change allows the InputManager to keep track of what input devices are registered with the system and when they change. It needs to do this so that it can properly clear its cache of input device properties (especially the key map!) when changes occur. Added new API so that applications can register listeners for input device changes. Fixed a minor bug in EventHub where it didn't handle EPOLLHUP properly so it would spam the log about unsupposed epoll events until inotify noticed that the device was gone and removed it. Change-Id: I937d8c601f7185d4299038bce6a2934fe4fdd2b3
* Request key maps from input manager service.Jeff Brown2012-04-101-81/+2
| | | | | | | | | | | | | | | | | | Instead of each application loading the KeyCharacterMap from the file system, get them from the input manager service as part of the InputDevice object. Refactored InputManager to be a proper singleton instead of having a bunch of static methods. InputManager now maintains a cache of all InputDevice objects that it has loaded. Currently we never invalidate the cache which can cause InputDevice to return stale motion ranges if the device is reconfigured. This will be fixed in a future change. Added a fake InputDevice with ID -1 to represent the virtual keyboard. Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
* Fix lid switch interpretation.Jeff Brown2012-04-091-1/+2
| | | | | | | Also remove unnecessary permission check for method that is only called internally. Change-Id: I32f63fc3e96b06709d18b046ee2d3c8f310de70d