Closed Bug 1257935 Opened 8 years ago Closed 8 years ago

Get keyboard app working as chrome

Categories

(Firefox OS Graveyard :: Gaia::System::Input Mgmt, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gerard-majax, Assigned: apastor)

References

Details

(Whiteboard: fixed-in-pine)

Attachments

(4 files, 3 obsolete files)

03-18 16:17:04.210  2325  2325 E GeckoConsole: [JavaScript Error: "TypeError: this.inputLayouts.layouts[group] is undefined" {file: "chrome://gaia/content/system/js/keyboard_manager.js" line: 164}]
03-18 16:17:04.210  2325  2325 E GeckoConsole: km_activateKeyboard@chrome://gaia/content/system/js/keyboard_manager.js:164:1
03-18 16:17:04.210  2325  2325 E GeckoConsole: km_handleInputContextFocus@chrome://gaia/content/system/js/keyboard_manager.js:199:5
03-18 16:17:04.210  2325  2325 E GeckoConsole: km_handleEvent@chrome://gaia/content/system/js/keyboard_manager.js:215:9
03-18 16:17:04.210  2325  2325 E GeckoConsole: MozInputMethodManager.prototype.handleFocus@jar:file:///system/b2g/omni.ja!/components/MozKeyboard.js:236:20
03-18 16:17:04.210  2325  2325 E GeckoConsole: mozInputMethodReceiveMsg@jar:file:///system/b2g/omni.ja!/components/MozKeyboard.js:523:9
Assignee: lissyx+mozillians → nobody
Assignee: nobody → apastor
Attached patch kb-pine.patch (obsolete) — Splinter Review
That's what I did, but I'm not sure if it breaks something else :/
Attachment #8734320 - Flags: feedback?(lissyx+mozillians)
Attachment #8734320 - Flags: feedback?(fabrice)
Comment on attachment 8734320 [details] [diff] [review]
kb-pine.patch

Review of attachment 8734320 [details] [diff] [review]:
-----------------------------------------------------------------

This has no chances to be merged back in m-c, so I'd rather not take that hack.
Let's see if we need MOZ_CHILD_PERMISSIONS at all on desktop e10s for instance.
Attachment #8734320 - Flags: feedback?(fabrice) → feedback-
Attachment #8734320 - Flags: feedback?(lissyx+mozillians)
I'm gonna take a look at that today.
Attached patch keyboard.patch (obsolete) — Splinter Review
I added a "in chrome" flag to the OriginAttributes since this is what is used for these kind of checks.

The indexedDB change is needed because the keyboard app itself needs indexedDB. I haven't checked with regular web content, and I would not be surprised if this doesn't work for these frames. If this is the case, we should juts do what desktop e10s is doing, which is just not setting MOZ_CHILD_PERMISSIONS...
Attachment #8734320 - Attachment is obsolete: true
Attachment #8735666 - Flags: feedback?(lissyx+mozillians)
Comment on attachment 8735666 [details] [diff] [review]
keyboard.patch

Review of attachment 8735666 [details] [diff] [review]:
-----------------------------------------------------------------

I'm not able to get the keyboard to show up in Mulet, and while I do see keys when typing them, I still see errors:
> XXX FIXME : Dispatch a mozChromeEvent: inputmethod-contextchange
> XXX FIXME : Dispatch a mozChromeEvent: inputmethod-contextchange
> JavaScript error: chrome://gaia/content/system/js/keyboard_manager.js, line 164: TypeError: this.inputLayouts.layouts[group] is undefined
> MozKeyboard.js: A frame with input-manage permission did not handle the inputcontextfocus event dispatched.
> XXX FIXME : Dispatch a mozChromeEvent: inputmethod-contextchange
> XXX FIXME : Dispatch a mozChromeEvent: inputmethod-contextchange
> XXX FIXME : Dispatch a mozChromeEvent: inputmethod-contextchange
> JavaScript error: chrome://gaia/content/system/js/keyboard_manager.js, line 164: TypeError: this.inputLayouts.layouts[group] is undefined
> MozKeyboard.js: A frame with input-manage permission did not handle the inputcontextfocus event dispatched.

Is it expected? Or you only hacked on device?
Attachment #8735666 - Flags: feedback?(lissyx+mozillians)
Did you patch gaia as well with the attached patch?
Flags: needinfo?(lissyx+mozillians)
No, I forgot :)
Flags: needinfo?(lissyx+mozillians)
Blocks: 1261025
No longer blocks: 1252143
Summary: No keyboard working → Get keyboard app working as chrome
Comment on attachment 8735666 [details] [diff] [review]
keyboard.patch

Review of attachment 8735666 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/inputmethod/MozKeyboard.js
@@ +688,5 @@
> +      dump('MozKeyboard.jsm: no system app startup url set (pref is b2g.system_startup_url)');
> +    }
> +
> +    // FIXME: as in shell.js, the pref does not include /index.html yet.
> +    systemAppIndex = 'chrome://gaia/content/system/index.html';

I am fixing this in bug 1260992
Ok, no keyboard gets displayed when focusing in rocketbar, but long pressing home and then opening a new window, focusing in the address bar, keyboard gets displayed, and we can switch between all of them. I could type chars.
>  -*- Shell.js: Failed to get key: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://b2g/content/shell.js :: checkReloadKey :: line 520"  data: no]

