• Home
  • History
  • Annotate
  • only in /system/chre/util/include/
History log of /system/chre/util/include/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c67f6f671f586d57f5c836fadc163ad562c75c55 30-Aug-2017 Andrew Rossignol <aarossig@google.com> Adds a conversion constructor to UniquePtr

Bug: 65119819
Test: ./run_sim.sh, ./load_chre.sh
Change-Id: I29413953c39ddea43625cd56f651477f1a16ddd3
hre/util/unique_ptr.h
hre/util/unique_ptr_impl.h
97156830527953070044eed8b0eb42ba689c53c4 28-Aug-2017 Andrew Rossignol <aarossig@google.com> Makes UniquePtr, DynamicVector and FlatBuffers portable

- They are now usable when compiled as part of an external nanoapp.

Bug: 62868460
Bug: 65119819
Test: ./load_chre.sh and basic CHRE sanity check
Change-Id: I1c6f9047bae0b9fdd2d99062b29784da8fd256eb
hre/util/container_support.h
hre/util/dynamic_vector_impl.h
hre/util/memory.h
hre/util/memory_impl.h
hre/util/unique_ptr_impl.h
792a98a5f7225d28dfb3963b89d48504b554f838 24-Aug-2017 Brian Duddie <bduddie@google.com> Add MakeUniqueZeroFill helper for UniquePtr + test

Bug: 63601406
Test: ./run_test.sh, all tests pass
Change-Id: Ifd38fac4b77c93c8067d0a7acd2699d901b49915
hre/util/unique_ptr.h
hre/util/unique_ptr_impl.h
ff1c1a2ab3ff2614bb6cea1f1d6f6e9c44a87464 05-Aug-2017 Arthur Ishiguro <arthuri@google.com> Initial framework for uimg transition for CHRE

- Creates a "power control manager" class for platform-specific power
related routines
- Creates a platform PAL base class, to be used as a central location to
perform platform specific routines related to CHRE interactions with the PAL
- For the SLPI, the following will occur:
1) We vote for big image for any event handling entry points for big image
nanoapps, and before calling a PAL API.
2) Whenever the system is idle (event loop has no pending events), we
remove our previous big image vote.
- Creates a size() function for fixed size blocking queue

Bug: 63601406
Test: Compile and run CHRE

Change-Id: I960dc883ec90d676ee638a70912e9353d470d039
hre/util/fixed_size_blocking_queue.h
hre/util/fixed_size_blocking_queue_impl.h
9a99acb25a641bc9908e35c14aba1423b3af76ba 01-Jul-2017 Brian Duddie <bduddie@google.com> Change IMU Calibration app ID

Use Google's vendor ID + app ID 0x16 instead of the sample app vendor
ID.

Fixes: 63178103
Test: compile only
Change-Id: If13831ef8ab15565724a1f01c09c7565b43f62ab
hre/util/nanoapp/app_id.h
d0530f420d8bdaee755ec2834af407424de195e0 16-Jun-2017 Arthur Ishiguro <arthuri@google.com> Logs CHRE state in debug dump

For starters printing the heap alloc stats, list of loaded nanoapps, and
registered sensors.

Bug: 62659408
Test: Collect bug report, verify log shows up in lshal-debug.txt
Change-Id: I614fd7c708adacab24e00483562bbd24bb13cbc6
hre/util/system/debug_dump.h
7e0b18cd2fd2f6f994b57659873113d0f140c124 26-May-2017 Meng-hsuan Chung <menghsuan@google.com> Adds AshWorld nanoapp to test ASH API

Test: compile and run
Change-Id: If79918222211743319b18d9b00674d039f07c16c
hre/util/nanoapp/app_id.h
39d874441f068012800611e0cb5465b9b24c47b7 20-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adds a destructor to FixedSizeVector"
a2dbd6ba8253d227db1c90493f633bd52117dc6b 20-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Switch to use aligned storage for MemoryPool"
4849d809e7b9691e5968923d546c8be7547e4386 19-May-2017 Meng-hsuan Chung <menghsuan@google.com> Adds a destructor to FixedSizeVector

Test: run_tests.sh and run_sim.sh

Bug: 38419926
Change-Id: Id1f74a3f1dd4c5d99c051f3ea27014c5b704e767
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
a51ef01822ac68061a1d6e686389cfbcb0e1f8da 19-May-2017 Meng-hsuan Chung <menghsuan@google.com> Switch to use aligned storage for MemoryPool

Test: run_tests.sh and run_sim.sh

Change-Id: I120982232bf9d096bf419385ee5a791434d6a55b
hre/util/memory_pool.h
hre/util/memory_pool_impl.h
ec1720a0d73e703794430f8b0b1ffe3bb4763bb3 18-May-2017 Andrew Rossignol <aarossig@google.com> Adds a logBuffer to util

- Not intended for production usage, but handy for debugging issues
interactively.

Test: Dump a buffer.
Change-Id: I790c4af97f023d863de862c90df4e6d10812fffc
hre/util/nanoapp/debug.h
9695b7bc89781c40aeb545ac0e879ff063590bf0 11-May-2017 Andrew Rossignol <aarossig@google.com> Compile CHRE with hidden visibility

