Commit Graph

334 Commits

Author SHA1 Message Date
Dianne Hackborn e4499526ee am 5ee2c9d2: Work on issue #17656716: Unhandled exception in Window Manager
* commit '5ee2c9d20c0fbecf6b4a482eb8d8bfdf85d0d424':
  Work on issue #17656716: Unhandled exception in Window Manager
2014-09-30 20:23:02 +00:00
Dianne Hackborn 5ee2c9d20c Work on issue #17656716: Unhandled exception in Window Manager
Try to clean up the code paths coming in and out of binder IPCs to
plug any places where we could disrupt the gather flag of a thread,
causing it to keep gathering stack crawls (which is the thing that
is causing our strict mode data to become so large).

We now take care of saving and restoring this state in the core
IPC code path, not at the Java layer.

Change-Id: I73d564778da127bdce00f304225930e7f2318293
2014-09-30 11:30:03 -07:00
Dan Albert 1474f8864f Don't check if this == NULL.
Entering a method with this == NULL is undefined behavior. Clang whines
about this.

Change-Id: Ibde628395ca10dfef0d2f59e81280576f104b83c
2014-09-16 17:52:06 -07:00
Hans Boehm e03abcd61b am 4a7001ca: Merge "Work around C11 const atomic restrictions."
* commit '4a7001cae482e3c9410001360374c8fe9d5a2846':
  Work around C11 const atomic restrictions.
2014-09-12 15:54:52 +00:00
Hans Boehm c0df68bb80 Work around C11 const atomic restrictions.
Cast away the const qualifier in BBinder::findObject.  C11, unlike C++11,
does not allow loads from const atomics.  This is widely regarded as
a bug (see WG14 DR 459).  This is a hack to work around it until it's
officially fixed in the spec.

load_const_atomic was adapted from commit
1e8587a479fd8b1ce9b594298a93f517816e8f15

I don't think we want to dignify this by putting it into a header file.

Bug:17067219
Change-Id: Icbfcbda2722e6f80d2bb065a0bb3ec7634bcacb2
2014-09-11 14:49:09 -07:00
Hans Boehm 553231f65e Fix CAS argument type.
Gcc apparently doesn't check; clang does.

Bug:17067219
Change-Id: I184084a5063131dbc857c63f97e70e78a05e1a76
(cherry picked from commit 1ddaadb598)
2014-09-02 23:26:16 -07:00
Hans Boehm 08ff802151 Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use.""""
After fixing b/16874785.

This reverts commit f010a05c7e.

Original comment, which actually describes the effect of this:

Change the mExtras field in Binder.h to be a stdatomic.h atomic
value, and replace references to it with proper stdatomic.h calls.
This removes one of a small number of remaining 64 bit
android_atomic references.  It also replaces the erroneously
non-atomic read accesses to mExtras.

It would be better if this used the C++11 <atomic> facility,
but we don't quite have that yet.

Fixes

Bug:16513433

Change-Id: I1645ca5d6f60595bf5d388913665ce4b8780b26d
(cherry picked from commit 3effababf2)
2014-09-02 16:11:46 -07:00
Hans Boehm 02a1c2cb37 am efc0b35f: Merge "Fix CAS argument type."
* commit 'efc0b35fbd256bb3e225f4a1b953d0895ee3e99a':
  Fix CAS argument type.
2014-08-19 22:28:41 +00:00
Elliott Hughes cb3b7ce1d8 am 703b60ce: Merge "Use gettid directly in binder."
* commit '703b60ce39e52d319074adf53704d33f9c16dbbd':
  Use gettid directly in binder.
2014-08-18 19:34:22 +00:00
Hans Boehm efc0b35fbd Merge "Fix CAS argument type." 2014-08-16 04:28:29 +00:00
Hans Boehm 1ddaadb598 Fix CAS argument type.
Gcc apparently doesn't check; clang does.

Bug:17067219
Change-Id: I184084a5063131dbc857c63f97e70e78a05e1a76
2014-08-19 13:42:54 -07:00
Elliott Hughes fa6ad07c4e Use gettid directly in binder.
Bug: 17048545
Change-Id: I1df378135961e085a52f6cc5694ad74cd73aac19
2014-08-18 10:38:38 -07:00
Hans Boehm dc1fb90857 am a0187a9c: Merge "Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use."""""
* commit 'a0187a9c83cb042b4cb92dac59214247bb7affcf':
  Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use.""""
2014-08-13 00:19:23 +00:00
Hans Boehm 3effababf2 Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use.""""
After fixing b/16874785.

This reverts commit f010a05c7e.

Change-Id: I1645ca5d6f60595bf5d388913665ce4b8780b26d
2014-08-12 22:56:00 +00:00
Hans Boehm d87319ddc8 am f491f497: Merge "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use.""""
* commit 'f491f497b2a4ba5a0ec60b291cce4ffb3be3d33c':
  Revert "Revert "Revert "Remove incorrect android_atomic_...64 use."""
2014-08-09 02:50:38 +00:00
Hans Boehm f010a05c7e Revert "Revert "Revert "Remove incorrect android_atomic_...64 use."""
This reverts commit 66629e0de5.

Change-Id: Ic298b345d0e500d18e4297b00e755ce3340f13fb
2014-08-09 01:17:13 +00:00
Hans Boehm e0b96dbf2a am 6e5316b1: Merge "Revert "Revert "Remove incorrect android_atomic_...64 use."""
* commit '6e5316b1dac10bed0d81f4b2942e4a8749cd67b2':
  Revert "Revert "Remove incorrect android_atomic_...64 use.""
2014-08-09 00:38:27 +00:00
Hans Boehm 66629e0de5 Revert "Revert "Remove incorrect android_atomic_...64 use.""
This reverts commit 9dc5c269f7.
Adds a stdint.h include in case stdatomic.h stops including that.

