-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Beacon
data copy
#630
Merged
Merged
Commits on Dec 12, 2017
-
Include running average in Parcel data
This fixes a minor issue where the running average is not set after restoring a beacon from a parcel. Looking at the history it seems that the running average was an internal detail until #479 where support was added for running the service in a separate process. Part of the reason this needs to be included is that on Android 8.0 the running average _is_ restored and available for access. The reason the behavior is different across Android versions is in the way a service intent versus local notification handles the data `Bundle` (i.e. which [`Callback`](https://github.com/AltBeacon/android-beacon-library/blob/2.12.3/src/main/java/org/altbeacon/beacon/service/Callback.java#L58-L86) branch runs). Explicitly setting the `BeaconManager` to use scheduled scan jobs, forcing the first conditional code path using local notifications, allows the running average to be available on older versions.
Configuration menu - View commit details
-
Copy full SHA for 1f02531 - Browse repository at this point
Copy the full SHA 1f02531View commit details -
Add omitted fields in copy beacon constructor
It's unclear why `mManufacturer` wasn't included with the copy constructor originally. However, as it's an internal field which is also included in the serialization and parceling it probably should be copied here too. The `mMultiFrameBeacon` field was added later to provide better support for beacons with extra data packets (#387). It's likely this was just overlooked as most of the "copying" of beacons occurred through parceling at the time.
Configuration menu - View commit details
-
Copy full SHA for ec07eb4 - Browse repository at this point
Copy the full SHA ec07eb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29fd2ac - Browse repository at this point
Copy the full SHA 29fd2acView commit details -
Delegate
AltBeacon
constructors to parentIt's unclear from the history why only some of the fields are part of the `AltBeacon` constructor. When initially implemented the constructor omitted copying `mRunningAverageRssi` and `mManufacturer`. Since then several additional data fields were added which are also not in the `AltBeacon` constructor: - `mExtraDataFields` - `mServiceUuid` - `mBluetoothName` - `mParserIdentifier` - `mMultiFrameBeacon` The only real change in this subclass seems to be the additional custom getter `getMfgReserved`. Based on the fact that the parceling logic and the builder all delegate to `Beacon` it seems reasonable that the general intended logic was to wrap the parent class. This fixes the two constructors so that all setup is based on the `Beacon` implementation. This ensures that any changes in `Beacon` are reflected by `AltBeacon` as well.
Configuration menu - View commit details
-
Copy full SHA for 49df8a7 - Browse repository at this point
Copy the full SHA 49df8a7View commit details
Commits on Dec 15, 2017
-
Configuration menu - View commit details
-
Copy full SHA for d956b84 - Browse repository at this point
Copy the full SHA d956b84View commit details -
Configuration menu - View commit details
-
Copy full SHA for deaa42d - Browse repository at this point
Copy the full SHA deaa42dView commit details
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.