GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bugfixes for older versions of Android by amandle · Pull Request #382 · firebase/FirebaseUI-Android

Conversation

@amandle

@amandle amandle commented Oct 27, 2016

Copy link
Copy Markdown
Contributor

I did some testing on an older android device (4.4) with lower memory and uncovered a couple issues.

  • The SmartLock fragment has to be added in onCreate otherwise the activity may be destroyed before it attaches (like when it gets backgrounded by the Facebook sign in on a low-memory device)
  • Moving the SmartLock.getInstance to onCreate required me to rework the SmartLock testing procedure, since it relied on being able to intercept the call after onCreate was finished.
  • On the 4.4 device the GoogleApiClient was not connecting even though enableAutoManage was called. Explicitly calling connect fixed this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Aaron Mandle added 2 commits October 26, 2016 15:59
Aaron Mandle
Fixes for older Android devices
cba0256
Aaron Mandle
fix/rework SmartLock tests
5aadcec
samtstern
samtstern reviewed Oct 28, 2016
View reviewed changes

@samtstern samtstern left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments but LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/ui/ActivityHelper.java
}

public SmartLock getSmartLockInstance(AppCompatBase activity, String tag) {
return SmartLock.getInstance(activity, tag);

@samtstern samtstern Oct 28, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this method do anything besides pass through? Seems like we could just use the static method.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@amandle amandle Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just passes through. As you noted below, this makes shadowing it possible.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/util/SmartLock.java
.addApi(Auth.CREDENTIALS_API)
.enableAutoManage(activity, this)
.build();
mCredentialsApiClient.connect();

@samtstern samtstern Oct 28, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing wrong with this but the fact that you had to do it is concerning. If you can reliably reproduce a situation where this is critical could you file a bug and tell the Gms client folks about it?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@amandle amandle Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll see if I can isolate it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/util/SmartLock.java
try {
ft.add(result, tag).disallowAddToBackStack().commit();
} catch (IllegalStateException e) {
Log.e(TAG, "Can not add fragment", e);

@samtstern samtstern Oct 28, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case should we return null or propagate the error somehow?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@amandle amandle Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to return null, and updated the usage to check for null.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/test/java/com/firebase/ui/auth/test_helpers/ActivityHelperShadow.java
return credentialsApi;
}

@Implementation

@samtstern samtstern Oct 28, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think I see why you implemented this method, is it just so you can shadow it easily?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Aaron Mandle added 3 commits October 28, 2016 13:41
Aaron Mandle
review feedback
068dd6e
Aaron Mandle
Fix tests
9f34960
Aaron Mandle
fix more tests
1b5e6c0
@amandle
amandle merged commit f9d4ab6 into firebase:version-1.0.0-dev Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@samtstern samtstern samtstern left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@amandle @samtstern
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.