- Export the API with a new DLL_EXPORT macro
- Prevents external code from calling into CHRE

Test: load_chre.sh, see activity.so load + run
Change-Id: Ic57fc7e15e115f394cb14e0a4f5729c25c21a1cf
hre/util/macros.h
1180c410c55a0b6a130667ab6c59c406fe42a9ce 02-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "[Nanoseconds] Adds tests to verify overflow in +/- operations"
b2ddcf26fc919cb8024ab0536db8362bcb77dfd5 28-Apr-2017 Meng-hsuan Chung <menghsuan@google.com> [Nanoseconds] Adds tests to verify overflow in +/- operations

Change-Id: I036828e5996d2aed984eda7847e6f2d282dbf62d
hre/util/time.h
hre/util/time_impl.h
55e0aaa6540f86549b2b95c6b06208466921ee23 28-Apr-2017 Andrew Rossignol <aarossig@google.com> Adds a ScopeTimer to util

- Measures the lifespan of an object called ScopeTimer and logs the
duration in the destructor.
- Useful for manual benchmarking.

Test: Add a ScopeTimer to event loop and run the simulator
Change-Id: I6b4fe0b0672ca504627a5602f6ca07f21dfaa708
hre/util/scope_timer.h
hre/util/scope_timer_impl.h
f3ea231ca3ca6a526316c75e9a3df033dcf1ee07 19-Apr-2017 Mehdi Alizadeh <mett@google.com> Overloads operator== for DynamicVector

To increase similarity to std::vector's interface.

Test: run unit tests, simulator
Change-Id: I78e491472dad17c47f0d79b66178e713e4076840
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
df85b4c9c0a215f67684db3e6bf2d1996ee811d4 18-Apr-2017 Arthur Ishiguro <arthuri@google.com> Add unit tests for time duration classes in util

Test: run_tests.sh
Change-Id: Ibf53391ed4f3ea1d47e76923ecdcbb772bd09805
hre/util/time.h
hre/util/time_impl.h
39ec3db30b1c10e065e83cc621456fca48b495d3 17-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I43828975,Ie07b8722

* changes:
Updates the include path for time_impl.h
Updates path to x86 toolchain
fde6592312974ea7405bcec9f501eb8c05133bab 17-Apr-2017 Arthur Ishiguro <arthuri@google.com> Updates the include path for time_impl.h

Test: run_tests.sh and run_sim.sh
Change-Id: I438289758e49a8634ea74cfd2c6c62f70bc0099c
hre/util/time.h
2d7d24a7bb72c9c3b4ff1af5f7fef8b303fd8c0e 17-Apr-2017 Brian Duddie <bduddie@google.com> Updates to Optional for safety and consistency

After the destructor is invoked via Optional::reset(), the underlying
object is invalid and cannot be safely used for assignment. Avoid this
by performing move/copy construction in the Optional assignment
implementations if the underlying storage is uninitialized.

Also, bring chre::Optional in-line with std::optional by removing the
requirement for the contained object to have a default constructor
(instead leaving the object storage uninitialized after default
construction of Optional), and making the semantics of move assignment
the same (only the underlying object is moved, not the "ownership" of
the object, i.e. the moved-from Optional can still have has_value() set
to true).

Test: ./run_tests.sh
Change-Id: Ie3627838aee10acf89d3cf609aebf8fc6694ebea
hre/util/optional.h
hre/util/optional_impl.h
dc94298b510b26eedbe1e8744b92f7c0b41a6006 14-Apr-2017 David Jacobs <davejacobs@google.com> Update to 'chreLogNull'

This change was required because commenting out parameter name is
not valid C.

Change-Id: Ie6049feb68a3d011c987dbf1e18f7032bcc6f758
hre/util/log_common.h
f1694b5b8abc93de4e187a78c096977ad6cf4b56 07-Apr-2017 Brian Duddie <bduddie@google.com> Add ConditionalLockGuard, update EventLoop to use it

Test: run unit tests and simulator
Change-Id: Ia031c9f8afb65b3e14c19ca8a8ada46723219393
hre/util/conditional_lock_guard.h
hre/util/conditional_lock_guard_impl.h
b2466e41846b76b11b09788e1c1ff49632237a90 07-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes Ib6dbe26b,Ia08c04d9

* changes:
Add support for unloading nanoapps
Add test nanoapp that spams events and messages
7c311cb87caba54c11894d72a1a75f0cab365ce9 07-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes Iee7d7513,Ieb54531e

* changes:
Enables -Wconversion for the simulator and fixes some warnings
Releases the WifiScanRequest async result on event posting failure
99f01ac9bd6e351538cb8922ef15d9e838e7339a 06-Apr-2017 Brian Duddie <bduddie@google.com> Add support for unloading nanoapps

Add the capability for clients on the host to dynamically request the
unloading of a nanoapp. This initial implementation takes measures to
avoid potentially referencing the memory in the nanoapp after it is
unloaded, by flushing events and messages, but does not clean up after
the nanoapp if it leaves a sensor request open, or a timer running, or
doesn't free all of its dynamic memory, etc. As part of ensuring this
safety, CHRE will now prevent a nanoapp that is being unloaded from
sending events or messages just prior to invoking the nanoappEnd
callback.

