4.8.1.beta - #66
Open
va13k wants to merge 171 commits into
Open
Conversation
# Conflicts: # CHANGES.txt # build.gradle
# Conflicts: # CHANGES.txt # build.gradle
…idge Code updated: aware log messages
…idge 4.1.5.light.bundle APK files
…cessibility enable This commit addresses two issues in the screen text sensor: 1. The screen text sensor now correctly collects duplicate text when the foreground app changes. This ensures that screen text is captured during app switches, home screen access, and notification checks. 2. A crash that occurred when enabling accessibility before starting a study has been fixed. The issue was caused by attempting to parse an empty string for the package specification criteria. A default value is now used, and a try-catch block has been added to handle potential NumberFormatExceptions.
change ":com.aware.plugin.studentlife.audio" into ':com.aware.plugin.studentlife.audio_final'
Resolved an issue where the text buffer was incorrectly reset upon every foreground app change, leading to potential loss of relevant data. Introduced a new buffer, textBuffer_app_change, dedicated to managing text hashes specifically during app transitions.
- Replace ArrayList with HashSet for textBuffer to improve duplicate check performance - Streamline contentBuffer flushing and handling logic to commit changes specifically on app change
…ixed-code Fix/update fixed code
Merge Beta function to main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
4.8.1.beta — Changes
(4.8.0.beta)
Scope
This branch collects the changes needed before the client could be used for an actual study. The previous state did not prevent the app from running; it prevented a study from producing trustworthy data, which is a different and harder problem to notice.
Three groups of change are included:
The common property of the first group is worth stating, because it determined where the effort went: these failures were silent. The app reported itself healthy throughout. They were found by comparing what a device had stored against what it claimed, not by using the app.
Status
Collection and delivery are substantially more reliable than before, and the failure modes that remain are documented rather than unknown. The work is not finished. The most significant outstanding items are architectural rather than incidental:
/proc/stat, which Android has restricted since version 7, so it cannot collect on any currently supported device. It is disabled rather than removed, and still reports itself as active when started.Principal Changes
Grouped by what they affect. Detail for each is in the sections below.
Collection and delivery correctness
Configuration
Participant-facing
Upload path
Data model
Security
General fixes
Server-Side Prerequisites
Two columns must exist in the research database before this build is installed. The client writes both, and MySQL rejects an insert naming a column the table does not have — which fails the entire batch for that table, so
aware_logandaware_studieswould stop uploading until the columns exist.Both statements are backwards compatible: the columns are nullable with defaults, so a device still running an earlier build continues to upload normally. Applying them ahead of the app update is therefore the safe order, and no coordinated downtime is needed.
These belong with the rest of the research-database schema in the companion dashboard project, va13k/aware_dashboard.
No further server columns are needed. The per-sensor delivery state introduced here is held on the device only — the client's account has
INSERTonly and could not maintain mutable remote status, so what the researcher sees arrives throughaware_log, which already uploads.One column to verify rather than add:
bluetooth.bt_statusshipped with 4.8.0.beta, but a research database that predates it and was never migrated will reject everybluetoothinsert. That is not hypothetical — it silently discarded two hours of Bluetooth data on a live study, because a single table's upload failure was masked by the other tables succeeding. Confirm the column exists before enrolling devices:Two further server-side notes, neither of which blocks installation:
innodb_flush_log_at_trx_commitis1. Both are required for the all-or-nothing upload batches described below to mean anything: MyISAM accepts a transaction and ignores it.INSERTonly. AnySELECTorUPDATEgranted to it is unused by the app — every read and update the client performs is against its own on-device database.Silent Failures Found and Fixed
dumpsysshowed the service running and the log readLocation tracking with GPS is active: 30s. The GPS, network and passive providers are cancelled when the sensor restarts, but the static frequencies that guard re-registration were not reset, so the restarted sensor saw "no change" and registered nothing. Verified on a device: before the fix, zero rows in 100 seconds after a restart; after it, five rows at exactly the configured 30-second interval.researcher diagnostics now count delivered data as data the sensor collected.
Sensitivity Thresholds
A sensitivity threshold is a change filter: a reading is stored only when it differs from the last
stored reading by at least the threshold, in the sensor's own native unit, and on the three-axis
sensors only when every axis is within it. Entering it as a bare number invited values no sensor can
produce — a deployed study configuration carried
threshold_accelerometer: 120m/s² andthreshold_magnetometer: 1000000µT, which filter out every sample and leave the sensor silent whileit still reports itself as enabled.
µT, hPa, lux, °C — each naming what it keeps and what it drops, and anchored to published
smartphone sensor-noise figures rather than an arbitrary scale.
set that way is reported as collecting nothing rather than displayed as a bare number.
states and only on change — there is nothing in between for a threshold to remove.
coarse light threshold is defensible where a coarse motion threshold is not.
The same presets were added to the study Configurator, since that is where the values are authored.
Permissions and Study Consent
Permission and consent requests now follow the sensors a study actually needs instead of presenting every possible request at startup.
READ_CONTACTSrequest.GET_ACCOUNTShandling so it is requested only on Android versions where the legacy sync framework requires it.Editable and Locked Study Modes
Researchers continue to control whether participants may edit study settings through
enable_config_update.Locked mode
Editable mode
Manual study updates
Sensor Availability and Collection Status
The interface now distinguishes configuration state from actual data collection.
Frequency and Sampling Settings
Frequency-Aware Sensor Health
sensor_statusrecords toaware_log.diagnostics, so they can be selected without matching message text — which requires thelog_typecolumn from Server-Side Prerequisites.Study Join, Information, Update, and Leave
Joining a study
Study database password
Leaving a study
quit studyexit record rather than waiting for every provider to finish a full synchronization.Data Upload and Delivery
The connection to the research database, and the batches sent over it, were reworked so that a delivery either happens or is retried cleanly.
require_sslfield in a study configuration was never read by the app; the connection is now configured explicitly rather than relying on a driver default.FAILED to sync. Server down?no longer names a cause it cannot know. Failures report the batch's row count and size and defer to the connection log.Data Model and Schema
The device, study, and log tables were reviewed column by column against what they actually record. No sensor table changed.
Device information
aware_deviceis now one row per device, rewritten in place when the device's facts change and carrying the time of that change. The table has always permitted a single row per device, so the previous attempt to add a row for a changed device was silently discarded — meaning an Android upgrade was detected, dropped, and re-detected on every service start, and never reached the server.useron every production device; the device label, which was never populated; and the brand, which restates the manufacturer.board,device, andproductwere kept.Study records
aware_studiesrecords when a configuration was last replaced, on all three paths that can replace one: a server update, a plugin difference reconciled on the device, and a participant edit in editable mode.Study log
lifecycle,scheduler,sync,study,diagnostics,context, orevent. The message column previously held every kind of record as free text, so counting app restarts meant matching a literal string, and the vocabulary could only be discovered by reading the client source.event.On-device database upgrade
Network Traffic Collection
TrafficStatssampling.frequency_network_traffic.Bluetooth Data and Reliability
Background Collection Notice
Background Work and Battery
Interface Responsiveness and Consistency
onContentChanged()calls where preference setters already notify their own rows.status_*settings belong to the same category.setShouldDisableView()state is not written repeatedly.Plugin Stability
Security
awareframework.comwhenever a device was first recorded. It had no setting in front of it, unlike the separate usage-donation ping, which remains gated and is still worth a deliberate decision against the study's ethics approval.INSERTonly; nothing in the app reads or updates the research database.Build, Dependencies, and Release Automation
_IDdeclaration.Researcher and Data Impact
aware_log, which gains one column this release.aware_studiesrecord with an exit timestamp andstudy_compliance = "quit study". When the database could not be reached at the moment of withdrawal, the record instead readsquit study (server unreachable, not notified), so a withdrawal the researcher was never told about is distinguishable from one that was reported.aware_devicebecomes a device dimension rather than a stream: one row per device, plus a row for each genuine hardware or Android change. Queries that counted rows in this table as a proxy for app restarts should readaware_logentries of kindlifecycleinstead, which is the correct source and was always uploaded.aware_deviceare left as they are. A view selecting the most recent row per device presents the table consistently across the change, and is worth keeping permanently so that analysis depends on a stated contract rather than on row counts.aware_loggainslog_type, making it possible to select or aggregate a kind of entry without matching message text.aware_studiesgainsdouble_updatedand explicitjoined studyandrejoined studycompliance values. The study configuration now appears on the records where it changed; the configuration in force at a given moment is the most recent one at or before that moment.aware_studiesandaware_deviceon every synchronization, because the records tracking upload progress were removed by the log's own cleanup. Historical duplicates remain and are byte-identical, so they can be collapsed ondevice_idandtimestampwithout losing anything.Tests and Validation
Architectural — needs a decision and a plan
Replace direct database access with HTTP(S) to the micro-server. The client currently opens a JDBC
connection to MySQL and inserts rows directly. The intended direction is an HTTP(S) endpoint on the
companion micro-server, authenticated with a per-participant token. This is the single change that
would resolve the most limitations at once:
valid for all of them and cannot be revoked individually
itself fetched over plain HTTP where a study is hosted that way — so a fetch that can be altered in
transit undermines the verification it delivers
thread-safe; roughly 30 sync adapters take turns on it
INSERT-only, which is correct for a shared credential but means the clientcannot maintain any state server-side, and cannot remove rows it duplicated in the past
Revise the screenshot sensor. Its upload is bounded by payload size, but its on-device storage is
not, and it is by a wide margin the highest-volume sensor in the app — measured at roughly 69 MB/hour
while uploads could not keep up. If storage fills, collection stops for every sensor, not just this
one. It is currently left enabled by decision. A cap, a retention policy, or a resolution/interval
reduction all need considering together.
Remove the Processor sensor. It reads
/proc/stat, which Android has restricted since version 7,returning
Permission denied. It cannot collect on any currently supported device. It is disabledrather than removed, and still logs itself as active when started, which is misleading.
Decide the local-cleanup floor. Uploads are floored at the newest study record's timestamp, while
the local cleanup that follows a successful upload is not floored at all. Rows below the floor are
therefore skipped by every batch and then removed — observed on a device as 26 location rows deleted
without having been uploaded. The window is one sync interval and it opens on each configuration
update. The choice is whether the floor should be the participant's original enrolment rather than the
newest configuration change; a configuration change is arguably not a new enrolment.
Serve study configurations over HTTPS. Outside this branch, but it is what makes the certificate
authority delivered in that configuration trustworthy.
Verification still owed
single table fails while the others succeed, which is the case it exists for. Reproducing it needs
one table's schema broken server-side deliberately.
refuses connections, which already failed fast; the case that needed fixing is a server that accepts
a connection and then goes quiet, which needs the port dropped rather than closed.
Barometer and ambient temperature could not be tested — neither available device has that hardware.
configuration while the database is down are implemented but not yet walked through on a device.
Platform constraints, not defects
Recording these because each one was initially mistaken for a fault during this work.
intervals at 15 minutes, so any
frequency_webservicebelow 15 behaves identically to 15. Thesetting should be written as 15 or more so it states what actually happens. Data accumulates for up
to one interval before delivery — for a high-rate sensor such as the magnetometer that is tens of
thousands of rows per cycle, which is expected rather than a backlog. Manual synchronisation is
unaffected, as it is not a periodic request.
and it means a configuration enabling ten hardware sensors can legitimately produce data for fewer.
An empty table is therefore not by itself evidence of a fault: establish whether the hardware exists
first. Neither available device had a barometer or ambient-temperature sensor; one had no gyroscope
or magnetometer either.
states, so a stationary device produces nothing.
available devices. Whether this is Android's background sensor throttling, the service's own
batching, or the platform not honouring the requested period is not established. It does not affect
correctness, but analysis should not assume the configured rate.
Carried over from earlier releases
aware_deviceandaware_studiesthat were duplicated by the previous upload-progress behaviour remain in the research database. They are byte-identical and can be collapsed; an insert-only client cannot remove them.