Skip to content
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

Handler instances using deprecated constructors #1696

Closed
joeygrover opened this issue May 25, 2021 · 1 comment
Closed

Handler instances using deprecated constructors #1696

joeygrover opened this issue May 25, 2021 · 1 comment
Labels
android Relating to the android part of the library bug A defect in the library

Comments

@joeygrover
Copy link
Member

Bug Report

As of Android SDK 30 the no parameter and callback constructors of the Handler class were deprecated. Now a Looper instance is required to be passed. The library uses the default,no param constructor in most cases.

See here: https://developer.android.com/reference/android/os/Handler#Handler()

Expected Behavior

The library does not use deprecated methods from the Android API.

Observed Behavior

The library uses deprecated constroctures for Handler instances

OS & Version Information
  • Android Version: SDK 30
  • SDL Android Version: 5.1.1
Test Case, Sample Code, and / or Example App
Two solutions are possible:

Update handler constructors

Handler handler = new Handler();

Needs to be replaced with

Handler handler = new Handler(Looper.getMainLooper());

Switch to using TaskMaster

Replace Handler with a queue from task master and create tasks to be used. This solution will not work in the cases where a Handler is passed to a Messenger instance, for example the binding between TransportBroker and SdlRouterService .

@joeygrover joeygrover added android Relating to the android part of the library bug A defect in the library labels May 25, 2021
@JulianKast
Copy link
Contributor

Closed via #1726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Relating to the android part of the library bug A defect in the library
Projects
None yet
Development

No branches or pull requests

2 participants