Skip to content

Start safe ID at non-default value for getSafeAutoManageId #578

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

Merged
merged 6 commits into from
Feb 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* A {@link Task} based wrapper to get a connect {@link GoogleApiClient}.
*/
public abstract class GoogleApiHelper implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
private static final AtomicInteger SAFE_ID = new AtomicInteger(0);
private static final AtomicInteger SAFE_ID = new AtomicInteger(10);

protected GoogleApiClient mClient;
private TaskCompletionSource<Bundle> mGoogleApiConnectionTask = new TaskCompletionSource<>();
Expand All @@ -32,6 +32,10 @@ protected GoogleApiHelper(FragmentActivity activity, GoogleApiClient.Builder bui
mClient = builder.build();
}

/**
* @return a safe id for {@link GoogleApiClient.Builder#enableAutoManage(FragmentActivity, int,
* GoogleApiClient.OnConnectionFailedListener)}
*/
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any objections to leaving the documentation?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope documentation is always good

public static int getSafeAutoManageId() {
return SAFE_ID.getAndIncrement();
}
Expand Down