Closed
Bug 880118
Opened 11 years ago
Closed 11 years ago
Package Gecko and GeckoView into an Android library project
Categories
(Core Graveyard :: Embedding: GRE Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla26
People
(Reporter: mfinkle, Assigned: stully)
References
Details
Attachments
(8 files, 20 obsolete files)
(deleted),
patch
|
cpeterson
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
cpeterson
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
blassey
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
cpeterson
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
cpeterson
:
review+
mfinkle
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
kats
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
Being able to create a standalone JAR package for Gecko and GeckoView will allow other Android developers to use GeckoView in their applications.
Comment 1•11 years ago
|
||
Bug 873569 is for moving Gecko assets (like libs, and omnijar) into the assets/ folder of the APK.
Depends on: 873569
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → stully
Summary: Package Gecko and GeckoView into a reusable JAR → Package Gecko and GeckoView into an Android library project
Assignee | ||
Comment 2•11 years ago
|
||
Temporary script for copying built JARs, SOs, omni.ja, and resources to library project directory.
Assignee | ||
Comment 3•11 years ago
|
||
Temporary patch to add option to GeckoView to open a URL in a new thread
Assignee | ||
Comment 4•11 years ago
|
||
Changes resources to non-constant IDs which is necessary for library projects.
Assignee | ||
Comment 5•11 years ago
|
||
WIP patch to adapt GeckoView to run without having control over an Activity
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #787230 -
Attachment is obsolete: true
Assignee | ||
Comment 7•11 years ago
|
||
updated patches for allowing a page to load :)
Attachment #787235 -
Attachment is obsolete: true
Assignee | ||
Comment 8•11 years ago
|
||
Change resources to non-static variables which is necessary for a library project.
Attachment #787233 -
Attachment is obsolete: true
Attachment #789771 -
Flags: review?(cpeterson)
Assignee | ||
Comment 9•11 years ago
|
||
Comment on attachment 787232 [details] [diff] [review]
add-new-tab-option.diff
I know this was patch was rejected in another bug, but it is necessary to get a page to load in GeckoView. Until a proper GeckoView interface is defined, this will at least allow a page to be loaded.
Attachment #787232 -
Flags: review?(cpeterson)
Comment 10•11 years ago
|
||
Comment on attachment 787232 [details] [diff] [review]
add-new-tab-option.diff
Review of attachment 787232 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/GeckoView.java
@@ +76,4 @@
> }
>
> + public void loadUrl(String uri, boolean openInNewTab) {
> + Tabs.getInstance().loadUrl(uri, (openInNewTab ? Tabs.LOADURL_NEW_TAB : Tabs.LOADURL_NONE));
Boolean parameters are often a short-sighted design and obscure the caller code. I would much prefer this new method be named loadUrlInNewTab() or take a LOADURL flags parameter. Taking a flags parameter might be a better design because it emphasizes that this method is simply a pass-through to Tab.getInstance().
Attachment #787232 -
Flags: review?(cpeterson) → feedback+
Assignee | ||
Comment 11•11 years ago
|
||
Changed to "loadUrlInNewTab" because changing to expose the flags variable means having to expose the Tabs flags to the 3rd party app using the library. While this is temporary anyway, it seems better to hide this info for now until the GeckoView interface is hashed out.
Attachment #787232 -
Attachment is obsolete: true
Attachment #789798 -
Flags: review?(cpeterson)
Comment 12•11 years ago
|
||
Comment on attachment 789798 [details] [diff] [review]
add-new-tab-option.diff
Review of attachment 789798 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM!
Attachment #789798 -
Flags: review?(cpeterson) → review+
Comment 13•11 years ago
|
||
Comment on attachment 789771 [details] [diff] [review]
constant-id.diff
Review of attachment 789771 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM, but I think you should simplify these long chains of `if/else` statements to just a sequence of `if` statements than each call `return`. You can then add an empty line between each `if` block to make these long methods easier to read.
Attachment #789771 -
Flags: review?(cpeterson) → feedback+
Assignee | ||
Comment 14•11 years ago
|
||
Attachment #789771 -
Attachment is obsolete: true
Attachment #789893 -
Flags: review?(cpeterson)
Assignee | ||
Comment 15•11 years ago
|
||
Attachment #789893 -
Attachment is obsolete: true
Attachment #789893 -
Flags: review?(cpeterson)
Attachment #789898 -
Flags: review?(cpeterson)
Comment 16•11 years ago
|
||
Comment on attachment 789898 [details] [diff] [review]
constant-id.diff
Review of attachment 789898 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM!
::: mobile/android/base/BrowserApp.java
@@ +1728,2 @@
>
> + int itemId = item.getItemId();
Please make this itemId `final` like you did in the other methods.
Attachment #789898 -
Flags: review?(cpeterson) → review+
Comment 17•11 years ago
|
||
add-new-tab-option.diff:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d17e4a0cba94
constant-id.diff:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a3cc1c802366
Status: NEW → ASSIGNED
Whiteboard: [leave open]
Updated•11 years ago
|
OS: Linux → Android
Hardware: x86_64 → All
Reporter | ||
Comment 18•11 years ago
|
||
Comment on attachment 789898 [details] [diff] [review]
constant-id.diff
Holy cow. This patch will be very unpopular.
What's the issue here?
Assignee | ||
Comment 19•11 years ago
|
||
A library project cannot have its resource IDs in R.java be static which means they can't be used as case labels. Otherwise, all the resources will be null.
Comment 20•11 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #18)
> Comment on attachment 789898 [details] [diff] [review]
> constant-id.diff
>
> Holy cow. This patch will be very unpopular.
>
> What's the issue here?
Reading between the lines, stully is discovering that we strongly enforce having only one set of Android resource IDs and therefore only one R.java. You probably recall fighting with Sync to get the resources to work (or perhaps rnewman did that all): at that time, there was less support for having multiple resource sets that got merged together.
It is a longer term project to make Fennec build better with multiple resource sets, like what stully is hacking in here. This shouldn't land as it is but is useful experimentation.
Assignee | ||
Comment 21•11 years ago
|
||
> A library project cannot have its resource IDs in R.java be static which means they can't be used as case labels. Otherwise, all the resources will be null.
Correction, they cannot be final; static is okay.
Assignee | ||
Comment 22•11 years ago
|
||
> It is a longer term project to make Fennec build better with multiple resource sets, like what stully is hacking in here. This shouldn't land as it is but is useful experimentation.
The problem isn't multiple resource sets. By default, resource IDs are static final ints. The value of a static final int will be inlined into the bytecode. This means that the memory location this int points to is going to be invalid when the classes are used in a library project. The solution to this is to make the resource IDs non-final at the cost of not being able to use them as case labels.
If you want to keep them as final, every single resource reference in the code will be to be gotten by "getResources().getIdentifier(...)" which is much worse than just making the resource IDs non-final. Given the relatively small number of places in our code that resources are used as case labels, it seemed this was the lesser of two evils.
The only other option is to have two versions of each file that uses resources IDs as case lebels, one with a case structure and one with an if-else structure. This idea, obviously, shouldn't even be entertained.
Reporter | ||
Comment 23•11 years ago
|
||
More info:
http://tools.android.com/tips/non-constant-fields
Based on this, I think we'll need to move away from switch statements and use ugly if/else blocks.
BTW, I was able to get Fennec building with multiple resource sets in bug 901803 (the first obsoleted Cast SDK patch).
Comment 24•11 years ago
|
||
Flags: in-testsuite-
Comment 25•11 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #20)
> It is a longer term project to make Fennec build better with multiple
> resource sets, like what stully is hacking in here. This shouldn't land as
> it is but is useful experimentation.
oops. I already landed the non-final resource ID patch yesterday. Should I back it out?
Flags: needinfo?(nalexander)
Comment 26•11 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #25)
> (In reply to Nick Alexander :nalexander from comment #20)
> > It is a longer term project to make Fennec build better with multiple
> > resource sets, like what stully is hacking in here. This shouldn't land as
> > it is but is useful experimentation.
>
> oops. I already landed the non-final resource ID patch yesterday. Should I
> back it out?
Nah, let it ride. I'm not thrilled about having Makefile.in changes land without build peer review and I'm with blassey on not liking the if/elif chains, but no sense churning for churns sake.
Flags: needinfo?(nalexander)
Assignee | ||
Comment 27•11 years ago
|
||
Everything needed to create zip files ready to be dropped into Eclipse for using GeckoView in a third party app.
Attachment #787810 -
Attachment is obsolete: true
Attachment #790961 -
Flags: feedback?(nalexander)
Comment 28•11 years ago
|
||
Comment on attachment 790961 [details] [diff] [review]
add-library-project-directory.diff
Review of attachment 790961 [details] [diff] [review]:
-----------------------------------------------------------------
This is moving in a good direction, but since there's no *build* per se (except moving some files -- keep that in the new Makefile.in), I'd like to see all of the zip/libs/assets logic moved into packager.mk. There'll be fewer gnarly ../.. chains. Also, prefer listing explicit files to update the zip with rather than globbing. Lists are good! Make sure to think about armv7/armv6/x86 too.
::: mobile/android/geckoview_library/.classpath
@@ +4,5 @@
> + <classpathentry kind="src" path="gen"/>
> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
> + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES">
> + <attributes>
> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="geckoview_library/libs/armeabi-v7a"/>
x86? ARMv6? And how do the Fennec libraries (some of which are native) fit in here? I'm not thrilled with shipping a .classpath, but I'm not clear on how you intend this to be used.
::: mobile/android/geckoview_library/Makefile.in
@@ +10,5 @@
> +include $(DEPTH)/config/autoconf.mk
> +
> +INSTALL_TARGETS += GECKOVIEW_LIBRARY
> +GECKOVIEW_LIBRARY_DEST = $(CURDIR)
> +GECKOVIEW_LIBRARY_FILES := AndroidManifest.xml \
nit: := \
\tfile1 \
\tfile2 \
@@ +25,5 @@
> + # Make empty directories to fit an Android project structure
> + mkdir -p bin gen libs/armeabi-v7a src
> +
> + # JARs
> + mv ../base/jars/* libs/
This will bust the previously built parts of the objdir. You can $(CP), but I think you might want to do this whole business in packager.mk.
@@ +28,5 @@
> + # JARs
> + mv ../base/jars/* libs/
> +
> + # Mozglue (this should be in a directory named 'libs', not 'lib')
> + cp ../../../dist/bin/libmozglue.so libs/armeabi-v7a/
Again, x86/armv6. We have fu to deal with this in packager.mk; you might need to extract a better framework.
@@ +40,5 @@
> + cd ..; \
> + zip -r ../../dist/geckoview_library/geckoview_library.zip geckoview_library
> +
> + # The makefiles shouldn't be included in the zip
> + zip -d ../../../dist/geckoview_library/geckoview_library.zip geckoview_library/backend.mk geckoview_library/Makefile
What is going into this? Is it just a few static files (listed above) and then some of the jars and libs built above? If so, we should be doing this all in packager.mk.
@@ +43,5 @@
> + # The makefiles shouldn't be included in the zip
> + zip -d ../../../dist/geckoview_library/geckoview_library.zip geckoview_library/backend.mk geckoview_library/Makefile
> +
> + # Move the JARs and resources back
> + mv libs/*.jar ../base/jars/
Well, that's good -- but prefer staging + $(CP). And $(ZIP), $(MKDIR), etc while you're at it.
::: toolkit/mozapps/installer/packager.mk
@@ +344,5 @@
> INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Robocop for you'
> endif
>
> +INNER_MAKE_GECKOVIEW_LIBRARY= \
> + cd fennec && \
nit: subshell for the scope of the cd.
@@ +345,5 @@
> endif
>
> +INNER_MAKE_GECKOVIEW_LIBRARY= \
> + cd fennec && \
> + $(ZIP) -r ../geckoview_library/geckoview_assets.zip assets && \
Not clear why we have a separate assets zip. I'd prefer one zip with all the things.
@@ +346,5 @@
>
> +INNER_MAKE_GECKOVIEW_LIBRARY= \
> + cd fennec && \
> + $(ZIP) -r ../geckoview_library/geckoview_assets.zip assets && \
> + cd -
Not clear on what cd - does. subshell is better.
Attachment #790961 -
Flags: feedback?(nalexander) → feedback+
Assignee | ||
Comment 29•11 years ago
|
||
Attachment #790961 -
Attachment is obsolete: true
Attachment #791047 -
Flags: feedback?(nalexander)
Assignee | ||
Comment 30•11 years ago
|
||
Attachment #787811 -
Attachment is obsolete: true
Attachment #792993 -
Flags: feedback?(cpeterson)
Assignee | ||
Comment 31•11 years ago
|
||
Attachment #792994 -
Flags: feedback?(cpeterson)
Comment 32•11 years ago
|
||
Comment on attachment 792994 [details] [diff] [review]
disable-content-providers.diff
Review of attachment 792994 [details] [diff] [review]:
-----------------------------------------------------------------
Maybe the content providers should be off by default and manually enabled by GeckoApp instead of adding hacks to GeckoView.
::: mobile/android/base/db/BrowserDB.java
@@ +19,5 @@
> import java.util.List;
>
> public class BrowserDB {
> public static String ABOUT_PAGES_URL_FILTER = "about:%";
> + private static boolean sDisableContentProviders;
I think a name like `sAreContentProvidersDisabled` (or, flipping the logic, `sAreContentProvidersEnabled`) might be clearer because it describes a state, not an action.
@@ +213,4 @@
> }
>
> public static boolean isReadingListItem(ContentResolver cr, String uri) {
> + return (sDisableContentProviders ? false : sDb.isReadingListItem(cr, uri));
You can simplify these expressions to something like:
return (!sDisableContentProviders && sDb.isReadingListItem(cr, uri));
Attachment #792994 -
Flags: feedback?(cpeterson) → feedback+
Comment 33•11 years ago
|
||
Comment on attachment 792993 [details] [diff] [review]
library-project.diff
Review of attachment 792993 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/GeckoView.java
@@ +129,5 @@
> + }
> +
> + public Activity getActivity() {
> + return (Activity)mContext;
> + };
remove extra semicolon.
@@ +172,5 @@
> + public void disableCameraView() {}
> +
> + public void addAppStateListener(GeckoAppShell.AppStateListener listener) {}
> +
> + public void removeAppStateListener(GeckoAppShell.AppStateListener listener) {}
Where are all these nop methods called from?
Attachment #792993 -
Flags: feedback?(cpeterson) → feedback+
Assignee | ||
Comment 34•11 years ago
|
||
Attachment #792994 -
Attachment is obsolete: true
Attachment #793125 -
Flags: review?(cpeterson)
Assignee | ||
Comment 35•11 years ago
|
||
Attachment #792993 -
Attachment is obsolete: true
Attachment #793127 -
Flags: review?(cpeterson)
Assignee | ||
Comment 36•11 years ago
|
||
Updated manifest with permissions for GeckoView
Attachment #791047 -
Attachment is obsolete: true
Attachment #791047 -
Flags: feedback?(nalexander)
Attachment #793128 -
Flags: review?(nalexander)
Comment 37•11 years ago
|
||
Comment on attachment 793128 [details] [diff] [review]
add-library-project-directory.diff
Review of attachment 793128 [details] [diff] [review]:
-----------------------------------------------------------------
I'm confused about how this will be consumed. Specifying .classpath suggests an Eclipse project (but then there should be .project, no)? The inclusion of Makefile and backend.mk is almost certainly not wanted. This is a strong f+ -- providing consumer build context might make this an r+.
::: mobile/android/geckoview_library/.classpath
@@ +4,5 @@
> + <classpathentry kind="src" path="gen"/>
> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
> + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES">
> + <attributes>
> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="geckoview_library/libs/armeabi-v7a"/>
What was the word on all the different ABIs we support?
::: mobile/android/geckoview_library/Makefile.in
@@ +11,5 @@
> +
> +INSTALL_TARGETS += GECKOVIEW_LIBRARY
> +GECKOVIEW_LIBRARY_DEST = $(CURDIR)
> +GECKOVIEW_LIBRARY_FILES := \
> + AndroidManifest.xml \
nit: sort these. And two spaces at start rather than \t (Make is crazy).
::: toolkit/mozapps/installer/packager.mk
@@ +343,5 @@
> else
> INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Robocop for you'
> endif
>
> +INNER_MAKE_GECKOVIEW_LIBRARY= \
Can we get a one-line comment explaining what this does right before the command? For example:
# Create geckoview_library/geckoview_{assets,library}.zip for third-party GeckoView consumers.
@@ +354,5 @@
> + cp bin/libmozglue.so bin/lib/libplugin-container.so ../mobile/android/geckoview_library/libs/$(ABI_DIR)/ && \
> + cp -R ../mobile/android/base/res ../mobile/android/geckoview_library && \
> + ( cd ../mobile/android && \
> + $(ZIP) -r ../../dist/geckoview_library/geckoview_library.zip geckoview_library) && \
> + $(ZIP) -d geckoview_library/geckoview_library.zip geckoview_library/backend.mk geckoview_library/Makefile
I'm a bit confused here. You almost certainly don't want the processed Makefile or backend.mk included here -- that's going to include a ton of things that third parties won't want. (For example, includes like rules.mk.)
Attachment #793128 -
Flags: review?(nalexander) → feedback+
Assignee | ||
Comment 38•11 years ago
|
||
> I'm confused about how this will be consumed. Specifying .classpath suggests an Eclipse project (but then there should be .project, no)?
Yes, it will be an Eclipse project. The .project file should have been included in the patch, but I guess I missed it. The updated patch has it included.
Attachment #793128 -
Attachment is obsolete: true
Attachment #793197 -
Flags: review?(nalexander)
Comment 39•11 years ago
|
||
Comment on attachment 793127 [details] [diff] [review]
library-project.diff
Review of attachment 793127 [details] [diff] [review]:
-----------------------------------------------------------------
Brad should probably review these GeckoView changes.
Attachment #793127 -
Flags: review?(cpeterson) → review?(blassey.bugs)
Comment 40•11 years ago
|
||
Comment on attachment 793125 [details] [diff] [review]
disable-content-providers.diff
Review of attachment 793125 [details] [diff] [review]:
-----------------------------------------------------------------
Brad should probably review these GeckoView changes.
Attachment #793125 -
Flags: review?(cpeterson) → review?(blassey.bugs)
Assignee | ||
Comment 41•11 years ago
|
||
Comment 42•11 years ago
|
||
Comment on attachment 793197 [details] [diff] [review]
add-library-project-directory.diff
Review of attachment 793197 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good.
Attachment #793197 -
Flags: review?(nalexander) → review+
Comment 43•11 years ago
|
||
Comment on attachment 793125 [details] [diff] [review]
disable-content-providers.diff
Review of attachment 793125 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/GeckoView.java
@@ +42,5 @@
> + // If running outside of a GeckoActivity (eg, from a library project),
> + // load the native code and disable content providers
> + if (!(context instanceof GeckoActivity)) {
> + BrowserDB.setEnableContentProviders(false);
> + }
Just wanted to point out that this code won't get hit in Fennec because it is after the doInit check. This would also be true of any user that set doinit to fale, but they'd already be a little screwed anyway.
Attachment #793125 -
Flags: review?(blassey.bugs) → review+
Comment 44•11 years ago
|
||
Comment on attachment 793127 [details] [diff] [review]
library-project.diff
Review of attachment 793127 [details] [diff] [review]:
-----------------------------------------------------------------
You have the basics here (stubbed out or default implementations of GeckoInterface functions), but the simple cast of the Context to an Activity seems wrong.
::: mobile/android/base/GeckoView.java
@@ +135,5 @@
> + return null;
> + }
> +
> + public Activity getActivity() {
> + return (Activity)mContext;
not a fan of this. There is a reason that there is a separate getContext() and getActivity(). Also, if this were "the right thing to do", callers of getActivity() could instead call (Activity)getContext().
Instead, let's provide a BaseGeckoInterface class that takes an Activity in the constructor and stubs out or provides default implementations for everything else (like you've done here).
To make things "just work" we can do an instanceof test on the context we get in the GeckoView constructor and construct a BaseGeckoInterface using that.
Attachment #793127 -
Flags: review?(blassey.bugs) → review-
Assignee | ||
Comment 45•11 years ago
|
||
> callers of getActivity() could instead call (Activity)getContext().
AFAIK, views do not have a getActivity() function so the only way to get an activity is to cast the context given in the constructor or returned by getContext() to an activity.
Regardless, other methods in the new BaseGeckoInterface need a context, so its constructor takes a context that is then cast to an activity. GeckoView checks that the context given to BaseGeckoInterface is, in fact, an instance of Activity.
Attachment #793127 -
Attachment is obsolete: true
Attachment #793741 -
Flags: review?(blassey.bugs)
Comment 46•11 years ago
|
||
Comment on attachment 793197 [details] [diff] [review]
add-library-project-directory.diff
Mike, could you look at the changes to packager.mk?
Context: this series of patches wraps up some of the Android assets and some new project files for consumption by third party developers who want to embed GeckoView on Android. We create two zip files in the packaging step; third parties would configure an Eclipse (or other) project using the assets and the project files.
1. It just occurred to me that some of the build artifacts that get zipped in the packaging step might not be present during some of the |make package| invocations on build bots. If you see anything obvious, can you say?
2. Eventually we want to distribute these zips via the buildbots. Is there anything else needed except an UPLOAD_EXTRA_FILES line (like robocop.apk)?
3. Should we be building these zips only conditionally (say for local and Nightly builds only)?
Thanks!
Attachment #793197 -
Flags: review+ → review?(mh+mozilla)
Comment 47•11 years ago
|
||
Comment on attachment 793197 [details] [diff] [review]
add-library-project-directory.diff
Review of attachment 793197 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/mozapps/installer/packager.mk
@@ +355,5 @@
> + cp bin/libmozglue.so bin/lib/libplugin-container.so ../mobile/android/geckoview_library/libs/$(ABI_DIR)/ && \
> + cp -R ../mobile/android/base/res ../mobile/android/geckoview_library && \
> + ( cd ../mobile/android && \
> + $(ZIP) -r ../../dist/geckoview_library/geckoview_library.zip geckoview_library) && \
> + $(ZIP) -d geckoview_library/geckoview_library.zip geckoview_library/backend.mk geckoview_library/Makefile
I'd rather see this as a $(MAKE) -C $(DEPTH)/mobile/android/geckoview_library package
with a package rule in mobile/android/geckoview_library/Makefile.in
That'd be more readable.
Note $(ZIP) has a -x option to exclude files when creating the archive instead of removing them with -d afterwards.
Attachment #793197 -
Flags: review?(mh+mozilla) → review-
Comment 48•11 years ago
|
||
Comment on attachment 793741 [details] [diff] [review]
library-project.diff
Review of attachment 793741 [details] [diff] [review]:
-----------------------------------------------------------------
r=blassey with nits addressed
::: mobile/android/base/BaseGeckoInterface.java
@@ +53,5 @@
> + }
> +
> + public SensorEventListener getSensorEventListener() {
> + return null;
> + }
file some follow up bugs to add set<>Listener() methods
@@ +55,5 @@
> + public SensorEventListener getSensorEventListener() {
> + return null;
> + }
> +
> + public void doRestart() {}
file a follow up bug to implement this (and put the bug number in a comment)
@@ +75,5 @@
> + }
> +
> + public void addPluginView(final View view, final RectF rect, final boolean isFullScreen) {}
> +
> + public void removePluginView(final View view, final boolean isFullScreen) {}
guess what? file follow ups for implementations.
Actually, file a follow up for each method that is just stubbed out to get an implementation
::: mobile/android/base/GeckoView.java
@@ +45,5 @@
>
> // If running outside of a GeckoActivity (eg, from a library project),
> // load the native code and disable content providers
> if (!(context instanceof GeckoActivity)) {
> + setGeckoInterface(context);
do your instanceof check here and create a BaseGeckoInterface to pass to setGeckoInterface(). Also, do a (getGeckoInterface() != null) check to make sure we're not overwriting the interface that the embedder has already set.
@@ +97,5 @@
> requestRender();
> }
> }
>
> + public static void setGeckoInterface(final Context context) {
keep setGeckoInterface(GeckoInterface) because I'd like an implementer to be able to call it
Comment 49•11 years ago
|
||
(In reply to Shane Tully (:stully: from comment #45)
> Created attachment 793741 [details] [diff] [review]
> library-project.diff
>
> > callers of getActivity() could instead call (Activity)getContext().
>
> AFAIK, views do not have a getActivity() function so the only way to get an
> activity is to cast the context given in the constructor or returned by
> getContext() to an activity.
I was referring to GeckoInterface.getActivity()
Comment 50•11 years ago
|
||
Comment on attachment 793741 [details] [diff] [review]
library-project.diff
Review of attachment 793741 [details] [diff] [review]:
-----------------------------------------------------------------
r=blassey with nits addressed
::: mobile/android/base/BaseGeckoInterface.java
@@ +53,5 @@
> + }
> +
> + public SensorEventListener getSensorEventListener() {
> + return null;
> + }
file some follow up bugs to add set<>Listener() methods
@@ +55,5 @@
> + public SensorEventListener getSensorEventListener() {
> + return null;
> + }
> +
> + public void doRestart() {}
file a follow up bug to implement this (and put the bug number in a comment)
@@ +75,5 @@
> + }
> +
> + public void addPluginView(final View view, final RectF rect, final boolean isFullScreen) {}
> +
> + public void removePluginView(final View view, final boolean isFullScreen) {}
guess what? file follow ups for implementations.
Actually, file a follow up for each method that is just stubbed out to get an implementation
::: mobile/android/base/GeckoView.java
@@ +45,5 @@
>
> // If running outside of a GeckoActivity (eg, from a library project),
> // load the native code and disable content providers
> if (!(context instanceof GeckoActivity)) {
> + setGeckoInterface(context);
do your instanceof check here and create a BaseGeckoInterface to pass to setGeckoInterface(). Also, do a (getGeckoInterface() != null) check to make sure we're not overwriting the interface that the embedder has already set.
@@ +97,5 @@
> requestRender();
> }
> }
>
> + public static void setGeckoInterface(final Context context) {
keep setGeckoInterface(GeckoInterface) because I'd like an implementer to be able to call it
Attachment #793741 -
Flags: review?(blassey.bugs) → review+
Assignee | ||
Comment 51•11 years ago
|
||
Attachment #793197 -
Attachment is obsolete: true
Attachment #794744 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 52•11 years ago
|
||
Attachment #793741 -
Attachment is obsolete: true
Assignee | ||
Comment 53•11 years ago
|
||
Documentation: https://wiki.mozilla.org/Mobile/GeckoView
Comment 54•11 years ago
|
||
Comment on attachment 794744 [details] [diff] [review]
add-library-project-directory.diff
Review of attachment 794744 [details] [diff] [review]:
-----------------------------------------------------------------
Almost there. You'll need someone else's review for the xml files, though.
::: mobile/android/geckoview_library/Makefile.in
@@ +21,5 @@
> +include $(topsrcdir)/config/rules.mk
> +
> +package:
> + # Make directory for the zips
> + $(MKDIR) -p ../../../dist/geckoview_library
Please use $(DIST) instead of ../../../dist.
@@ +25,5 @@
> + $(MKDIR) -p ../../../dist/geckoview_library
> +
> + # Zip the assets
> + cd ../../../dist/fennec; \
> + $(ZIP) -r ../geckoview_library/geckoview_assets.zip assets
This is going to break some of the .so that need to *not* be deflated. See SZIP_LIBRARIES in packager.mk.
@@ +29,5 @@
> + $(ZIP) -r ../geckoview_library/geckoview_assets.zip assets
> +
> + # Make empty directories to fit an Android project structure
> + $(MKDIR) -p bin gen libs/$(ABI_DIR) src
> +
Please remove the various empty tabs in this file.
@@ +41,5 @@
> + cp -R ../base/res .
> +
> + # Zip the directory
> + cd ..; \
> + $(ZIP) -r ../../dist/geckoview_library/geckoview_library.zip geckoview_library --exclude geckoview_library/backend.mk geckoview_library/Makefile
Does the zip need to have a root geckoview_library directory?
Attachment #794744 -
Flags: review?(mh+mozilla) → feedback+
Assignee | ||
Comment 55•11 years ago
|
||
Attachment #794744 -
Attachment is obsolete: true
Attachment #794925 -
Flags: review?(mh+mozilla)
Comment 56•11 years ago
|
||
Comment on attachment 794925 [details] [diff] [review]
add-library-project-directory.diff
Review of attachment 794925 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/geckoview_library/Makefile.in
@@ +25,5 @@
> + $(MKDIR) -p $(DIST)/geckoview_library
> +
> + # Zip the assets
> + cd $(DIST)/fennec; \
> + $(ZIP) -0 -r ../geckoview_library/geckoview_assets.zip assets
You're effectively making all assets uncompressed.
BTW, since this is not going to be an apk, how is an apk going to be created from this? Because that's actually where that matters most, that some files are kept uncompressed...
::: toolkit/mozapps/installer/packager.mk
@@ +345,5 @@
> endif
>
> +# Create geckoview_library/geckoview_{assets,library}.zip for third-party GeckoView consumers.
> +INNER_MAKE_GECKOVIEW_LIBRARY= \
> + $(MAKE) -C ../mobile/android/geckoview_library package ABI_DIR=$(ABI_DIR) dist=$(DIST)
You don't need to pass DIST.
Attachment #794925 -
Flags: review?(mh+mozilla)
Comment 57•11 years ago
|
||
Comment on attachment 794925 [details] [diff] [review]
add-library-project-directory.diff
Review of attachment 794925 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/geckoview_library/Makefile.in
@@ +25,5 @@
> + $(MKDIR) -p $(DIST)/geckoview_library
> +
> + # Zip the assets
> + cd $(DIST)/fennec; \
> + $(ZIP) -0 -r ../geckoview_library/geckoview_assets.zip assets
As per the discussion on irc, you have my r+ if you remove that -0 and remove the dist=$(DIST) from packager.mk
Updated•11 years ago
|
Attachment #794786 -
Flags: review+
Comment 58•11 years ago
|
||
Comment on attachment 794786 [details] [diff] [review]
library-project.diff
gah, wrong one
Attachment #794786 -
Flags: review+
Updated•11 years ago
|
Attachment #794925 -
Flags: review+
Assignee | ||
Comment 59•11 years ago
|
||
Attachment #794925 -
Attachment is obsolete: true
Comment 60•11 years ago
|
||
Comment on attachment 794942 [details] [diff] [review]
add-library-project-directory.diff
Carrying forward r=blassey from comment 50
Attachment #794942 -
Flags: review+
Comment 61•11 years ago
|
||
Comment on attachment 794786 [details] [diff] [review]
library-project.diff
Carrying forward r=glandium from comment 58
Attachment #794786 -
Flags: review+
Comment 62•11 years ago
|
||
Reporter | ||
Comment 63•11 years ago
|
||
I tried a build and package. After, <objdir>/dist/geckoview_library/*.zip files were created.
When I tired to create an Eclipse project (what a nightmare) I ended up with some missing references to a "geckoview_library/bin/geckoview.jar". Any idea what's going on? There is no "bin/geckoview.jar" file in my ZIP files.
Comment 64•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/fa20cf0458b5
https://hg.mozilla.org/mozilla-central/rev/59f669c61da5
https://hg.mozilla.org/mozilla-central/rev/39ee92c06d6b
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Reporter | ||
Comment 65•11 years ago
|
||
This seems to have broken l10n builds (repacks):
https://tbpl.mozilla.org/?showall=1&jobname=l10n%20nightly&rev=416075f77249
Comment 66•11 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #63)
> I tried a build and package. After, <objdir>/dist/geckoview_library/*.zip
> files were created.
>
> When I tired to create an Eclipse project (what a nightmare) I ended up with
> some missing references to a "geckoview_library/bin/geckoview.jar". Any idea
> what's going on? There is no "bin/geckoview.jar" file in my ZIP files.
Did you followed the instructions in https://wiki.mozilla.org/Mobile/GeckoView ?
According to those instructions you have to build 2 eclipse projects: a library project (named GeckoView) which must be imported from unzipped geckoview_library.zip and another eclipse android project (e.g. GeckoViewExample made by stully) which uses the first library project.
If you do all things correctly, after building GeckoViewExample project you will also build GeckoView library project. The "bin/geckoview.jar" is located under GeckoView/bin/geckoview.jar
Comment 67•11 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #63)
> I tried a build and package. After, <objdir>/dist/geckoview_library/*.zip
> files were created.
>
> When I tired to create an Eclipse project (what a nightmare) I ended up with
> some missing references to a "geckoview_library/bin/geckoview.jar". Any idea
> what's going on? There is no "bin/geckoview.jar" file in my ZIP files.
Notice that although in GeckoViewExample project which stully uploaded in https://wiki.mozilla.org/Mobile/GeckoView the library project is called "geckoview_library" but after importing geckoview_library from the zipped file geckoview_library.zip the imported project in eclipse will have the name "GeckoView".
I think this is the source of your problem. The solution is:
Right_click on GeckoViewExample project in eclipse -> properties -> Android -> delete reference to geckoview_library (it must have a red cross beside itself) -> read "GeckoView" instead
Comment 68•11 years ago
|
||
I also have a problem too:
I can import, compile and build both GeckoView library project and GeckoViewExample project in eclipse. But when I run the GeckoViewExample app on my Android 4.2.2 device, it issues the error: Unfortunately, GeckoView Example has stopped. -> OK
I can't figure out what can be the problem. Anyone has any idea?
Comment 69•11 years ago
|
||
Backed out 39ee92c06d6b because GeckoView breaks Android's l10n repacks:
https://hg.mozilla.org/integration/mozilla-inbound/rev/35d97694d436
Reporter | ||
Comment 70•11 years ago
|
||
This patch fixes the bug where any drawable used in a GeckoView-based Application would potentially reorder the R.java identifiers and cause lookups in org.mozilla.gecko compiled JARs to fail. The two resources where this happens is: shadow and scrollbar, since they are the only ones hit during typical use of GeckoView.
The problem seems to be that the JARs in geckoview_library are compiled with specific values for the R.type.resource and when the Application that uses geckoview_library mixes in it's resources the R.java values can be changed. This is expected. What's not expected is that geckoview_library does not care about the changed values. It only knows about the original values.
Long story short, we can make it work if we dynamically load the resource identifiers for any *core* GeckoView resource.
99% of the resources in the geckoview_library will never be needed by the Application, so we could remove them in a separate bug.
Attachment #797273 -
Flags: review?(bugmail.mozilla)
Updated•11 years ago
|
status-firefox25:
wontfix → ---
Whiteboard: [leave open]
Reporter | ||
Comment 71•11 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #69)
> Backed out 39ee92c06d6b because GeckoView breaks Android's l10n repacks:
> https://hg.mozilla.org/integration/mozilla-inbound/rev/35d97694d436
Link to the bustage:
https://tbpl.mozilla.org/?showall=1&jobname=l10n%20nightly&rev=416075f77249
Updated•11 years ago
|
Attachment #797273 -
Flags: review?(bugmail.mozilla) → review+
Reporter | ||
Comment 72•11 years ago
|
||
This patch adds a mozconfig option (--disable-geckoview-library) so we can skip any GeckoView work during the packaging.
Attachment #797650 -
Flags: review?(mh+mozilla)
Reporter | ||
Comment 73•11 years ago
|
||
Disable geckoview-library on any l10n builds. We are not ready to make it work there.
Attachment #797651 -
Flags: review?(mh+mozilla)
Comment 74•11 years ago
|
||
Comment on attachment 797650 [details] [diff] [review]
allow-mozconfig-disable
Review of attachment 797650 [details] [diff] [review]:
-----------------------------------------------------------------
::: configure.in
@@ +5133,5 @@
> + MOZ_DISABLE_GECKOVIEW=1,
> + MOZ_DISABLE_GECKOVIEW=)
> +
> +if test -n "$MOZ_DISABLE_GECKOVIEW"; then
> + AC_DEFINE(MOZ_DISABLE_GECKOVIEW)
You're not using the AC_DEFINE, so no need for it.
(AC_SUBST for things accessed in makefiles, AC_DEFINE for things accessed in code (and even for that, AC_DEFINE is most of the time overkill))
That being said, since this is a l10n releng build specific option, it would be better not to add one to the already long list of configure flags available. Just keep the AC_SUBST, and set MOZ_DISABLE_GECKOVIEW in the l10n mozconfigs.
Attachment #797650 -
Flags: review?(mh+mozilla) → review-
Updated•11 years ago
|
Attachment #797651 -
Flags: review?(mh+mozilla)
Reporter | ||
Comment 75•11 years ago
|
||
This patch removes the AC_DEFINE support and just keeps the AC_SUBST support
Attachment #797650 -
Attachment is obsolete: true
Attachment #799444 -
Flags: review?(mh+mozilla)
Reporter | ||
Comment 76•11 years ago
|
||
This patch disables GeckoView for l10n builds by exporting the MOZ_DISABLE_GECKOVIEW flag directly. Tested locally and it does disable the library from being packaged.
Attachment #797651 -
Attachment is obsolete: true
Attachment #799445 -
Flags: review?(mh+mozilla)
Updated•11 years ago
|
Attachment #799444 -
Flags: review?(mh+mozilla) → review+
Comment 77•11 years ago
|
||
Comment on attachment 799445 [details] [diff] [review]
disable-geckoview-l10n v0.2
Review of attachment 799445 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/config/mozconfigs/android-armv6/l10n-nightly
@@ +33,5 @@
>
> export JAVA_HOME=/tools/jdk6
> export MOZILLA_OFFICIAL=1
> export MOZ_PKG_SPECIAL=armv6
> +export MOZ_DISABLE_GECKOVIEW=1
I think you don't need to export, but okay either way.
Attachment #799445 -
Flags: review?(mh+mozilla) → review+
Reporter | ||
Comment 78•11 years ago
|
||
Reporter | ||
Updated•11 years ago
|
Whiteboard: [leave open]
Reporter | ||
Comment 79•11 years ago
|
||
Comment 80•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9ff14d43346d
https://hg.mozilla.org/mozilla-central/rev/965457d9bc1e
https://hg.mozilla.org/mozilla-central/rev/9f3ef3de5617
https://hg.mozilla.org/mozilla-central/rev/cfcf5b7edc53
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Comment 81•11 years ago
|
||
Backed out:
https://hg.mozilla.org/integration/mozilla-inbound/rev/feffc2cf422e
https://hg.mozilla.org/integration/mozilla-inbound/rev/0fa38163e3bf
because https://hg.mozilla.org/mozilla-central/rev/9ff14d43346d didn't seem to have build peer review.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Updated•11 years ago
|
Attachment #794942 -
Flags: review?(mh+mozilla)
Reporter | ||
Comment 82•11 years ago
|
||
Comment on attachment 794942 [details] [diff] [review]
add-library-project-directory.diff
Actually, Mike already reviewed this, so I'm carrying it forward:
https://bugzilla.mozilla.org/page.cgi?id=splinter.html&bug=880118&attachment=794925
Attachment #794942 -
Flags: review?(mh+mozilla) → review+
Reporter | ||
Comment 83•11 years ago
|
||
... and relanded:
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/cb3a85808d77
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/b7396ea8f548
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/2a9bde2ff860
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/fff320870b20
Comment 84•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cb3a85808d77
https://hg.mozilla.org/mozilla-central/rev/b7396ea8f548
https://hg.mozilla.org/mozilla-central/rev/2a9bde2ff860
https://hg.mozilla.org/mozilla-central/rev/fff320870b20
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Comment 85•11 years ago
|
||
I am using geckoview lib. I got an resource not found exception.
I solved this excepiton in a tricky way.
I unpack gecko-browser.jar, rm the R classes and then re-pack to gecko-browser.jar
replace origin gecko-broser.jar.
Then ant debug. install apk to device. This will result java.lang.NoClassDefFoundError: org.mozilla.gecko.R$styleable.
Then copy the geckoview fold in gen/org/mozilla/,rename to gecko.
Edit the gen/org/mozilla/gecko/R.java, change package name to org.mozilla.gecko
then ant debug, install apk to device.
It works. Because the classloader can load the right R.class which have the right int id value.
And I found your are working on fix the issue.https://bugzilla.mozilla.org/attachment.cgi?id=797273&action=diff
I think there are two methons to avoid R.java reorder.
1. getResources().getIdentifier(), as in the diff
2. Change the R.java's package name to "org.mozilla.geckoview", Do not package R.class into gecko-browser.jar. Actually I only try in a HelloProject, Because I don't known how to change the build script this project. Any suggestion is appreciated
P.S. I tried another method. Change the gecko library project's package name to "org.mozilla.gecko". But I got a so runtime exception. Is gecko library project's package name must be "org.mozilla.geckoview"?
(In reply to Mark Finkle (:mfinkle) from comment #70)
> Created attachment 797273 [details] [diff] [review]
> Pull resources dynamically to avoid R.java reorder
>
> This patch fixes the bug where any drawable used in a GeckoView-based
> Application would potentially reorder the R.java identifiers and cause
> lookups in org.mozilla.gecko compiled JARs to fail. The two resources where
> this happens is: shadow and scrollbar, since they are the only ones hit
> during typical use of GeckoView.
>
> The problem seems to be that the JARs in geckoview_library are compiled with
> specific values for the R.type.resource and when the Application that uses
> geckoview_library mixes in it's resources the R.java values can be changed.
> This is expected. What's not expected is that geckoview_library does not
> care about the changed values. It only knows about the original values.
>
> Long story short, we can make it work if we dynamically load the resource
> identifiers for any *core* GeckoView resource.
>
> 99% of the resources in the geckoview_library will never be needed by the
> Application, so we could remove them in a separate bug.
Comment 86•9 years ago
|
||
We are implementing GeckoView in our project. But we have a problem with clear cookies.
Can somebody say, what class clear cookies in geckoview? Urgent! Best Regards
Comment 87•9 years ago
|
||
(In reply to Ali Kasimoglu from comment #86)
> We are implementing GeckoView in our project. But we have a problem with
> clear cookies.
> Can somebody say, what class clear cookies in geckoview? Urgent! Best Regards
You're more likely to get an answer if you ask on the mobile-firefox-dev mailing list [1], or in the #mobile IRC channel [2].
[1] https://mail.mozilla.org/listinfo/mobile-firefox-dev
[2] https://wiki.mozilla.org/IRC
Comment 88•9 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #87)
> (In reply to Ali Kasimoglu from comment #86)
> > We are implementing GeckoView in our project. But we have a problem with
> > clear cookies.
> > Can somebody say, what class clear cookies in geckoview? Urgent! Best Regards
>
> You're more likely to get an answer if you ask on the mobile-firefox-dev
> mailing list [1], or in the #mobile IRC channel [2].
>
> [1] https://mail.mozilla.org/listinfo/mobile-firefox-dev
> [2] https://wiki.mozilla.org/IRC
thank you
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•