Change-Id: If3dd1db1f1132c0f2dc1efb0a44617d3f36d7cfb
2014-08-08 17:14:30 -07:00
Hans Boehm 9e0ef391e8 am 735082ea: Merge "Revert "Remove incorrect android_atomic_...64 use.""
* commit '735082ea156d91cf72c241e9134abc22038c8f13':
  Revert "Remove incorrect android_atomic_...64 use."
2014-08-06 22:56:57 +00:00
Hans Boehm 9dc5c269f7 Revert "Remove incorrect android_atomic_...64 use."
This reverts commit 88b7541d68.

Change-Id: Ie701c308451a3697bb167aff119318b932133f90
2014-08-06 22:45:13 +00:00
Hans Boehm 52bfb70cf8 am c11eca81: Merge "Remove incorrect android_atomic_...64 use."
* commit 'c11eca81e66892eb62a03b4553055197d122fe5b':
  Remove incorrect android_atomic_...64 use.
2014-08-06 21:21:05 +00:00
Chong Zhang 2cbba477be add noteResetVideo/Audio to IBatteryStats
Bug: 12979595
Change-Id: Ida474e539a3af0a85ec157a66bbf986430c8020e
2014-07-23 21:51:56 +00:00
Hans Boehm 88b7541d68 Remove incorrect android_atomic_...64 use.
Change the mExtras field in Binder.h to be a stdatomic.h atomic
value, and replace references to it with proper stdatomic.h calls.
This removes one of a small number of remaining 64 bit
android_atomic references.  It also replaces the erroneously
non-atomic read accesses to mExtras.

It would be better if this used the C++11 <atomic> facility,
but we don't quite have that yet.

Bug: 16513433
Change-Id: Ibabb88d05025187ee1ce6c7f1aa670b133a547f8
2014-07-23 11:35:13 -07:00
Chong Zhang bd42d38b16 update battery status for audio/video
Bug: 12979595

Change-Id: Ic8e8d625becc6d1050f840ad63b7423f388eeba3
2014-07-22 23:08:53 +00:00
Narayan Kamath 7da40c0a84 Remove Parcel::writeIntPtr.
All uses of this API have been removed. It should
never have been made public in the first place.

bug: 15424960
Change-Id: Id07d24ec95b2b393e6da138a7e8a9a4ecebeca94
2014-06-12 15:26:39 +01:00
Narayan Kamath f905bc3bdc Remove Parcel::writeIntPtr.
All uses of this API have been removed. It should
never have been made public in the first place.

bug: 15424960

(cherry picked from commit 7da40c0a84)

Change-Id: I8d89f62dbdaee7149ef908e0c97417b85e0c48a2
2014-06-13 10:27:33 +01:00
Narayan Kamath 065e9c86e2 Merge "Fix mips build for libbinder." 2014-06-04 14:53:08 +00:00
Narayan Kamath 2f1f742b90 Fix mips build for libbinder.
Mips specific code was using an uninitialized variable.

(cherry picked from commit 2c68d380c9)

Change-Id: I6b562b3f6d2084b72e747736cbf43684c2049f8e
2014-06-04 15:34:16 +01:00
Narayan Kamath 87947be618 Merge "Fix mips build for libbinder." 2014-06-04 14:32:59 +00:00
Narayan Kamath 2c68d380c9 Fix mips build for libbinder.
Mips specific code was using an uninitialized variable.

Change-Id: I445043c76ebfa420b26376ade60f8068b4ea0b11
2014-06-04 15:05:13 +01:00
Mark Salyzyn b09b936d8e am f0a24759: am a28750ee: Merge "binder: Turn on -Werror"
* commit 'f0a2475905786d5457e7af838ac714acbfdafa4f':
  binder: Turn on -Werror
2014-06-03 20:54:48 +00:00
Mark Salyzyn f0a2475905 am a28750ee: Merge "binder: Turn on -Werror"
* commit 'a28750eec38c848230adfeef28725b29cc36a9da':
  binder: Turn on -Werror
2014-06-03 20:48:35 +00:00
Mark Salyzyn d4ecccfd20 binder: Turn on -Werror
Change-Id: I0ee785927a7ae5f731b02176b0b781b87c22a24e
2014-06-03 11:11:45 -07:00
Mark Salyzyn edcf7f4d3a binder: rm utils/Debug.h as unutilized
Change-Id: I52eb8b64b71cec7ffd4560e902daf358fda98b4a
2014-05-30 16:51:18 +00:00
Mark Salyzyn b8b3c536f4 am ea3f1da9: am 1ce5ecbe: am 63645c69: Merge "binder: rm utils/Debug.h"
* commit 'ea3f1da9013b33ecf3f3f8771393c1754a9aec59':
  binder: rm utils/Debug.h
2014-05-29 21:09:57 +00:00
Mark Salyzyn ea3f1da901 am 1ce5ecbe: am 63645c69: Merge "binder: rm utils/Debug.h"
* commit '1ce5ecbe3286380f5ff7ace289369ed006e9b40a':
  binder: rm utils/Debug.h
2014-05-29 21:06:36 +00:00
Mark Salyzyn 1ce5ecbe32 am 63645c69: Merge "binder: rm utils/Debug.h"
* commit '63645c69e03cf3862c52cfde6cbd5f5143ccd38a':
  binder: rm utils/Debug.h
2014-05-29 20:29:32 +00:00
Mark Salyzyn 317ff37cf7 binder: rm utils/Debug.h
Change-Id: I16931919a26c16a0d701771c93fa7fe1c6f60ef8
2014-05-29 13:10:03 -07:00
Ying Wang f736f2f5da am 114d71ce: am 214b4a61: am 8155ce81: Merge "Remove unused LOCAL_LDLIBS."
* commit '114d71ce7c6ec1ce0327c812a42966c4258b4a46':
  Remove unused LOCAL_LDLIBS.
2014-05-08 18:23:58 +00:00
Ying Wang 114d71ce7c am 214b4a61: am 8155ce81: Merge "Remove unused LOCAL_LDLIBS."
* commit '214b4a61ac3fa63e35c79157d3acf0d8b692b3ac':
  Remove unused LOCAL_LDLIBS.