Add an unload tester nanoapp that unloads the spammer test nanoapp after
a short delay, to help verify that event and message cleanup is handled
appropriately.

Test: run unload tester nanoapp in simulator and on SLPI, use
chre_test_client on SLPI to unload AR
Change-Id: Ib6dbe26b6414e417401412375390ceef5663d4d9
hre/util/nanoapp/app_id.h
3d2336c8674fff457469e0749ab64f220eaa38ff 06-Apr-2017 Brian Duddie <bduddie@google.com> Add test nanoapp that spams events and messages

To be used in app unload testing, etc.

Test: run simulator
Change-Id: Ia08c04d94abe2923d04a85b63c24f8b904496a45
hre/util/nanoapp/app_id.h
7e3b2f719dfcff6fc0a394bafe6506981a2a2e17 05-Apr-2017 Andrew Rossignol <aarossig@google.com> Enables -Wconversion for the simulator and fixes some warnings

Test: Run the sim, tests and load_chre.sh.
Change-Id: Iee7d7513b91a92e7daea108346ab5881e3f55a14
hre/util/nanoapp/sensor.h
7831da5d5b053b1be69925e60d16030ec4c462dc 06-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Expose size_type in DynamicVector"
2350c21b0d519b112c903494ba3fb63d04f49aae 05-Apr-2017 Brian Duddie <bduddie@google.com> Add DynamicVector::pop_back()

Test: run unit tests
Change-Id: Iaf176380a84de839d76858f39da772da7a05c79a
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
cf24c0e050002fd3331ad4498f97f3842ec532aa 05-Apr-2017 Brian Duddie <bduddie@google.com> Expose size_type in DynamicVector

To increase similarity to std::vector's interface.

Test: run unit tests, simulator
Change-Id: Id43f6e026c8c5c7629e046477541c60fdc54f1fd
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
090c2796acebb647a98c48a007c7b2bb151f1e50 04-Apr-2017 Brian Duddie <bduddie@google.com> Add front() and back() methods to FixedSizeVector

Test: compile
Change-Id: Iaf9439a0d5e66869194d57659e41bad01d2cf71a
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
d2e14b12152f4caaf9e6d9b6fbc6152588b509d9 01-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I01867267,I3d1ed01c

* changes:
Supplies stubs for GNSS location start/stop session APIs
Adds a GnssRequest class compliant with the RequestMultiplexer
c1893d235b674f8a859a9e53aad406b5100c725d 31-Mar-2017 Andrew Rossignol <aarossig@google.com> Supplies stubs for GNSS location start/stop session APIs

Test: Run the simulator
Change-Id: I018672675e3244b7b253e669c51f8eb6978cbbd2
hre/util/time.h
hre/util/time_impl.h
5104fb101aaea4793daa061b160fbc3feb051b0d 31-Mar-2017 Andrew Rossignol <aarossig@google.com> Adds a GnssRequest class compliant with the RequestMultiplexer

Test: Run simulator and tests.
Change-Id: I3d1ed01c492e4c37d320138de2c02f7c5798750f
hre/util/optional_impl.h
hre/util/time.h
hre/util/time_impl.h
56944d8c8698b3304ddc52dd257ec8da30dcb189 30-Mar-2017 Brian Duddie <bduddie@google.com> Reduce debugging output from CHRE daemon

Test: load, confirm verbose binary buffer dumps are not printed
Change-Id: I2974690a608cd66cc37fcb9e2990ec3063e74c69
hre/util/log_common.h
1a16de2440b92ac60a94029589a20f92011b6841 27-Mar-2017 Brian Duddie <bduddie@google.com> Make vector swap() a no-op when the same index is given twice

Add a check to the swap() methods in FixedSizeVector and DynamicVector
to skip attempting to swap the values when the passed-in indices to swap
are the same.

Test: run simulator with valgrind
Change-Id: I0e24a5e2b3d78ffdd1fa82ab2ba28e1240cc24a0
hre/util/dynamic_vector_impl.h
hre/util/fixed_size_vector_impl.h
8be5eabe6a4fc60c56a3b32794bb6677e26f6eab 27-Mar-2017 Brian Duddie <bduddie@google.com> Fix incorrect usage of assignment, move in containers

Containers like DynamicVector were using the assignment operator in
multiple places to initialize memory. This is not valid, as assignment
assumes that the receiving object has already been constructed. This
manifested in use of DynamicVector<UniquePtr>, where UniquePtr's move
assignment operator would call memoryFree on its pointer if not null -
if its pointer was some non-zero uninitialized memory, this would lead
to memory corruption and a likely crash.

Resolve this issue by correcting all instances where assignment was used
on uninitialized memory to use placement new to properly construct these
objects. Also, make updates to places where containers assumed that
move/copy assignment/construction was supported by the contained type to
check that condition and select the appropriate option.

Finally, fix the tests that were written with the assumption that
certain operations would use assignment when they should have used
construction, and also increase overall test coverage to ensure this
issue does not recur.

Test: run tests and simulator with valgrind
Change-Id: Ia2803ab78a02065acab384e536c3259a52f7c863
hre/util/array_queue.h
hre/util/array_queue_impl.h
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
hre/util/fixed_size_vector_impl.h
hre/util/memory.h
hre/util/memory_impl.h
30b9ff24de129660ccc6ee7a4cc585222be96e9f 27-Mar-2017 Brian Duddie <bduddie@google.com> Move unique pointer construction to free function

