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

ScreenManager does not call completion listener if TextAndGraphicManager is not dirty #930

Closed
PoisonousJohn opened this issue Nov 26, 2018 · 0 comments

Comments

@PoisonousJohn
Copy link

PoisonousJohn commented Nov 26, 2018

Bug Report

I had a bug in my app which fired multiple RPCs to update UI via ScreenManager.
I've spent a day debugging the case, and find out that ScreenManager.commit callback was not fired.

Digging down showed it was due to TextAndGraphicManager.isDirty is false, thus the following code would not invoke listener.

		softButtonManager.update(new CompletionListener() {
			boolean updateSuccessful = true;
			@Override
			public void onComplete(boolean success) {
				if (!success){
					updateSuccessful = false;
				}
				textAndGraphicManager.setBatchUpdates(false);
				textAndGraphicManager.update(new CompletionListener() {
					@Override
					public void onComplete(boolean success) {
                                                  // this method is never called
						if (!success){
							updateSuccessful = false;
						}
						listener.onComplete(updateSuccessful);
					}
				});
			}
		});
Reproduction Steps

Not sure about exact steps but try the following.

  1. update some ui using ScreenManager
  2. Invoke setSoftButtons() right inside ScreenManager.commit()
  3. Repeat the same operation immediately
Expected Behavior

ScreenManager.commit callback should be called

Observed Behavior

ScreenManager.commit callback is never called for the second request.

OS & Version Information
  • Android Version: 9
  • SDL Android Version: implementation 'com.smartdevicelink:sdl_android:4.+'
  • Testing Against: Emulator
Test Case, Sample Code, and / or Example App
            getManager().getScreenManager().beginTransaction();
            interfaceChanger.run();
            getManager().getScreenManager().commit(success -> {
                  // here I call set soft buttons
                  // then I start the same process again
            });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants