mozilla :: #mobile

17 Mar 2017
13:43njparkahunt: i was trying today's build, and when I type error:-1 in the url bar, the app freezes now
13:44njparkhas the syntax changed?
13:50ahuntnjpark: it shouldnt have, but its possible I broke that with the market: fixes
13:51* ahunt tests
13:51njparkahunt: okay, well i have the screenshots out last night so we have some time
13:51njparki just rebased- I hope I built it correctly
13:52* njpark tried on device, now testing on sim
14:08ahuntnjpark: Ive uploaded a fix, just waiting for review right now (and longer term Im going to refactor since our URL handling is messy)
14:17njparkahunt: awesome, thanks!! yeah I can rerun tests once the refactoring is done, I'll probably have a set of UI Tests that runs on buddybuild hopefully by early next week
14:18ahuntnjpark: it just landed, everything should work as expected now!
14:19ahunt(the fix that is, the cleanup isn't too much of a priority otoh)
14:20sebastianTIL: There's a support annotation to limit access to methods/classes to libraries or groups:
14:29njparkahunt: thanks! that worked well. One small thing I noticed is that if I enter market:// address in simulator where there is no google play installed, the app hangs, but it's kinda an edge case, and I guess this will be address in the refactoring i suppose?
14:32ahuntnjpark: feel free to file that separately, I'm guessing we don't need to worry too much about it, but it would be good to fix
14:32njparkwill do, thanks!
14:33ahuntHM actually, that probably affects any unsupported protocol - I definitely need to fix that sooner rather than later
14:37njparkahunt: yeah I just found that out... mentioned in the bug
17:37mkaplyDo we use the Android Presentation API for anything on Fennec
17:41AaronMTsnorp has stories about that
17:48mkaplyI'm thoroughly confused now. In previous discussions, our Chromecast support was broke. But patches went in related to Chromecast on Firefox 52?
17:48kbrosnanchromecast video casting functioned for me last i tried it
17:49kbrosnanit does have a number of limitations
17:51mkaplykbrosnan: That's good. Last time I tried, it didn't work. I'm trying to figure out why mirroring of Firefox to a Chromecast doesn't work correctly. I got in touch with the Chromecast team and they said that use of the presentation API could mess things up. So I'm trying to figure out if that's related.
17:51kbrosnanmirroring as i recall only is enabled on nightly
17:54mkaplykbrosnan: We should get mirroring for free from the Home app casting the entire phone. That's what's not working right on Firefox (even on nightly). Strange results.
17:56kbrosnani'm not famiar with that other than the bug that was filed recently
17:56mkaplykbrosnan: Yeah, that's the one. It's weird.
18:08snorpmkaply: ok for that we do have speical code
18:08snorpmkaply: so that we only send the web output rather than the entire app
18:08snorpmkaply: so maybe that broke
18:08snorprbarker or I might be able to fix
18:09mkaplysnorp: That explains what we are seeing, but you end up with a really broken experience. Why did we decide to do that instead of just mirroring the entire app (like Chrome).
18:09mkaplyWhen the keyboard comes up, you lose half your screen.
18:10snorpmkaply: cause you probably don't want to see the chrome, right?
18:10snorpkeyboard issue would happen anyway
18:10mkaplysnorp: Yes, because you're mirroring the entire device. You want to see all the content on the device.
18:10snorpbut I thought maybe we had fixed taht too
18:10mkaplyNo, because you would see the keyboard on your screen.
18:10snorpI'm confused
18:10mkaplyIT's supposed to show exactly what you see on your phone.
18:10snorpso you would see the keyboard
18:10mkaply(I'm talking about mirroring the entire device)
18:10snorpwith the default behavior
18:11snorpright, so android lets you customize what your app sends
18:11snorpwhen you are mirroring the entire device
18:11snorpso we don't send the app UI, only the web content
18:11snorpbecause the app UI is not very useful on the TV
18:11snorpyou shouldn't see the keyboard with our stuff
18:12snorp(though I guess it's broken?)
18:12mkaplysnorp: But the end result is a very broken experience. You see a web page on your screen, you go to type, the screen gets very big and half of it goes away.
18:12mkaplyI would expect us to be more consistent with other browsers.
18:12snorpI'm really not following at all
18:12snorpI think maybe you're conflating the expected results with buggy ones?
18:13snorp"the screen gets very big and half of it goes away" makes no sense to me
18:13mkaplysnorp: If we're only showing the web content, when the keyboard comes up on my phone, it takes up half the UI. So what used to be the entire web page on the TV is now half the web page.
18:14snorpmkaply: ok that's just a bug
18:14snorpmkaply: but if we were doing nothing special, you would just see the keyboard there anyway
18:14mkaplyWhere's the code to tell us to send everything?
18:15mkaplyBecause we're only sending content, you also end up with a blank white screen whenever you're opening a new tab.
18:15mkaply(whenever about:home is displayed)
18:16snorpmkaply: I think
18:16snorpor maybe not
18:16rbarkerI haven't tried it since the video mirroring code landed. I have no idea how the two interact.
18:17snorpyeah the presentation api changed all of this stuff
18:18snorprbarker: how do we even start the compositor tee
18:18snorpnot even sure what to grep for these days
18:18rbarkerSo you have to start device mirroring out side of fennec.
18:18snorpand then you get a media route, etc
18:19rbarkerThen when fennec get focus. The presentation surface is passed in.
18:19snorpright where do we create that
18:19rbarkerWe don't, we get it in a call back when the presentation service is active... I'll have to look I don't remember where that is exactly...
18:20snorpok but we set that surface as the compositor tee target
18:21snorpah found it
18:21snorpGeckoPresentation and the associated SurfaceListener
18:22snorpmkaply: for about:home we could show something else, it's just that about:home is a blank page for gecko
18:26mkaplysnorp: I think we're trying to hard to only show the web content. The experience is pretty bad. And I don't think it buys us much (and makes us really inconsistent with every other browser out there). If we want to provide the ability within Firefox to cast the web content, that's different (I guess we added that?). But I think that if the user is mirroring
18:26mkaplythe phone, we should show the entire phone.
18:26snorpmkaply: ok, that's easy enough to fix
18:26mkaplyOr at least provide an option :)
18:26snorpI don't think we added web content mirroring
18:27mkaplyOh, just video mirroring
18:27snorpthe presentation api lets you communicate with another page that is being presented
18:27snorpvideo casting?
18:27snorpthat's really old
18:27snorpand yeah that just asks the chromecast to play this video
18:27snorpand then the local controls are used to control the remote one
18:27mkaplySo what got added for 52?
18:27sebastianomg. New AMO mobile design
18:28sebastiandidn't see that coming
18:28firebotBug 1285870 FIXED, Show custom presentation on Chromecast.
18:28snorpmkaply: that's the presentation api
18:28snorpmkaply: so you can ask the chromecast to load some other page, and then you can talk to that page from the original page
18:28snorpso for a set of slides
18:28snorpthe chromecast could show the slides, and the origin page would show notes or whatever
18:29mkaplysnorp: Ok, that's freaking sweet. I've been wanting that forever
18:29snorpmkaply: it seems nice
18:29snorpI haven't played with it
18:29snorpbeen wanting to
18:29snorpbut I'm disabling it in 52
18:29rbarkersnorp: the Presentation api on Android is just mirroring what is rendered to the presentation surface.
18:29snorpbecause bugs
18:29snorprbarker: oh?
18:29snorpthat's now what the presentation api does though
18:30mkaplysnorp: Yeah, I saw it was breaking other things.
18:30rbarkersnorp: it did when I implemented the screen casting junk.
18:30snorprbarker: what
18:30snorprbarker: what do you mean by presentation api
18:30snorprbarker: the android thing?
18:30rbarkersnorp: The android Presentation API
18:30snorprbarker: right that's true
18:30snorprbarker: but there is a web presentation api that's different
18:31rbarkerokay, I was clear what you were talking about.
18:31snorpbut yeah what you said is true for the thing you worked on
18:31snorpthe terminology here is pretty confusing
18:32rbarkerAlso the Android Presentation API was broken. I guess it works again?
18:32* snorp shrugs
18:33rbarkerAnd isn't there code to render a video to the Android Presentation API now, I remember something about needing two geckoviews...
18:33rbarkeror is that the web presentation api stuff?
18:33snorpah right I remember that now
18:33snorpthat's how the display the presenting page
18:33snorpa geckoview
18:34snorpso both pages are running in gecko
18:34snorpbut we're mirroring the presenting page
18:34snorpI hope we aren't using that for video now because that's dumb
18:35rbarkerThat's fairly new code isn't it?
18:35rbarkerIt landed some time after my mirror stuff.
18:39sebastiannjpark: New string import in master. :)
18:40njparksebastian: 0_0 just did it an hour ago... okay :)
18:40sebastianoops :)
18:41sebastianoh, all the error pages are there. nice!
18:46mkaplySo is there any doc on how to use the new presentation mode in bug 1285870?
18:46firebot FIXED, Show custom presentation on Chromecast.
18:46mkaplysnorp: cool
18:46snorpmkaply: the chromecast just appears as a target
18:47mkaplysnorp: Got it.
18:47snorpmkaply: so that should show a chromecast device
18:47snorpso this is a pretty cool feature
18:48snorpapparently doesn't work on android webview
18:48snorpso that could be a cool GV demo
18:51mkaplyYea, just tried Chrome and it didn't work.
18:52mkaplyAt least with the demos here:
19:30snorpmkaply: I tried a couple and it looks like they don't even try to find an actual presentation display
19:30snorpjust mocked
19:30mkaplyyep. I just got an email from the chrome/chrome cast person about their mirroring
19:31mkaplyChrome does not currently attempt to do anything special with respect to multiple displays on Android, and by doing nothing, we get straight up screen mirroring. We've focused our multiscreen efforts on Android around video-specific features for casting (which offload the device you're browsing on by sending the video URL directly to the playback device),
19:31mkaplyand on exposing the Cast SDK and Presentation API for sites that want full control of the experience.
19:36JanHantlam: ping
19:37snorpmkaply: wait what?
19:37snorpmkaply: exposing cast sdk how?
19:38mkaplysnorp: I shall ask.
19:41ahuntUghh fragment crashes...
20:18mkaplyahunt: Are you the primary person to talk to about Mobile UI?
20:29ahuntmkaply: depends on what UI. Sebastian knows pretty much everything really, I know some parts.
20:31mkaplyahunt: So we've had an ask for a partner. I don't like it, but we're going to hide it behind a distribution pref. They want a way to set a given page as your homepage from the primary UI. I was looking for anyone with clever ideas to implement without adding a menuitem.
20:31ahuntmkaply: by primary UI - do you mean not in settings, but the main browser UI?
20:32nalexandermkaply: there are page actions, which can be controlled by addons. (At least, they used to be able to.)
20:32ahuntIIRC addons can add menu items (is that different from page actions), but that might not be what youre looking for?
20:32mkaplyahunt: Yeah,not in settings. I was trying to come up with some way to make it at least "nice"
20:33mkaplyFirefox iOS does their homepage settings pretty cool, with a home button that sets the homepage when there is no homepage to start.
20:33mkaplyBut we don't really have a place to put a home button
20:33mkaplynalexander: The problem with page actions is that it would be on the URL bar for everything. But I guess that's an option.
20:33nalexandermkaply: how would you expose something in "primary UI" that's not visible all the time?
20:33nalexanderIf it's not visible, how do you get to it?
20:34nalexanderIsn't that what menus are for?
20:34mkaplySorry, I mean not in settings UI. Not hidden.
20:34mkaplyLet me pull up the exact require,ent
20:34mkaplyUsers must be able to set a web page as their browser home page as an option immediately available in the main menu list or the Bookmarks interface.
20:34mkaplySo it can be in the menu. I wasn't sure about adding yet another menuitem. Our menu is huge as it is
20:35nalexanderAdding to bookmarks requires Java and XML changes. Menu doesn't, so it's generally preferable for distros.
20:37ahunt(IIRC nechen was doing some bookmarks rework (possibly redesign), so it might at least be worth mentioning the idea, if you do want to go that route/have the time to wait)
20:39ahuntEven if its a addon-added menu item - wouldnt java changes still be needed to actually set the homepage?
20:41mkaplyYeah, apparently Fennec doesn't use browser.startup.homepage
20:42mkaplyFree up space by removing the back button like Chrome does (since on Android, it's duplicated)
20:43mkaplyAdd a home icon :)
20:44ahuntmkaply: IIRC telemetry suggests the back button is quite well used (we did talk about removing it at one point)
20:48rbarkerI still don't understand the android back button. It feels like the result are random.
20:50snorprbarker: heh
21:08mkaplyI wonder if a long press Home button to set the homepage would be discoverable.
21:09mkaplyrbarker: Well if an app doesn't implement it right :)
21:12mkaplyWow we have a lot of menus
21:13mkaplywhere is home_context_menu.xml used?
21:13mkaplyIs menu-large used for tables?
21:19kbrosnanlong press on home is owned by google for their context aware stuff
21:20ahuntmkaply: home_contextmenu looks like the long-press menu for top-sites/history/bookmarks/etc
21:21mkaplyahunt: Yep. It looks like the best place to do this is the same places where we have contextmenu_add_to_launcher.
21:21ahunt(Depending on context, some items are disabled, e.g. pin and edit are available only for topsites)
21:21mkaplyPage sub menu, bookmarks popup, long press on URL bar
21:22ahuntAnd yeah - we move some items into the URL bar on different tablet sizes (e.g. refresh, possibly back/forward), so they get removed from the menu depending on device size
22:03mkaplyahunt: I was certainly overthinking that. We already expose "add to home screen" in certain places, and this belongs in those same places. bug 1348412
22:03firebot NEW, Add a menu for setting the homepage
22:39rbarkerjchen: ping?
22:40jchenrbarker: pong
22:40rbarkerjchen: threading question :)
22:42rbarkerjchen: Is it bad if I have a member variable that I read and write in one thread then only read in another? I make a copy of it in the read only thread at the start of the function and then use that value in the function (if that makes sense) I know this works on x86 but arm still surprises me.
22:44rbarkerjchen: I guess I should just always lock around accessing the variable shouldn't I?
22:44jchenrbarker: i assume you want the read only thread to have the "latest" value?
22:44jchenrbarker: Atomic should work here :)
22:45rbarkerjchen: sort of, actually I don't want to know if the value changes while I'm using it, hence the copy.
22:45snorpatomic is fine for that
22:45rbarkerjchen: if it changes while the function is using the "cached" value, the new value will be dealt with on the next pass.
22:46rbarkerjchen: but I guess if it isn't atomic, the cpu cache could be stale?
22:46snorpyeah or optimizations could change ordering, etc
22:47rbarkerI don't see the ordering thing.
22:48rbarkerI only read it once per-tick in the read-only thread.
22:48snorpit *might* work without atomic but not guaranteed
22:48rbarkerbut I'll make it atomic.
22:48jchenrbarker: i would use Atomic. otherwise i think it'll be fine practically, but there's no guarantee that the read-only thread will ever see the change, if the cache never gets flushed
22:49snorpyeah that.
22:49snorpcache invalidation is hard :)
22:49rbarkerYeah, I get the CPU cache part.
22:50rbarkerI'm half tempted to have one class in each thread and message pass between them. Nothing has to be synchronous any way...
22:50rbarkerBut I would have to re-write it so...
18 Mar 2017
No messages
Last message: 159 days and 8 hours ago