2014-05-07 23:01:19 +00:00
Ying Wang 214b4a61ac am 8155ce81: Merge "Remove unused LOCAL_LDLIBS."
* commit '8155ce81d4b150e6e453d9443f9fea4cc2c546d2':
  Remove unused LOCAL_LDLIBS.
2014-05-07 22:54:27 +00:00
Ying Wang 4a793fe952 Remove unused LOCAL_LDLIBS.
Change-Id: I62904c410a66f256da8253764577acae18f964f8
2014-05-07 15:26:38 -07:00
Jesse Hall 13de7f1def am 57fdbbda: am 4314ccd1: am 70278fbf: Merge "Add error message for hints when exceptions occur during binder transactions."
* commit '57fdbbda2c475d2abdd828177f942ddb6d164bef':
  Add error message for hints when exceptions occur during binder transactions.
2014-05-05 17:33:01 +00:00
Jesse Hall 57fdbbda2c am 4314ccd1: am 70278fbf: Merge "Add error message for hints when exceptions occur during binder transactions."
* commit '4314ccd1ba9fe773b0fc91f0a08dc536ebce8dfe':
  Add error message for hints when exceptions occur during binder transactions.
2014-05-05 17:30:19 +00:00
Jesse Hall 4314ccd1ba am 70278fbf: Merge "Add error message for hints when exceptions occur during binder transactions."
* commit '70278fbfe012c1fce3e63a41ffb9feaf1e53a64a':
  Add error message for hints when exceptions occur during binder transactions.
2014-05-05 17:27:46 +00:00
Bill Yi e4f00b2aae Merge commit '6d05ef2310bdc84811d5b0385b009ad11447a749' into HEAD 2014-04-29 11:34:19 -07:00
Jun Jiang abf8a2c608 Add error message for hints when exceptions occur during binder transactions.
It can help to detect some kind of error, such as why GraphicBuffer::flatten
will crash when handle is null.

Change-Id: I703cd035b96edb7afb324cf24d8230d4e55f4f52
Signed-off-by: Jun Jiang <jun.a.jiang@intel.com>
2014-04-29 14:22:10 +08:00
Narayan Kamath 7f4fe6e586 am d09b2acd: am 033bdd72: Merge "Remove global variables from ProcessState."
* commit 'd09b2acdc8ca706c65984956e61c0bb333cee992':
  Remove global variables from ProcessState.
2014-04-03 16:56:29 +00:00
Narayan Kamath d09b2acdc8 am 033bdd72: Merge "Remove global variables from ProcessState."
* commit '033bdd72f9f32f4bd3d282750bdc0dcfbb469959':
  Remove global variables from ProcessState.
2014-04-03 14:11:31 +00:00
Narayan Kamath 162ea0e9e8 Remove global variables from ProcessState.
These weren't really being used and they make it
very hard to reason about who looks at command line
arguments.

Processes started via app_process (this includes all
zygote forks and the system_server) can get information
about command line arguments from the AndroidRuntime
class, which is available via a call to
AndroidRuntime::getRuntime.

bug: 13647418

Change-Id: I6f92680c3619a68c6d4b0995db4cdc9adc788e36
2014-04-03 12:29:44 +00:00
Glenn Kasten 80a2f03051 Merge "Allow creation of heaps that are read-only to partner" 2014-03-27 22:28:11 +00:00
Jesse Hall f4e7008989 am 74ae7490: am 01502981: Merge "fix valgrind ioctl warning."
* commit '74ae749099a3c84f38dbe2f43e6627bb17caf5e4':
  fix valgrind ioctl warning.
2014-03-20 21:05:16 +00:00
Jesse Hall 74ae749099 am 01502981: Merge "fix valgrind ioctl warning."
* commit '01502981cddb69b9ab7e4bf8bc66366ae0eb7035':
  fix valgrind ioctl warning.
2014-03-20 16:31:37 +00:00
Jesse Hall b0f96c4881 am 01502981: Merge "fix valgrind ioctl warning."
* commit '01502981cddb69b9ab7e4bf8bc66366ae0eb7035':
  fix valgrind ioctl warning.
2014-03-20 16:31:17 +00:00
Jesse Hall 01502981cd Merge "fix valgrind ioctl warning." 2014-03-20 16:09:15 +00:00
Glenn Kasten 6546f2e458 Allow creation of heaps that are read-only to partner
Change-Id: I3c2b3d9b1671da4b9d9c58dce27e291d30703b03
2014-03-18 15:07:43 -07:00
Kenny Root 75d8406934 am ca609e43: am 38e2aaaa: am 5b61ad2c: Check the padded size of the read byte array
* commit 'ca609e4300d88ad1e815581ebc6a478b446d3882':
  Check the padded size of the read byte array
2014-03-17 23:32:59 +00:00
Kenny Root ca609e4300 am 38e2aaaa: am 5b61ad2c: Check the padded size of the read byte array
* commit '38e2aaaa3dd62a20eb211808ae6fe45ec37ee6d5':
  Check the padded size of the read byte array
2014-03-17 21:31:04 +00:00
Kenny Root 38e2aaaa3d am 5b61ad2c: Check the padded size of the read byte array
* commit '5b61ad2cda8ec8ab634ce02f388bb2d3c5ab048d':
  Check the padded size of the read byte array
2014-03-17 21:28:34 +00:00
Kenny Root 9ff2aad010 am 5b61ad2c: Check the padded size of the read byte array
* commit '5b61ad2cda8ec8ab634ce02f388bb2d3c5ab048d':
  Check the padded size of the read byte array
