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

Timob 7565 - geolocation refactor #1622

Merged
merged 14 commits into from
Mar 14, 2012
Merged

Timob 7565 - geolocation refactor #1622

merged 14 commits into from
Mar 14, 2012

Conversation

rusticphilosopher
Copy link
Contributor

https://jira.appcelerator.org/browse/TIMOB-7565

also resolves:
https://jira.appcelerator.org/browse/TIMOB-7456
https://jira.appcelerator.org/browse/TIMOB-4779

Total refactor of Geolocation module (minus compass).

Testing instructions in ticket: https://jira.appcelerator.org/browse/TIMOB-7565

This is fairly localized but still a major change and requires KS geo pass, testing with app in ticket and ideally drillbit to safe on BOTH runtimes before this should be merged. This testing really needs to occur on a variety of devices.

** it might be easier to look at the raw files for the most part rather than the diff

/**
* GeolocationModule exposes all common methods and properties relating to geolocation behavior
* associated with Ti.Geolocation to the Titanium developer. Only cross platform API points should
* be exposed through this class as Android only API points or types should be put in a Android module
Copy link
Contributor

Choose a reason for hiding this comment

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

better "Android-only". I had to read that twice.

@rusticphilosopher
Copy link
Contributor Author

Currently updating behavior mode switching logic according to new developments.

@rusticphilosopher
Copy link
Contributor Author

Updated implementation, Jira ticket with test case and Geolocation spec linked from ticket.



/**
* Constructor
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure the description is really telling us anything we don't already know -- maybe overkill :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trying to be consistent. Every method should have a javadoc even if it's a placeholder IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

But why? If there isn't a description then you're not adding any value to the Javadoc

Copy link
Contributor

Choose a reason for hiding this comment

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

Why? If there isn't an actual description then what value are you adding to the Javadoc?

* @see org.appcelerator.kroll.KrollModule#propertyChanged(java.lang.String, java.lang.Object, java.lang.Object, org.appcelerator.kroll.KrollProxy)
*/
@Override
public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy)
Copy link
Contributor

Choose a reason for hiding this comment

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

This method is a little large -- do you think it would be better to break each property it's own method?

@marshall
Copy link
Contributor

Code review complete, please address comments.

There are a few other general comments I had:

  • We should probably always have spaces after if and switch statements (before the conditional)
  • There are many places where extra parentheses are used in conditionals that just don't make sense, for example when using a flag. We should probably avoid adding extra parentheses unless they're strictly necessary, they really clutter up the conditional

Opie Cyrus added 2 commits March 12, 2012 19:15
Conflicts:
	android/titanium/src/java/org/appcelerator/titanium/TiC.java
protected static final int MSG_ENABLE_LOCATION_PROVIDERS = KrollModule.MSG_LAST_ID + 100;
protected static final int MSG_LAST_ID = MSG_ENABLE_LOCATION_PROVIDERS;

private final String TAG = "GeolocationModule";
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like these were converted to instance a little overzealously .. this block of privates should probably be static (they are ALL_CAPS)

@marshall
Copy link
Contributor

Code review #2 complete, please address comments.

General notes:

  • There's still many places missing spaces between if and (
  • You converted a lot of static final constants with ALL_CAPS to instance variables, probably on accident :)

@marshall
Copy link
Contributor

Code review accepted

@nataliehuynh
Copy link
Contributor

Pull Request Accepted: Tested with v8/rhino on LG Slate 3.1 and Droid 2.2.2 with attached TC in bug and KS

@marshall
Copy link
Contributor

Functional review accepted.

Ran the test case in TIMOB-7565 on v8 and Rhino, and also verified the KS Geo test in v8 and Rhino on a Galaxy Nexus / 4.0.2.

Some notes:

  • We apparently have a long running bug with AndroidManifest.xml Geolocation permissions when just Ti.Geolocation.addEventListener is used in an app, I've filed a bug for that here:
    https://jira.appcelerator.org/browse/TIMOB-7984
  • When testing Geolocation, I noticed that KS has started crashing on exiting again recently. This regression is also happening in master, so shouldn't be caused by Opie's changes here. I've filed a bug for this here:
    https://jira.appcelerator.org/browse/TIMOB-7985

marshall added a commit that referenced this pull request Mar 14, 2012
Timob 7565 - geolocation refactor
@marshall marshall merged commit b54060e into tidev:master Mar 14, 2012
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

Successfully merging this pull request may close these issues.

4 participants