Including a forwarding constructor in UniquePtr prevents creation of a
move constructor, which is necessary to resolve an issue in the
containers. Instead, use a new free function called MakeUnique to
perform allocation + in-place construction + assignment to a UniquePtr.
Also, add new UniquePtr constructors that enable (1) default
initialization to null, (2) assume ownership of a pointer to dynamically
allocated memory, and (3) transfer ownership from another UniquePtr.

Test: run simulator and tests
Change-Id: Id8f91d7452ccb19a4bc7acf3ad87e8e2db3bac5f
hre/util/unique_ptr.h
hre/util/unique_ptr_impl.h
2b9d71a9f6a9e8cc0e787957d022154231f29962 24-Mar-2017 Brian Duddie <bduddie@google.com> Correct nanoappEnd entry point naming

Was previously referred to as nanoappStop, which does not match the CHRE
API definition.

Test: compile for linux and slpi
Change-Id: I0586a702624f0159e79876608c5955ed974912f1
hre/util/entry_points.h
9d5b500a223ef73560f0dce38f50b809bde5dd0d 23-Mar-2017 Brian Duddie <bduddie@google.com> Rework Nanoapp model

Unify Nanoapp into a single monolithic object that directly exposes the
common interfaces implemented in core and platform. As a result of this,
PlatformNanoapp will no longer exist as a separate entity from Nanoapp.
In preparation for dynamic app support, refactor static nanoapp loading
to construct a UniquePtr<Nanoapp> and transfer ownership to the
EventLoop when starting a nanoapp.

This commit includes the first look at the nanoapp support library which
will be used for external nanoapps implemented as dynamic shared
objects.

Test: run chre_test_client with MessageWorld, and run the Linux simulator
Change-Id: Ic17f2c48c3156d1e5bb255b1c6a188908123d5df
hre/util/entry_points.h
hre/util/nanoapp/app_id.h
928b06b8c3dde5d402d5f52f26cf0e0292f2572d 22-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Updates parseChreWifiBand to always return a string"
7ea0cef09ad26f2850b5a4a2d3add258dea2a441 22-Mar-2017 Brian Duddie <bduddie@google.com> Implement UniquePtr::release()

Test: run UniquePtr tests
Change-Id: Ifb43f9f6150e897040cbbe842b5bf35da5f4d132
hre/util/unique_ptr.h
hre/util/unique_ptr_impl.h
de21e14b333cc8f52db1e759b537c4c1a8e81dd3 21-Mar-2017 Andrew Rossignol <aarossig@google.com> Updates parseChreWifiBand to always return a string

Test: Run on device
Change-Id: Ic65a9907c02d81ce1f10a41dcd9a6323c55725b2
hre/util/nanoapp/wifi.h
0e2f02c628480c36e32c05656e66e108413a5a42 21-Mar-2017 Andrew Rossignol <aarossig@google.com> Extends the logging of WiFi scan events in WiFiWorld

Test: Compile + load on device and view scan results
Change-Id: Ib10c02ec770aaf2b6c65eb968b20660ec2755792
hre/util/nanoapp/wifi.h
7621b3267fd2ff1068d7aa7d75441d68646226ab 19-Mar-2017 Brian Duddie <bduddie@google.com> Reorganize HostProtocol, add hub info query

Split HostProtocol into three classes: one for the host, one for CHRE,
and one that's shared. Since the protocol is not fully symmetric (e.g.
messages to/from nanoapps are the same in both directions, but only one
side will ever request hub info, and only CHRE will ever construct the
response), this avoids pulling in unneeded code.

Also, add support for querying hub information from CHRE to be used in
the HAL, and rework the HostLink pending outbound message queue to be
more generic.

Test: run chre_test_client
Change-Id: Id88485b8c5a085eb886d4059840ac640c0383c88
hre/util/array.h
hre/util/macros.h
da6eaabf8572a16acaebd516dd96ce0063d71e91 18-Mar-2017 Andrew Rossignol <aarossig@google.com> Adds initial WiFi scan event logging to WifiWorld

Test: Compile + run on device
Change-Id: I6e4cd05064c93eb26223b1e69f57b07b8922cedd
hre/util/nanoapp/wifi.h
746ea0ecb99d3f758da17292db549b29720c4442 16-Mar-2017 Andrew Rossignol <aarossig@google.com> Adds getSensorNameForEventType

This is duplicated in two nanoapps and seems useful for logging so let's
stop the copy-pasta and make it available for everyone :)

Test: Run the simulator
Change-Id: I215f8622647bcd2890189687f47ace40c06e47e5
hre/util/nanoapp/sensor.h
a16406ba1a734f21f36a4b0f64b23b062644b6e2 16-Mar-2017 Andrew Rossignol <aarossig@google.com> Adds a nanoapp logging header file

- Updates nanoapps to use this new logging macro
- Updates chre.h to be a system-style include
- Makes using chreLog shorter
- Allows disabling logs below a certain level
- Moves some common log level logic to a new file to be shared