2014-03-17 21:28:33 +00:00
Kenny Root 5b61ad2cda Check the padded size of the read byte array
Bug: 13509200
Change-Id: Id93894fcc617ec1cd4ce66921c6e1f1c3cf40b09
2014-03-17 13:18:16 -07:00
Marco Nelissen ce9f107c9d am 793be12c: am b730a452: am f0190bff: Add support for writing byte arrays to parcels
* commit '793be12c0f5a7878d1085e94e58a9c36c84f0911':
  Add support for writing byte arrays to parcels
2014-03-15 00:30:46 +00:00
Marco Nelissen 793be12c0f am b730a452: am f0190bff: Add support for writing byte arrays to parcels
* commit 'b730a45216991cf22c39451c47393b4bccae111b':
  Add support for writing byte arrays to parcels
2014-03-14 23:33:08 +00:00
Marco Nelissen 446ef4bae2 am f0190bff: Add support for writing byte arrays to parcels
* commit 'f0190bff38b6c29abbfc4a877442f71fc3d7dad8':
  Add support for writing byte arrays to parcels
2014-03-14 23:32:45 +00:00
Marco Nelissen b730a45216 am f0190bff: Add support for writing byte arrays to parcels
* commit 'f0190bff38b6c29abbfc4a877442f71fc3d7dad8':
  Add support for writing byte arrays to parcels
2014-03-14 22:55:54 +00:00
Marco Nelissen f0190bff38 Add support for writing byte arrays to parcels
b/13418320

Change-Id: I2285df9e9d3dc8a6a54055b13b352b81660bf45d
2014-03-13 14:17:40 -07:00
Arve Hjønnevåg 614019cd1f am d1c87d37: Merge changes I3432d9d3,I90fcf538,I64398603
* commit 'd1c87d37025c49f6a47fe43328572da495ff04c1':
  Binder: Fix some valgrind errors.
  Binder: Don't cast directly from a pointer to binder_uintptr_t
  Binder: Disable attemptIncStrongHandle
2014-03-10 18:06:10 +00:00
Colin Cross 8ff043d3fb am 74be0f7b: Merge "binder: fix all warnings"
* commit '74be0f7be35e7b40a322fa9a407cb49265333a0b':
  binder: fix all warnings
2014-03-07 02:23:38 +00:00
Arve Hjønnevåg 72e7ac9ba4 am 4e7fd950: Merge "Use 64 bit binder interface if TARGET_USES_64_BIT_BINDER _or_ TARGET_IS_64_BIT is set."
* commit '4e7fd9506103dcc9750788caf1f94b8d1348f37b':
  Use 64 bit binder interface if TARGET_USES_64_BIT_BINDER _or_ TARGET_IS_64_BIT is set.
2014-03-07 01:35:23 +00:00
Arve Hjønnevåg eea5b29842 am 58242fc2: Merge changes Ib0e5a037,I1bd7c38e,Icfc67c2a,I96c64312,I59528054, ...
* commit '58242fc29881cf29d56ee6e5fde6d73b16d0b67c':
  ServiceManager: Implement PING_TRANSACTION
  ServiceManager: Use 32/64 bit types from new binder header
  Binder: Use 64 bit pointers in 32 processes if selected by the target
  Add BINDER_IPC_32BIT to CFLAGS unless TARGET_USES_64_BIT_BINDER is true
  Binder: Make binder portable
  ServiceManager: Fix the binder interface
  ServiceManager: Store handles in uint32_t instead of void *
  ServiceManager: Generic Fixes
  ServiceManager: Add extra error handling
  ServiceManager: Fix Android.mk
  ServiceManager: Make use of kernel exported structures
2014-03-07 01:34:26 +00:00
Arve Hjønnevåg 4cab0fd7f7 Binder: Make sure binder objects do not overlap
Fixes crashing part of bug 11355082.
The driver still leaks references.

Change-Id: Ibc6a63b151c1fc1f7666237f25255ba781e02071
2014-02-24 15:42:13 -08:00
Arve Hjønnevåg 3c98ba77b9 am c5294424: am d1c87d37: Merge changes I3432d9d3,I90fcf538,I64398603
* commit 'c5294424386bedad2a240074d0845999f28e662d':
  Binder: Fix some valgrind errors.
  Binder: Don't cast directly from a pointer to binder_uintptr_t
  Binder: Disable attemptIncStrongHandle
2014-02-22 00:52:18 +00:00
Arve Hjønnevåg c529442438 am d1c87d37: Merge changes I3432d9d3,I90fcf538,I64398603
* commit 'd1c87d37025c49f6a47fe43328572da495ff04c1':
  Binder: Fix some valgrind errors.
  Binder: Don't cast directly from a pointer to binder_uintptr_t
  Binder: Disable attemptIncStrongHandle
2014-02-22 00:41:31 +00:00
Arve Hjønnevåg ee319ab1d2 am 6f286114: Revert "Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface"
* commit '6f286114ec1d597f3dae987bba6e72dbbc404e32':
  Revert "Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface"
2014-02-20 21:27:53 +00:00
Arve Hjønnevåg 5febeff15f am 9b5c3b91: am d5a354c6: am d06f6b00: am 67903293: Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface
* commit '9b5c3b9132831ba9078fc7c4001821bcfe8dd39d':
  Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface
2014-02-20 14:59:14 +00:00
Arve Hjønnevåg 6f286114ec Revert "Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface"
This branch has the new driver interface so it should not have this change.

This reverts commit 6790329358.

Change-Id: I9b6d0d653d98dbdb521ef964c5e7c2f14859d340
2014-02-19 20:42:41 -08:00
Arve Hjønnevåg 9b5c3b9132 am d5a354c6: am d06f6b00: am 67903293: Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface
* commit 'd5a354c6b7f2ae0b93e018f3024a2fca5f6543a1':
  Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface
2014-02-20 00:52:13 +00:00
Arve Hjønnevåg d06f6b0014 am 67903293: Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface
* commit '6790329358d1c84af2fe9ba093bcfc1c6176e758':
  Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface
2014-02-20 00:00:49 +00:00
Arve Hjønnevåg 6790329358 Fix "Binder: Make sure binder objects do not overlap" to work old binder kernel interface
DO NOT MERGE into any branch that uses the new interface

Change-Id: Id54308a89327e69a389ac5916c052ad97f57cb28
2014-02-19 15:35:52 -08:00
Arve Hjønnevåg 79aa621330 am 7cc5b880: am e45636a8: am d437364e: am f50b9eaa: Binder: Make sure binder objects do not overlap
* commit '7cc5b8800c22790b0db9ea0af62fcad2cc998303':
  Binder: Make sure binder objects do not overlap
2014-02-19 22:06:09 +00:00
Arve Hjønnevåg 7cc5b8800c am e45636a8: am d437364e: am f50b9eaa: Binder: Make sure binder objects do not overlap
* commit 'e45636a8674b9cbb9305648e21316210e1daf920':
  Binder: Make sure binder objects do not overlap
2014-02-19 21:50:15 +00:00
Arve Hjønnevåg d437364ec1 am f50b9eaa: Binder: Make sure binder objects do not overlap
* commit 'f50b9eaaeeaeae16981f11b05d3f3a6fb0dea30d':
  Binder: Make sure binder objects do not overlap
2014-02-19 21:45:25 +00:00
Arve Hjønnevåg 07fd0f195d Binder: Fix some valgrind errors.
When using 64 bit binder pointers, only initializing the 32 bit
handle, in a stack allocated struct, will pass uninitialized stack
data to the kernel and other processes.

Change-Id: I3432d9d36bb251d8ddb0a863661aeb80aabb3d92
2014-02-18 21:14:41 -08:00
Arve Hjønnevåg 87b30d0447 Binder: Don't cast directly from a pointer to binder_uintptr_t
When using the 64 bit binder interface from a 32 bit process the
pointer may get sign extended and cause the kernel to fail to read
from it.

Change-Id: I90fcf53880e2aa92e230a9723f9b3f7696170e32
2014-02-18 21:14:39 -08:00
Arve Hjønnevåg 11cfdccfd3 Binder: Disable attemptIncStrongHandle
The driver does not support BC_ATTEMPT_ACQUIRE and will return an error.
IPCThreadState does not handle driver errors, and will resend the failed
command blocking all other commands.

Change-Id: I643986037341821b27b62dc82df933844f4842b8
2014-02-14 20:18:13 -08:00
Arve Hjønnevåg f50b9eaaee Binder: Make sure binder objects do not overlap
Fixes crashing part of bug 11355082.
The driver still leaks references.

Change-Id: Ibc6a63b151c1fc1f7666237f25255ba781e02071
2014-02-15 03:44:17 +00:00
Colin Cross 4ba492f23b am 2b957503: am 74be0f7b: Merge "binder: fix all warnings"
* commit '2b957503b77c938e0698ffa8904e20c38c408d81':
  binder: fix all warnings
2014-02-06 03:07:47 +00:00
Colin Cross 6f4f3ab36c binder: fix all warnings
Fix warnings related to casting pointers to ints, using %d or %ld to
print size_t/ssize_t, and unused parameters.

Change-Id: I7a13ba83d402952989c1f795cd9e880a95b98d9e
2014-02-05 17:51:10 -08:00
Arve Hjønnevåg ba91e5af45 am 8641112a: am 4e7fd950: Merge "Use 64 bit binder interface if TARGET_USES_64_BIT_BINDER _or_ TARGET_IS_64_BIT is set."
* commit '8641112a1c3d4ff3ed68131d07eed01b715ac906':
  Use 64 bit binder interface if TARGET_USES_64_BIT_BINDER _or_ TARGET_IS_64_BIT is set.
2014-02-04 02:10:18 +00:00
Arve Hjønnevåg f3ad11cf3c Use 64 bit binder interface if TARGET_USES_64_BIT_BINDER _or_ TARGET_IS_64_BIT is set.
Change-Id: I46a29939fa29ec9421ab6dff3285502f69a31745
2014-02-03 14:48:36 -08:00
Arve Hjønnevåg 88f6ad18de am c93865de: am 58242fc2: Merge changes Ib0e5a037,I1bd7c38e,Icfc67c2a,I96c64312,I59528054, ...
* commit 'c93865de80a16d3638936890fb42eb175284044b':
  ServiceManager: Implement PING_TRANSACTION
  ServiceManager: Use 32/64 bit types from new binder header
  Binder: Use 64 bit pointers in 32 processes if selected by the target
  Add BINDER_IPC_32BIT to CFLAGS unless TARGET_USES_64_BIT_BINDER is true
  Binder: Make binder portable
  ServiceManager: Fix the binder interface
  ServiceManager: Store handles in uint32_t instead of void *
  ServiceManager: Generic Fixes
  ServiceManager: Add extra error handling
  ServiceManager: Fix Android.mk
  ServiceManager: Make use of kernel exported structures
2014-02-03 22:11:16 +00:00
Arve Hjønnevåg 84e625ac1e Binder: Use 64 bit pointers in 32 processes if selected by the target
Uses new kernel header where void * has been replaced by binder_uintptr_t

Change-Id: Icfc67c2a279269f700343bd9246fd7cb94efe2c1
2014-01-31 15:51:06 -08:00
Arve Hjønnevåg e91fff0a2d Add BINDER_IPC_32BIT to CFLAGS unless TARGET_USES_64_BIT_BINDER is true
Change-Id: I96c643123b0314c361b7f48a18d5c22c660d4ff5
2014-01-31 15:50:59 -08:00
Serban Constantinescu f683e0163a Binder: Make binder portable
Changes include
- Binder attempts to cast pointers to a int datatype
  which is not sufficient on a 64-bit platform.

- This patch introduces new read/write functions into
  Parcel that allow pointers to be written using the
  uintptr_t datatype for compile-time data type size
  selection.

-  Change access specifier for the methods above.

-  Binder uses the 64bit android_atomic_release_cas64
   (aka cmpxchg)

