Commit graph

6 commits

Author SHA1 Message Date
Colin Cross
8447aed332 Merge "Vibrator: clarify the API" 2015-11-17 19:31:22 +00:00
Stewart Miles
84d35492b1 Described restrictions for common HAL object methods.
Inheritance of HAL object is performed by composing a child structure of a
single parent structure located at offset 0 followed by new data members
and function pointers in the child structure.

For example,

struct child {
  struct parent common;
  int a_data_member;
  void (*a_method)(struct child *c, int v);
};

HAL code assumes this layout when accessing child structures given a pointer
to a parent structure such that users write code like the following...

void child_method(struct *parent, int v) {
  struct child * c = (struct child*)parent;
  // do stuff with c
}

Code above will break if a member is added before "common" in "struct child".

This change adds comments that describe the restriction on the location of
parent HAL objects within a derived HAL object.  HAL objects that already
have comments that describe the required location of parent objects are not
modified.

Change-Id: Ibe4300275286ef275b2097534c84f1029d761d87
2014-05-12 12:35:37 -07:00
David Wagner
8e09d12f80 Vibrator: clarify the API
Put stronger requirements on the vibrator API:
 - vibratorOn must not be called if the vibrator is already called (requirement
         on the caller);
 - vibratorOff must cancel any ongoing vibration (requirement on the callee).

Change-Id: Ic2fcd29903bf5a11a19c731de355d19c06c4e0e2
Signed-off-by: David Wagner <david.wagner@intel.com>
2014-05-07 15:10:08 +02:00
Vincent Becker
022224fbf8 Vibra: Adapt AOSP (default) vibrator HAL into a hardware module.
Android's implementation of vibrator needs to be done inside a
hardware module, so that it can make a vendor implementation possible.

Hw module's name becomes vibrator.default.so.

This change is related to other changes in:
 - frameworks/base
 - hardware/libhardware_legacy
 - device/generic/goldfish
 - platform/build

Change-Id: I844279f5535289f079d412fdc44c5cb3c9c1130c
Author: Vincent Becker <vincentx.becker@intel.com>
Signed-off-by: Vincent Becker <vincentx.becker@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: David Wagner <david.wagner@intel.com>
Author-tracking-BZ: 49760 94611
2014-01-13 15:07:41 +01:00
The Android Open Source Project
0100d517b1 auto import from //branches/cupcake/...@126645 2009-01-15 16:12:12 -08:00
The Android Open Source Project
d6054a3647 Initial Contribution 2008-10-21 07:00:00 -07:00