Everytime I tap on a key :)
Attached image 2016-03-31-16-18-56.png
this is on device when focusing in the address bar
I talked to mrbkap and he confirmed that we can get rid of MOZ_CHILD_PERMISSIONS. That means that we don't need the mInChrome flag either!
Attachment #8735666 - Attachment is obsolete: true
Attachment #8734323 - Attachment is obsolete: true
Attachment #8737791 - Flags: review?(bfrancis)
Comment on attachment 8737791 [details] [review]
[gaia] albertopq:1257935-kb > mozilla-b2g:kanikani

Thanks
Attachment #8737791 - Flags: review?(bfrancis) → review+
Comment on attachment 8737401 [details] [diff] [review]
keyboard.patch v2

Review of attachment 8737401 [details] [diff] [review]:
-----------------------------------------------------------------

looks good, testing this
Attachment #8737401 - Flags: review+
On mulet
Comment on attachment 8737401 [details] [diff] [review]
keyboard.patch v2

Review of attachment 8737401 [details] [diff] [review]:
-----------------------------------------------------------------

testing shows errors, looks like we need more work: 
4-05 15:33:11.538   321   321 I Gecko   : NeckoParent::AllocPHttpChannelParent: FATAL error: App does not have permission: KILLING CHILD PROCESS
04-05 15:33:11.538   321   321 I Gecko   : 
04-05 15:33:11.538   321   321 I Gecko   : ###!!! [Parent][DispatchAsyncMessage] Error: (msgtype=0xA20005,name=PNecko::Msg_PHttpChannelConstructor) Value error: message was deserialized, but contained an illegal value
04-05 15:33:11.538   321   321 I Gecko   : 
04-05 15:33:11.538   321   597 I Gecko   : [Parent 321] WARNING: waitpid failed pid:1381 errno:10: file /home/alex/codaz/Mozilla/gecko-cinnabar/ipc/chromium/src/base/process_util_posix.cc, line 272
04-05 15:33:11.538   321   920 I Gecko   : 
04-05 15:33:11.538   321   920 I Gecko   : ###!!! [Child][MessageChannel] Error: (msgtype=0x440003,name=PCompositorBridge::Msg_DidComposite) Channel error: cannot send/recv
04-05 15:33:11.538   321   920 I Gecko   : 
04-05 15:33:11.538   321   920 I Gecko   : 
04-05 15:33:11.538   321   920 I Gecko   : ###!!! [Child][MessageChannel] Error: (msgtype=0x440003,name=PCompositorBridge::Msg_DidComposite) Channel error: cannot send/recv
04-05 15:33:11.538   321   920 I Gecko   : 
04-05 15:33:11.578   321   321 I Gecko   : 
04-05 15:33:11.578   321   321 I Gecko   : ###!!! [Parent][MessageChannel] Error: (msgtype=0x2C005F,name=PBrowser::Msg_Activate) Channel error: cannot send/recv
04-05 15:33:11.578   321   321 I Gecko   : 
04-05 15:33:11.578   321   321 I Gecko   : 
04-05 15:33:11.578   321   321 I Gecko   : ###!!! [Parent][MessageChannel] Error: (msgtype=0x2C0001,name=PBrowser::Msg_AsyncMessage) Channel error: cannot send/recv
04-05 15:33:11.578   321   321 I Gecko   : 
04-05 15:33:11.598   321   321 I Gecko   : 
04-05 15:33:11.598   321   321 I Gecko   : ###!!! [Parent][MessageChannel] Error: (msgtype=0x2C005D,name=PBrowser::Msg_UpdateDimensions) Channel error: cannot send/recv
04-05 15:33:11.598   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ###!!! [Parent][OnMaybeDequeueOne] Error: Channel error: cannot send/recv
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ###!!! [Parent][OnMaybeDequeueOne] Error: Channel error: cannot send/recv
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ###!!! [Parent][OnMaybeDequeueOne] Error: Channel error: cannot send/recv
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ###!!! [Parent][OnMaybeDequeueOne] Error: Channel error: cannot send/recv
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ###!!! [Parent][OnMaybeDequeueOne] Error: Channel error: cannot send/recv
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ###!!! [Parent][OnMaybeDequeueOne] Error: Channel error: cannot send/recv
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ###!!! [Parent][MessageChannel] Error: (msgtype=0xA,name=PAPZ::Msg_AcknowledgeScrollUpdate) Channel error: cannot send/recv
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ###!!! [Parent][MessageChannel] Error: (msgtype=0x2C0076,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv
04-05 15:33:11.628   321   321 I Gecko   : 
04-05 15:33:11.628   321   321 I Gecko   : ############ ErrorPage.js
04-05 15:33:11.638   321   321 I Gecko   : 
04-05 15:33:11.638   321   321 I Gecko   : ###!!! [Parent][MessageChannel] Error: (msgtype=0x2C0076,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv
04-05 15:33:11.638   321   321 I Gecko   : 
04-05 15:33:11.798   321   321 E OomLogger: [Kill]: lowmem_shrink: convert oom_adj to oom_score_adj:
Attachment #8737401 - Flags: review+
Blocks: 1262180
Comment on attachment 8737401 [details] [diff] [review]
keyboard.patch v2

Review of attachment 8737401 [details] [diff] [review]:
-----------------------------------------------------------------

Ok, let's fix Necko in a follow up.
Attachment #8737401 - Flags: review+
https://hg.mozilla.org/projects/pine/rev/3ded770346e7
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: fixed-in-pine
Blocks: 1286190
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: