Commit Graph

4 Commits

Author SHA1 Message Date
Robert Ancell
cf4dace52b
Fix crash in Linux platform channel example. (#155735)
When running this example it was crashing, so investigated a fixed a
couple of bugs.
2024-10-01 13:09:49 +13:00
Chris Bracken
be9dbfa994
[Linux] Use up_client_get_devices2 when possible (#127699)
The Linux platform channels sample makes a call to the libupower function `up_client_get_devices`, which was deprecated in libupower 0.99.8 in favour of `up_client_get_devices2`.

In order to build both for users on older versions of libupower, such as 0.99.7, which ships with Ubuntu 18.04 (Bionic), as well as users on newer versions where `up_client_get_devices` is deprecated, this adds a preprocessor check and selects the function available on the host system on which the build takes place.

The Flutter devicelab prod bots have been migrated to Ubuntu 20.04 LTS (Focal) which includes 0.99.11, but the trybots are still in the process of being migrated. This allows the build to work on both, and makes life easier for users running on a variety of Linux distributions.

No tests are added or modified since `up_client_get_devices` and `up_client_get_devices2` have the same semantics.

See: https://upower.freedesktop.org/docs/UpClient.html#up-client-get-devices
See: https://gitlab.freedesktop.org/upower/upower/-/blob/master/libupower-glib/up-version.h.in

Note: the `UP_CHECK_VERSION` macro has been around since 2010 (13 years ago), when DKP was forked into libupower. 27fada20be

Issue: https://github.com/flutter/flutter/issues/127611
2023-05-26 19:19:04 +00:00
Chris Bracken
edf4a91f5f
[Linux] Ignore deprecation of libupower call in example (#127503)
The Linux platform channels sample makes a call to the libupower
function `up_client_get_devices`, which was deprecated in libupower
0.99.8 in favour of `up_client_get_devices2`.

The prod bots have been migrated to focal, which ships libupower 0.99.11
in which the old function is deprecated and the new one is available.

The try bots have not yet been migrated and remain on bionic, which
ships libupower 0.99.7 in which the old function is not deprecated and
the new one is not available.

This marks the line in question to ignore deprecation warnings. Once all
bots have migrated to focal, we'll migrate to the new function. See
tracking issue below.

See:
https://upower.freedesktop.org/docs/UpClient.html#up-client-get-devices

Issue: https://github.com/flutter/flutter/issues/127506

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-05-24 11:44:05 -07:00
Robert Ancell
7b458e5af1
Implement Linux part of examples (#108068)
Add Linux files for hello_world and platform_channel examples
2022-12-08 08:44:11 +13:00