Test: Compile and run the simulator
Change-Id: I81ce7218132f9325b58e2a6792a3bfb6573c30ed
hre/util/log_common.h
hre/util/nanoapp/log.h
48080e341c2a12db12deb086adce1d487a759141 11-Mar-2017 Meng-hsuan Chung <menghsuan@google.com> Adds a const overload of begin() and end() iterators

Change-Id: Ia24d985b602da8c9761f8cf746a0738cf1e3e468
hre/util/array_queue.h
hre/util/array_queue_impl.h
hre/util/dynamic_vector_impl.h
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
hre/util/priority_queue.h
hre/util/priority_queue_impl.h
cea64a899fafc0e75dc0e63dbe699ca5679564ad 09-Mar-2017 Meng-hsuan Chung <menghsuan@google.com> Removes one-shot sensor's requests after delivering data to clients

Change-Id: Ieedc53cd140eedfb206eb6e8cdda06894a77fc07
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
30f18903edc1dfe46e12b9989760ef7a56cb31d3 02-Mar-2017 Andrew Rossignol <aarossig@google.com> Implements the chreWifiConfigureScanMonitorAsync CHRE API

Test: Compile only, WifiWorld will be extended next
Change-Id: Idb8a59ec7cbc2808fa08885ffdcd22b14b30d1b6
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
e62f9949c5aa827e175cfb239d9840d7517e8052 02-Mar-2017 Meng-hsuan Chung <menghsuan@google.com> Adds and populates sensor oneShot, onChange and minInterval properties

Change-Id: Iec1962cc95a949ecfbe99661e8ae87d7333792a5
hre/util/optional.h
hre/util/optional_impl.h
5312518f60833ba29ced8109d037f40bf754214f 02-Mar-2017 Andrew Rossignol <aarossig@google.com> Adds a full() method to the ArrayQueue container with a test

Change-Id: Ia1d77192a4ccd61de5e6b9ba40df09480acd3f82
hre/util/array_queue.h
hre/util/array_queue_impl.h
bbda86b265077ca90306c5f2e2590807daa39d55 02-Mar-2017 Brian Duddie <bduddie@google.com> Add DynamicVector::copy_array

Introduce new function to support populating a vector by copying
elements out of an existing array.

Change-Id: Ibf37eb48e54322f3723aa0e34930f57a3f744e6f
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
b454fc50edbadc3b212125cabb0503c039aa1d25 02-Mar-2017 Andrew Rossignol <aarossig@google.com> Replaces DynamicVector with FixedSizeVector for WifiSsids

- Also removes a stale TODO.

Change-Id: I847acaea5245a2bbdbaba5dacc8924ba28975b08
hre/util/fixed_size_vector_impl.h
042f73e3b7f019c818f69b2c097c4b6f9db839b5 22-Feb-2017 Brian Duddie <bduddie@google.com> Add deferCallback() for use by the CHRE system

Leverage the event subsystem to implement a method of invoking a
callback from within the context of an EventLoop at some point in the
future. This can be used to transfer control from a potentially
arbitrary thread in a platform-specific callback, into a known
EventLoop context, as well as to defer processing of some event.

Also, modify EventLoop::postEvent to indicate whether the event was
successfully posted to the queue.

Change-Id: I79e5b8d5aff82fd2fb304b2a1055aebc3047b50d
hre/util/fixed_size_blocking_queue.h
hre/util/fixed_size_blocking_queue_impl.h
83be94436ec4d35296e00da877c7198f67b6af44 23-Feb-2017 Brian Duddie <bduddie@google.com> Add DynamicVector::front()

Change-Id: I1653105909346e1c659929effdcc11c9e5bd224d
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
4639307f24f079e7e465a3a17ca90bfac4372ad3 18-Feb-2017 Brian Duddie <bduddie@google.com> DynamicVector: Add clear(), wrap(), and unwrap()

Introduce the ability to wrap an existing buffer so it can be used as a
DynamicVector, plus unwrap to restore the vector to controlling its own
buffer, and add a function to erase all elements in the vector.

Also, refactor to avoid early return in existing functions.

Change-Id: Iee92dbf7ffbfb59615ea0a7bb8fb06740fd09dd4
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
bdeb899511e9431117d4d41315742757ea895225 03-Feb-2017 Andrew Rossignol <aarossig@google.com> Adds a move-assignment constructor to DynamicVector and test

Change-Id: Ibd1e83cbe299832abbe0502d2e8d5484cd6c9c82
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
39993a0032116a71eb51cbf14186eec6bab328f2 01-Feb-2017 Andrew Rossignol <aarossig@google.com> Adds an std::move-based Optional constructor

Change-Id: I2ca5cd1ae4f50eed1d99e4ea35703ede9942f7eb
hre/util/optional.h
hre/util/optional_impl.h
5ea6fa358541d4b9cc1d9856a0b9291785d7536d 06-Feb-2017 Meng-hsuan Chung <menghsuan@google.com> Rename CompareType to CompareFunction in PriorityQueue/heap

Change-Id: I4d7e9adffef2684e87f8bcbc0aeabfe9e7a8a687
hre/util/heap.h
hre/util/heap_impl.h
hre/util/priority_queue.h
hre/util/priority_queue_impl.h
e1129bcc6fb320fd1752cd6c900ead2a0595c761 28-Jan-2017 Meng-hsuan Chung <menghsuan@google.com> Iterators: rename const iterators

- Renamed const iterators to cbegin() and cend().
- Added comments for iterator invalidation
- Added iterator tests.

Change-Id: Ia10d33c64d0c543a2791dc93f875a641148298e1
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
hre/util/priority_queue.h
hre/util/priority_queue_impl.h
9b598a5b372a47b8e30113cd5650448ce4ae3418 21-Jan-2017 Meng-hsuan Chung <menghsuan@google.com> Iterator implementation for array queue

Change-Id: Iacf904177d41b00e4496f9df04a3b03a617a9b0b
hre/util/array_queue.h
hre/util/array_queue_impl.h
1bbcacadd7331e0db5cf17f01e8ba7f451ff6740 27-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a copy-assignment operator to Optional

Change-Id: Iea24e175e0b0aae273d0022b624723554cf45d01
hre/util/optional.h
hre/util/optional_impl.h
a168da9318a8d996ffd82beacb69a248b11d8569 26-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a move-assignment operator to the Optional container

Change-Id: Ic3cb52605e37b08f70ee4d9da73ece98c040e875
hre/util/optional.h
hre/util/optional_impl.h
35577195df7ab14e9f58443c2e59293499fe7a8f 26-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a default constructor with inital value to Optional

Change-Id: Ife274c1b539db7413a321d5b515faabcb2221da4
hre/util/optional.h
hre/util/optional_impl.h
7f40ab39c4b3eb24327edf2be9e74d521d41532f 18-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds resize() to FixedSizeVector and ARRAY_SIZE macro to util

Change-Id: I1a095ef8ba644111edb5599f430af51e7bdb2fbf
hre/util/array.h
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
fe38dd8c9780b599cf2eff09ff6fbf60fbe9ab76 18-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds an Optional container to util and tests

Change-Id: I12d6144baeaa66f5cbbee414d3be8c48b641fceb
hre/util/optional.h
hre/util/optional_impl.h
f025d4a118047d7763d75ff50c37fdd2819ba8eb 25-Jan-2017 Andrew Rossignol <aarossig@google.com> Removes a TODO from the MemoryPool, it is done

- The SynchronizedMemoryPool facilitates this need.

Change-Id: I2f0bc8cd8ca0e8c24c6568d9cd5532570221f7bd
hre/util/memory_pool_impl.h
90c04ef3564eb228eebb5da5b21bb80e5e46e299 13-Jan-2017 Meng-hsuan Chung <menghsuan@google.com> Iterator implementation

Added implementation for containers whose iterator can rely on pointer
arithmetics, which includes FixedSizeVector, DynamicVector and PriorityQueue.

Change-Id: Iee5b682fd093360e11ff47506d5cb21ff804ca21
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
hre/util/priority_queue.h
hre/util/priority_queue_impl.h
c22313712cce1ffe297ad5243fc6fe28b9bcad01 18-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a move-assignment version of push_back to DynamicVector

Change-Id: I5bff2f543f41edc5056e690ac0439fe0be86888e
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
58d03812b7cce3a90c39cd30bbff6531cc3e6e30 12-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a utility function for interval to SMGR rate conversion

- Adds tests that run on Linux as this has no dependencies on the SLPI.

Change-Id: I6cd082233863afe41f85b8fd723278b5202cff30
hre/util/time.h
hre/util/time_impl.h
f546f4c27e66dc4ea868e660cebac9ba0c31fad9 11-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a SensorRequest class

- Implements the RequestMultiplexer API
- Adds tests to verify the behavior of the request
- Adds a SensorRequest instance to the PlatformSensor class
- Builds infrastructure for setting the platform sensor configuration

Change-Id: I6c4bd2e8bd4c58610a6c63d0f49bbd971d1bb9e0
hre/util/time.h
hre/util/time_impl.h
6ba2805af752a364b74397c7f1fe70ee35bc83b7 10-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a UniquePtr class to util

- Similar to std::unique_ptr
- Adds tests

Change-Id: I74ac7881bd5d1fecf3d8348a5cf47a4ac420586d
hre/util/unique_ptr.h
hre/util/unique_ptr_impl.h
8acb65434c74048a032a57f5321baeb028f6bdf3 10-Jan-2017 Andrew Rossignol <aarossig@google.com> Update DynamicVector to use std::move when possible

- Adds a test to verify the behavior.

Change-Id: I3250c2e1aac98aea44d8e1793536d5026fbae57d
hre/util/dynamic_vector_impl.h
c265103d508f74c2bec5fcdd42e960c044bb19c5 10-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a back() method to DynamicVector

Change-Id: I25660c2dedfecf2bce95f5d530cdab5178cfead1
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
c7c70aa903fdef3a6074cdb06d266b6ad3821d27 10-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a Singleton template

- Allows for one instance of a given type and uses static storage with
deferred initialization.
- Provides a lifecycle test to validate the behavior

Change-Id: I76fa737f50612be1386df4bf79733c86814d56fa
hre/util/singleton.h
hre/util/singleton_impl.h
fa589941fe8c8aa1ff0d8fb9ee1445dba6382768 10-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a missing include to PriorityQueue