Change-Id: I595280541e0ba1d19c94b2ca2127bf9d96efabf1
Signed-off-by: Matthew Leach <matthew.leach@arm.com>
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2014-01-31 10:49:40 +00:00
The Android Open Source Project de8c80692b Merge commit '1ee45c2d2d816ee912624d81ff1b0aaa98e8fa74' into HEAD 2013-12-05 12:38:18 -08:00
The Android Open Source Project fc3cdb936e Merge commit 'afd0debe4bdf47dc0f968282ca1261842bb65d60' into HEAD
Change-Id: Ic9aed2c57bdfeb250ce2dd7f0e9289ba5b6e936a
2013-11-22 11:20:20 -08:00
Elliott Hughes ee47adfb1b am 0d103b59: am f2f74ca6: Merge "Remove references to obsolete pmem functionality."
* commit '0d103b596dd9883898a062beaacf980d4439b835':
  Remove references to obsolete pmem functionality.
2013-11-21 23:00:19 -08:00
Elliott Hughes 0d103b596d am f2f74ca6: Merge "Remove references to obsolete pmem functionality."
* commit 'f2f74ca65f34ae0cae6f0cca40f1c18aa771739d':
  Remove references to obsolete pmem functionality.
2013-11-21 18:43:51 -08:00
Elliott Hughes a5a13a3ecf Remove references to obsolete pmem functionality.
Change-Id: I5d3befd075e51614e6801115388a0a9f32fbb6ea
2013-11-21 12:22:39 -08:00
Marco Nelissen 708cc794f6 Native counterpart of new power manager method
Cherrypicked from master.

b/9464621

Change-Id: I54c0ed50a57ac870da91db8589a73a2c792dbd8d
2013-10-25 12:50:04 -07:00
Marco Nelissen 5c0106e134 Native counterpart of new power manager method
Change-Id: I54c0ed50a57ac870da91db8589a73a2c792dbd8d
2013-10-16 12:57:32 -07:00
Mike Lockwood 63ff1c644f Cleanup Binder interface between sensorservice and BatteryStats
Change-Id: Ia507160a2534059afe93849c8efc8407a046b50e
2013-09-25 09:28:41 -07:00
Mike Lockwood cbe36fe1ec Add support for sending and receiving ParcelFileDescriptors from native Binder code
Change-Id: I7f308e28ebac0755628e19c9b4d0d7399341b435
2013-09-05 08:43:22 -07:00
Jin Wei 78181df1ef fix valgrind ioctl warning.
Initialize local variable to avoid syscall ioctl warning.

Change-Id: I33a90917856018a8527305bb362948ef03bd734c
Origin-Change-Id: I022ebce40b3774a815639a5af34bc7aeb2489936
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 62797
2013-08-31 19:05:36 -04:00
Mathias Agopian e142428a9c Make Flattenable not virtual
Fallout from the Flattenable change, update all its uses.

Additionnaly, fix/tighten size checks when (un)flatten()ing
things.

Removed the assumption by some flattenables (e.g.: Fence)
that the size passed to them would be exact (it can
and will be larger in some cases)

The code in Parcel is a bit complicated so that we don't
have to expose the full implementation (and also to
keep the code smallish).

Change-Id: I0bf1c8aca2a3128491b4f45510bc46667e566dde
2013-07-30 21:19:13 -07:00
Todd Poynor a7b0f04aaf defaultServiceManager wait for service manager ready
If the service manager is not ready when we attempt to create a local
proxy, fail and retry.

Change-Id: I7d7300bc07cd70608793479aa3da282d066da7f6
2013-07-24 16:18:12 -07:00
Alex Ray 0e0f10b561 Merge "libbinder: add libutils dependency" 2013-07-23 21:49:38 +00:00
Alex Ray 894e178476 libbinder: add libutils dependency
Change-Id: I30c7291b04788c98faa43843a51b026b8a01932c
2013-07-23 13:43:00 -07:00
Zhijun He 20d0380594 Fix AppOsManager missing mutex unlock.
Need unlock the mutex after finish the getToken operation.

Change-Id: Icd83b383913d06e4d60976857aa314c3008ebea1
2013-07-22 17:13:12 -07:00
Dianne Hackborn 913b63d235 Follow framework change to track started ops by proc.
Change-Id: Ibbce3bf6556f45751c74bab045b46377e56bff9b
2013-07-17 17:26:15 -07:00
Jeff Brown ada11c5e67 Make getCallingUid/Pid const.
Change-Id: I1853b21eaa45d85274189dfd72f73fec48d0d6b7
2013-07-15 15:08:39 -07:00
Elliott Hughes 7b4d5355fb am 54d97c88: am 9da67a94: am 67481607: Merge "Revert "Second try at adding a compatibility symbol for the MemoryBase constructor.""
* commit '54d97c88b57d2c341f0629c9648d4400a34e4f41':
  Revert "Second try at adding a compatibility symbol for the MemoryBase constructor."
2013-07-11 10:16:47 -07:00
Elliott Hughes 54d97c88b5 am 9da67a94: am 67481607: Merge "Revert "Second try at adding a compatibility symbol for the MemoryBase constructor.""
* commit '9da67a9427f695128b5da61c8f987fd9198a5e05':
  Revert "Second try at adding a compatibility symbol for the MemoryBase constructor."
2013-07-09 15:35:33 -07:00
Elliott Hughes 9da67a9427 am 67481607: Merge "Revert "Second try at adding a compatibility symbol for the MemoryBase constructor.""
* commit '674816078588d0951c3c9bdaf26ecc9e9b3f2e0a':
  Revert "Second try at adding a compatibility symbol for the MemoryBase constructor."
2013-07-09 15:30:48 -07:00
Elliott Hughes 6748160785 Merge "Revert "Second try at adding a compatibility symbol for the MemoryBase constructor."" 2013-07-09 22:27:17 +00:00
Elliott Hughes 2dccfdcd26 Revert "Second try at adding a compatibility symbol for the MemoryBase constructor."
This reverts commit ddd286301b, because the third-party library in question has now been fixed.

Change-Id: Ic195a913f90b36268ed9d6e60be520decb4e198d
2013-07-09 22:15:42 +00:00
Todd Poynor 8d96cab8bf binder: add polling / single-threaded operation
This is currently safe to do only for processes that disallow any binder
threads to be created: setThreadPoolMaxThreadCount(0).

Change-Id: I8a27f3cf26f4d51edb7f222af487ac256cbcab65
2013-07-04 00:19:09 +00:00
Jeff Tinker fc1f308ca1 am de836890: am ef07386e: Prevent IPCThreadState::joinThreadPool from spinning on unexpected error
* commit 'de836890abc7b5381e285833052375cbb85730cb':
  Prevent IPCThreadState::joinThreadPool from spinning on unexpected error
2013-06-11 20:11:43 -07:00
Jeff Tinker de836890ab am ef07386e: Prevent IPCThreadState::joinThreadPool from spinning on unexpected error
* commit 'ef07386e2fca73680214ececc3c9c0ecbb0f6d88':
  Prevent IPCThreadState::joinThreadPool from spinning on unexpected error
2013-06-11 20:09:27 -07:00
Jeff Tinker ef07386e2f Prevent IPCThreadState::joinThreadPool from spinning on unexpected error
Adds logging to help determine what is happening to the /dev/binder
fd and dump the process state when it happens.

bug: 8912673
Change-Id: I2aa0c66fc499e91e0bf9ee4ae20404bec35adc82
2013-06-11 18:03:01 -07:00
Jeff Sharkey 05431a94d4 Merge "Bring back overloading to print String8/16." 2013-05-30 21:33:36 +00:00
Jeff Brown af0f8c0a56 am 255405eb: am 86b2ecdd: Merge "fix mem leak on error handling"
* commit '255405eb19e6a3fa7f7bb4de9b07beacdf65ece9':
  fix mem leak on error handling
2013-05-30 14:23:58 -07:00
Jeff Sharkey 8cb8925921 Bring back overloading to print String8/16.
Change-Id: Iecab20db2b8574d5f1e6fdefdc2c8d4ce6c37121
2013-05-30 14:04:28 -07:00
Jeff Brown 255405eb19 am 86b2ecdd: Merge "fix mem leak on error handling"
* commit '86b2ecdd311fca2e1e4a3504bf96bb23c5630492':
  fix mem leak on error handling
2013-05-29 19:01:17 -07:00
Hyejin Kim 3f727c0ea3 fix mem leak on error handling
Change-Id: I40d8e371c46184aa701fa676246201a9d8f6e27d
2013-05-28 18:39:02 -07:00
Mathias Agopian 002e1e58df libutils clean-up
Change-Id: I6ff4cfc736751de2912c697f954e45e275f2d386
2013-05-07 18:28:11 -07:00
Keun-young Park 9dd8d897d3 am 1cd763f1: am cd91024c: Merge "[MIPS] Avoid unaligned load/store for 64-bit doubles."
* commit '1cd763f123b9f1a2772ddff15ace81ec07b7660c':
  [MIPS] Avoid unaligned load/store for 64-bit doubles.
2013-03-26 11:45:01 -07:00
Keun-young Park cd91024ca1 Merge "[MIPS] Avoid unaligned load/store for 64-bit doubles." 2013-03-26 17:47:19 +00:00
Mathias Agopian cab25d680e improved CallStack a bit
- added a ctor that updates and dumps the stack immediately
- added a "logtag" parameter to dump()

Change-Id: Ie51c256071d282591752243bdb4f68cf9ff8829d
2013-03-21 17:12:40 -07:00
Elliott Hughes 5b00af2435 am 7212ff29: am 20e154f1: Merge "Second try at adding a compatibility symbol for the MemoryBase constructor."
* commit '7212ff29c6f4e4cd192fee6f072e80b36d8a728b':
  Second try at adding a compatibility symbol for the MemoryBase constructor.
2013-03-14 10:31:38 -07:00
Elliott Hughes c47f0988a3 Revert "Add a compatibility symbol for the MemoryBase constructor."
Cherry pick from AOSP to fix the build.
See https://android-review.googlesource.com/#/c/53690/

This reverts commit 7f974ff2f3

Change-Id: I1b123f446d0ff41e11ff81d4ef5f1472b59cac93
2013-03-14 10:51:17 +00:00
Elliott Hughes 5ca39ea57a am 9b57ad73: am 8facd1b2: Merge "Add a compatibility symbol for the MemoryBase constructor."
* commit '9b57ad737bceba9f8d4f5be303c70fa72be00eaf':
  Add a compatibility symbol for the MemoryBase constructor.
2013-03-13 23:11:00 -07:00
Elliott Hughes ddd286301b Second try at adding a compatibility symbol for the MemoryBase constructor.
Third-party libraries are currently trying to use the
MemoryBase constructor but failing because we fixed the
definition of ssize_t. This is a stop-gap for users of
this private API until we can get them fixed.

Bug: 8253769
Change-Id: Ie7c86f45fa39cb53539cab0ffe8585a585656714
2013-03-13 20:54:01 -07:00
Elliott Hughes 6dbf07d7d5 Revert "Add a compatibility symbol for the MemoryBase constructor."
This reverts commit 7f974ff2f3

Change-Id: I28ebfc5ac88bd025471b613aa7958d23749e6991
2013-03-14 02:56:34 +00:00
Elliott Hughes 7f974ff2f3 Add a compatibility symbol for the MemoryBase constructor.
Third-party libraries are currently trying to use the
MemoryBase constructor but failing because we fixed the
definition of ssize_t. This is a stop-gap for users of
this private API until we can get them fixed.

