The metrics uploader used to be disabled for non-official images to
avoid polluting the production data with possibly wrong measurements.
This is inconvenient for developers as they can only be sure that a new
metric was added properly until the changes reached a product device.
Instead, this CL change the metrics daemon to upload metrics iff the
consent file exists.
To ensure that testing data does not pollute the production data, we set
the channel to UNKNOWN and the version to 0.0.0.0 when the image is not
official (implied by channel and version missing).
BUG: 22879597
Change-Id: If03847090b732cc06270cbcc8b386b5f9e544a3d
Fix some issues to get crash_reporter to compile on Android.
C++ source:
* bits/wordsize.h is used for __WORDSIZE, but is unavailable for most
Android toolchain architectures. It instead is available in sys/cdefs.h
Flex source:
* The Flex compiler toolchain doesn't link against the default fl library
using -lfl. Thus there is no yywrap() function defined. Since the
default fl library implementation just returns 1 (true), instead add a
directive to disable yywrap.
* The index(..) function has been deprecated in favor of strchr(..)
* Add a directive to disable the "deprecated conversion from string constant
to 'char*'" warning in the generated code.
* Remove warning suppression for the input() function which doesn't get
generated with Flex v2.5.39 and the arguments passed in the build command.
Bug: 22874187
Change-Id: I6d7dcf5f801010aeae06db9f0628a6652ee269ee
Removed the ChromeOS specific code so that the code compiles. The code
removed is not needed when running on Android, and includes:
* Chrome collector
* ChromeOS build's gyp file
* ChromeOS-specific DBus calls
* ChromeOS-specific collector path logic
* Chrome bypass logic in user collector
Bug: 22672752
Change-Id: I3c7d87c971a181d8f73293519318e3602d142927
Instead of hardcoding system specific constants (like path) in
every file, consolidate them into the constants.h.
BUG: 22879597
Change-Id: I615be017774db629bf43398db7f70e9ef7263a52
Previously, the action, command, and service structs contained char*s
that referenced memory within the buffer returned by the strdup() of
the input buffer of parse_config. This prevented this entire memory
region from being freed, leaking contents that would never be referenced again.
The changes to convert the previous action, command, and service
structs to C++ classes created explicit ownership of the contents within
each class in the form of std::strings. With these changes, there are
no remaining references to the memory allocated by this strdup(), which
can now be freed.
This commit replaces the strdup() with std::vector<char> to allow for
the copied string to be freed when it goes out of scope instead of
relying on the C strdup() and free() functions.
Change-Id: Id0a5f711e33363082ba201afda6b26043998cb1c
Android does not use some of the original mechanisms available in Chrome
OS, so simplify the code by removing them.
BUG: 22879597
Change-Id: I25d71f464cb99d4ca51eab758695fcd59c1d2f3d
The statistics collected might not be correct on android.
We should make sure that the values reported have the right meaning.
BUG: 22879597
BUG: 22953719
Change-Id: I9fb066333a07f43096bd54a16fcc83816248cc29
The win32 version of 9f2d1a9cfc. The big
technique is to fit a Win32 HANDLE value in an int because it only uses
32-bits. This allows most of the other adb code to stay the same.
Also, fix a regression in the 'adb server nodaemon' command that was
erroneously returning an error when --reply-fd was not used, which
should not be necessary for this particular command.
Change-Id: I37e9c609014b813af93bf0d6c12f665b59c93c41
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
Android does not have any policy file. Instead, rely only on the
existence of the consent file to determine whether the metrics are
enabled or not.
BUG: 22879597
Change-Id: I7e628f09d623c97b9bab3a490a636db873230817
This CL fixes the import path to match the Android format.
The libmetrics headers were also moved to include/metrics to make
exporting headers cleaner.
BUG: 22879597
Change-Id: I67d1ac1746cc3560ae4cbddecf97fa48c9dd1480
When "adb start-server" is issued, and a server needs to be launched,
adb client forks itself and the child process runs the server routine.
Once the server initializes its various components, it sends an "OK\n"
back to the client via its stderror (or stdout on Windows).
This sequence breaks down if before sending the "OK\n", the server
happens to log something on its stderr. In order to avoid this, the
client now expects the ack to come on a different fd rather than one
of the standard streams.
Bug: https://code.google.com/p/android/issues/detail?id=182150
Change-Id: I9d58a08068d71eb3b77e8a7377e934631c016466
- My recent change with -DUNICODE=1 required changing
GetProfilesDirectory() to GetProfilesDirectoryA() for the ANSI version
of the API.
- enh's edit to my previous change deleted a test that used
/proc/version, but I think another test was missed. Merge that test into
another.
Change-Id: Ic748549848e7be922bcbf218d5b0c3fca2a90704
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
The original code was:
if (strcmp(__adb_error, "unknown host service") != 0)
But that was changed by 078f0fcf4c to:
if (*error == "unknown host service") {
I think the comparison should be != so that "unknown host service"
falls-through and kills the server, and so if it is some other error,
that the other error is returned immediately.
Change-Id: Ia490a4a870d1d123a3c5ab258dd5fa0930e8032d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
This CL adds --apk-dir option, which specifies the directory
that contains APK files to be installed before measuring
boot time.
BUG: 22207911
Change-Id: Ifeacf34c779248686443a9ef02485272c140a456
'sf_stop_bootanim' is useful for tracking the time wasted by
showing the 'outro' part of the boot animation.
'wm_boot_animation_done' is also useful for tracking user
perceived boot time.
(cherry-pick of cbcf2778c3)
Bug: 22207911
Change-Id: I3549338a2161fa29675993c239f57809270797f8
system.img may contain the root directory as well. In that case, we
need to create some symlinks init.rc would during the build.
Change-Id: I4e7726f38c0f9cd9846c761fad1446738edb52c0