Change-Id: I1380e60e36166466e9c3ebeebe60690fd383c0a4
hre/util/priority_queue.h
021aae0ed1c9ff80d9ffef6b1114f030138c25d2 07-Jan-2017 Meng-hsuan Chung <menghsuan@google.com> priority queue: update to use heap data structure

Change-Id: I35e95c597db9eb9eed3fda21bb02d1268cc8fe74
hre/util/dynamic_vector_impl.h
hre/util/fixed_size_vector_impl.h
hre/util/priority_queue.h
hre/util/priority_queue_impl.h
12048259ea9203bccb00460b821a40731249f1e2 04-Jan-2017 Meng-hsuan Chung <menghsuan@google.com> Heap implementation

Functions inspired by std:push_heap and std:pop_heap are added.

Currently, they only work with FixedSizeVector and DynamicVector.
FixedSizeVector and DynamicVector are also modified to add support
for required methods.

Change-Id: Id05d3ad996ebe9cf8b0250f50da2bf031a7b6f82
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
hre/util/heap.h
hre/util/heap_impl.h
022cc6c770c299bb364e35377a2661791475bbce 22-Dec-2016 Andrew Rossignol <aarossig@google.com> Renames BlockingQueue to FixedSizeBlockingQueue.

- Updates EventLoop to use a FixedSizeBlockingQueue.
- Updates tests.

Change-Id: I680bdbc3d2039e14b8250cb291bbb8292a304c74
hre/util/array_queue_impl.h
hre/util/blocking_queue.h
hre/util/blocking_queue_impl.h
hre/util/fixed_size_blocking_queue.h
hre/util/fixed_size_blocking_queue_impl.h
f8d6e050ae7a17b5a96886135872d615d111a84a 22-Dec-2016 Andrew Rossignol <aarossig@google.com> Adds find() to DynamicVector

Change-Id: I707cf83aaaff71c5f37e839fbdf4feac82028537
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
f9fe99d728ad476dc941be5a9dff1e20402c3754 22-Dec-2016 Meng-hsuan Chung <menghsuan@google.com> Priority queue implementation

This is a first step to get the interface and behavior right.
Internally it's a linear array with O(N) push/pop.
The next step is to use heap with O(logN) complexity.

Change-Id: Icbe4842b8515c2fb95a4ec2388a8ecd4243967d2
hre/util/priority_queue.h
hre/util/priority_queue_impl.h
af8a810ee31e82fb1a5b18d3caef98633ba22799 22-Dec-2016 Andrew Rossignol <aarossig@google.com> Replaces std::lock_guard with chre::LockGuard.

Change-Id: Ie4987889f2b6ac2b9a6a87ceadc77a7382f31049
hre/util/blocking_queue_impl.h
hre/util/synchronized_memory_pool_impl.h
ac023ca930f64b385a77f89cb332e312f9b07362 22-Dec-2016 Andrew Rossignol <aarossig@google.com> Adds a LockGuard to util.

Change-Id: I1f58f2c71f4449ed05a9be45fc2ee0c9f5c4655f
hre/util/lock_guard.h
hre/util/lock_guard_impl.h
aab84350d333c03bc6d6e52841e291f66f8e0aae 21-Dec-2016 Andrew Rossignol <aarossig@google.com> Implements timers for the SLPI platform

Change-Id: I89207e07dcd0837bc632277c10eb9ebcad9b4274
hre/util/time.h
hre/util/time_impl.h
c85b8ca82e6d7f313d1aef0609eac687eb00d548 20-Dec-2016 Andrew Rossignol <aarossig@google.com> Moves platform ID constants to common, implements SLPI version

Adds an mk for the chre API.

Change-Id: I7e37b6fb0be4696f438e054b453b7e8e21b90a68
hre/util/id_from_string.h
hre/util/id_from_string_impl.h
926f1b91231f88c3669f10dec8f56e24ae16b957 21-Dec-2016 Andrew Rossignol <aarossig@google.com> Renames ASSERT to CHRE_ASSERT

- Provides a stub implementation for the SLPI.
- Avoids collision with Qualcomm ASSERT macros.

Change-Id: Ib6d99e41caf5cccf022fc8d88d2a05e95d2fd747
hre/util/array_queue_impl.h
hre/util/dynamic_vector_impl.h
hre/util/fixed_size_vector_impl.h
1ac3c0452b56dd51719e7d3f44efad3d0bc0116f 20-Dec-2016 Andrew Rossignol <aarossig@google.com> Implements SystemTime for the SLPI

- Adds mk files for core, util and platform
- Extends the search path for includes
- Requires an SLPI tree to build now (using SLPI-static image
functionality)

Change-Id: If83dece1dcf610c3c75bbc47204fcaafa8fd9801
hre/util/time.h
hre/util/time_impl.h
725bef45ca127971b3ea798cd1f4e4b2c0d8fe9d 10-Dec-2016 Andrew Rossignol <aarossig@google.com> Implements portions of the SystemTimer.

- Supports requesting a timer and delivering events.
- TimerHandle generation logic.
- Multiplexes multiple requests into one underlying timer.
- Adds a TimerWorld sample app to test cyclic and one-shot timers.