Bug: 8253769
Change-Id: I8a19770f3252d88ee87023fde625cc6289924b0d
2013-03-13 18:19:20 -07:00
Mathias Agopian e3e43b384e rename binder services main thread to Binder_*
When a binder service's main thread joins the thread pool
it retains its name (whatever the exec name was), which is
very confusing in systrace.

we now rename that thread just like its friends in the
thread pool.

Change-Id: Ibb3b6ff07304b247cfc6fb1694e72350c579513e
2013-03-07 15:34:28 -08:00
Eino-Ville Talvala e88a85e0d0 Fixes to native app ops services
Bug: 8181262
Change-Id: I3d3f20453f6c6f2756c988363c5b5453ef309cb6
2013-02-19 18:10:05 -08:00
Dianne Hackborn 5da5ca520c App ops: new native access API.
This is to help implementation of bug #8181262 and maybe
bug #8181261

Note the current code has not yet been tested; it is only
known to compile at this point.

Change-Id: I489674c96d0d3fc0ddacc92611931a19a9ee5230
2013-02-12 15:13:37 -08:00
Douglas Leung cc1a4bb1e1 [MIPS] Avoid unaligned load/store for 64-bit doubles.
Change-Id: Iefdcac8742f23fef31f63730b48698fc4205c3ad
Signed-off-by: Douglas Leung <douglas@mips.com>
2013-01-17 13:03:43 -08:00
Dave Burke 0bed1f541d Revert "ugly, temporary, workaroung for a problem where a binder thread spins forever"
This reverts commit 0845d0245e

Change-Id: I395037cb9427cd11f7de6bb78fbdfa917fc6263a
2012-10-06 23:20:00 -07:00
Mathias Agopian 0845d0245e ugly, temporary, workaroung for a problem where a binder thread spins forever
Bug: 7289992
Change-Id: I0c3d482a1af57e5f444be2ba7f2751ac3e954af2
2012-10-05 17:28:04 -07:00
Dianne Hackborn 8210185fe3 No longer need "original calling uid".
Change-Id: Ifc4a89dd088609a5a8553f6ac6553174e09e8222
2012-08-31 15:40:58 -07:00
Johannes Carlsson db1597a989 Fix shutdown sequence to avoid SIGSEGV when running am command
When the app_process is shutting down the main thread will close the
binder fd while pool threads are executing an ioctl (in
IPCThreadState::stopProcess called by AppRuntime::onStarted in
app_main.c).

The binder driver will then return all pending calls in ioctl
without any error and with a command. One of the threads gets a
BR_SPAWN_LOOPER which will create a new thread (the other thread
gets a BR_NOOP). This new thread then calls
vm->AttachCurrentThread. Usually this results in a log entry with
"AndroidRuntime: NOTE: attach of thread 'Binder Thread #3' failed",
but sometimes it also causes a SIGSEGV. This depends on the timing
between the new thread an the main thread that calls DestroyJavaVM
(in AndroidRuntime::start).

If IPCThreadState.cpp is compiled with "#define LOG_NDEBUG 0" the
pool thread will loop and hit the
ALOG_ASSERT(mProcess->mDriverFD >= 0) in
IPCThreadState::talkWithDriver.

Crashes like this has been seen when running the am command and
other commands that use the app_process.

This fix makes sure that any command that is received when the driver
fd is closed are ignored and IPCThreadState::talkWithDriver instead
returns an error which will cause the pool thread to exit and detach
itself from the vm. A check to avoid calling ioctl to a fd with -1
was also added in IPCThreadState::threadDestructor.

Another solution might be to change the binder driver so that it
returns an error when the fd is closed (or atleast not a
BR_SPAWN_LOOPER command). It might also be possible to call exit(0)
which is done when System.exit(0) is called from java.

Change-Id: I3d1f0ff64896c44be2a5994b3a90f7a06d27f429
2012-06-25 13:58:47 -07:00
Magnus Strandberg 1ba24574b2 Aligning native Parcel implementation to Java.
The Java implementation of writing the RPC response header
calculates the length of the header including the 4 bytes
specifying the header length but the native implementation
excludes the 4 bytes specifying the length from the header
length.
The native implementation has been aligned to the Java impl.

Change-Id: I325bf272a63152d8fded4cf4e51a906b5a9bfe19
2012-06-08 08:29:01 -07:00
Dianne Hackborn 555f89d8df Add callback hack to find out when to reload system properties.
Every IBinder object can accept a new transaction to tell it that
it might want to reload system properties, and in the process
anyone can register a callback to be executed when this happens.

Use this to reload the trace property.

This is very much ONLY for debugging.

Change-Id: I55c67c46f8f3fa9073bef0dfaab4577ed1d47eb4
2012-05-09 14:53:26 -07:00
Glenn Kasten a26e1cfbbc Scheduling group cleanup
Remove C++ APIs androidSetThreadSchedulingGroup and
androidGetThreadSchedulingGroup, and the ANDROID_TGROUP_* constants.

Former callers of these should now use the C APIs set_sched_policy and
get_sched_policy, and the SP_* constants.

Note: debug.sys.noschedgroups is not supported by the C APIs,
this needs to be discussed.

Change-Id: I32bbfc539ef4090faf9ef0320380e8cca9eae07c
2012-04-19 11:32:59 -07:00
Mathias Agopian 1b80f793d2 add set thread count
Change-Id: I70f02908d8362a465eb8a2a24356f6989847f7ba
2012-04-18 17:50:03 -07:00
Mathias Agopian e8db871de7 double checked locking pattern is not safe on SMP
Change-Id: Ie6dd564bdcd45647cb4d62ab259462e3db112576
2012-04-16 19:30:56 -07:00
Glenn Kasten 4bcb57502c Remove obsolete references to sched_policy.h
As part of scheduling policy cleanup, remove or isolate
all references to the scheduling policy APIs.

Change-Id: Ia1ea2fe711a399039f25217309e061267744b856
2012-03-05 18:12:45 -08:00
Glenn Kasten 67f8b5228e Merge "Shorten thread names" 2012-02-29 14:59:08 -08:00