Change-Id: Id992790b49618f94ab2a7ce76098394e5cc161d4
hre/util/time.h
hre/util/time_impl.h
ea9fd91360a23da4652a5c51eb2e909ff765fe9e 12-Dec-2016 Andrew Rossignol <aarossig@google.com> Adds support for erase to DynamicVector and a test

Change-Id: I2de7cffed676e7e8db482873f3092c43dd1438b8
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
3fe2daaded2dc07da1175e3d5655d7dd956a0ba9 12-Dec-2016 Andrew Rossignol <aarossig@google.com> Adds support for insert to DynamicVector and tests

Change-Id: If5b2d2a413a0aa190fedc454099e67af698466c5
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
89aa0dd2e1f0a7cde9c6ec808f0cdcce33f35a62 12-Dec-2016 Andrew Rossignol <aarossig@google.com> Adds NonCopyable to containers.

Eventually we can implement copy, but we don't need it right now so it
is safer to mark it as unavailable.

Change-Id: Ie1d7f8a7ff1e5522baa227fca91b6d6ab14c9ccb
hre/util/array_queue.h
hre/util/dynamic_vector.h
hre/util/fixed_size_vector.h
0a28dc2f6cbe1c064d95f6ea88bce83401fd8607 15-Nov-2016 Meng-hsuan Chung <menghsuan@google.com> [ArrayQueue] a circular buffer based implementation

Change-Id: Icd5e8368ac6715e2b4c42dfd07f2ddd825059813
hre/util/array_queue.h
hre/util/array_queue_impl.h
3eaba1f8aa56dbc86fa8118d5314f97423cf5e84 08-Dec-2016 Andrew Rossignol <aarossig@google.com> Implements DynamicVector and adds tests

Change-Id: Ia27c6bce172c4f2b2a4d7db6378dc862a0644bf9
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
7bff27b2f4f5374a8f20a89b38067236535aa473 08-Dec-2016 Andrew Rossignol <aarossig@google.com> Documents the SystemTimer class, prefers Nanoseconds over uint64_t

- Adds a conversion from milliseconds to nanoseconds.
- Adds a little more documentation around the Linux implementation.
- The set function now accepts the callback and data to pass in to allow
reusing the same timer.

Change-Id: I4c17c96db3922b73e6675d5718a1ea55a13e4c37
hre/util/time.h
hre/util/time_impl.h
aa718a9536c0547620c183d90195bfb0f76f8284 08-Dec-2016 Andrew Rossignol <aarossig@google.com> Implements a platform abstraction for a condition variable

- Updates the blocking queue to use the new mutex and condition variable
abstractions.
- Removes noncopyable from the //util:util target due to a cyclic
dependency.

Change-Id: I97540b2322ff1492a4c3241b4984e4feb1a916f3
hre/util/blocking_queue.h
hre/util/blocking_queue_impl.h
f7914d0fbadf2644c0c4096380c741bee2a026e0 07-Dec-2016 Andrew Rossignol <aarossig@google.com> Implements the SynchronizedMemoryPool.

The event loop is updated to use the synchronized variant.

Change-Id: I23c493d5c79f1961e251d813c53a92b3ebdbdc3a
hre/util/synchronized_memory_pool.h
hre/util/synchronized_memory_pool_impl.h
a1d5686c7513f6b8a436efd9f554d8c2227a2291 07-Dec-2016 Brian Duddie <bduddie@google.com> Adds a platform abstraction for a mutex.

- Adds a SynchronizedMemoryPool shell.
- Includes SynchronizedMemoryPool in the EventLoop to verify
that compilation succeeds. The MemoryPool will eventually be replaced.

Change-Id: I932da11c303b5f757168d729f9c7a7874627cfb6
hre/util/synchronized_memory_pool.h
hre/util/synchronized_memory_pool_impl.h
4927ee586656424c827920876673228fbdcf27c3 25-Nov-2016 Andrew Rossignol <aarossig@google.com> Implements the MemoryPool and integrates with the EventLoop

Unit tests are also added to the MemoryPool.

Change-Id: Icaf521c9b683d9a21a73995f6ce4a70a5ed1e9f7
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
hre/util/memory_pool.h
hre/util/memory_pool_impl.h
736620171d63e1f0c0be70f9c27e2679fca5eaad 25-Nov-2016 Andrew Rossignol <aarossig@google.com> Adds a FixedSizeVector and tests.

This provides the same API as the DynamicVector but uses statically
allocated storage.

Change-Id: Ie26245ebf0bce8d924413ba80bbc1b392b5e3309
hre/util/fixed_size_vector.h
hre/util/fixed_size_vector_impl.h
e64f180233e64c40b56993cfea3696c5b4b16395 04-Nov-2016 Brian Duddie <bduddie@google.com> Initial import of CHRE source from external repo

Starting at commit 46a52e0 from contexthub-base.

Change-Id: I373f3a99b74757daae465b78a3d19bfce4770364
hre/util/array_queue.h
hre/util/blocking_queue.h
hre/util/dynamic_vector.h
hre/util/dynamic_vector_impl.h
hre/util/entry_points.h
hre/util/id_from_string.h
hre/util/id_from_string_impl.h
hre/util/non_copyable.h
hre/util/time.h
hre/util/time_impl.h