Firefox OS/Remote Control: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Update secure connection concept)
No edit summary
Line 1: Line 1:
== Introduction ==
== Introduction ==
Meta Bug: {{Bug|1205939}}
Meta Bug: {{Bug|1205939}}
== UX & Visual Spec ==
UX: https://drive.google.com/folderview?id=0B5RN80W56Ga9Qkp1Mm5TTlNMTlE&usp=drive_web
Visual: https://drive.google.com/folderview?id=0B2-G3kew1WpXfjZFTE93cVBGazFNd0NtVnZzbGlUdTNMSUNVdS12MjJla21oMksxNjVmWW8&usp=sharing


== Architecture Designs ==
== Architecture Designs ==

Revision as of 08:04, 26 October 2015

Introduction

Meta Bug: bug 1205939

UX & Visual Spec

UX: https://drive.google.com/folderview?id=0B5RN80W56Ga9Qkp1Mm5TTlNMTlE&usp=drive_web

Visual: https://drive.google.com/folderview?id=0B2-G3kew1WpXfjZFTE93cVBGazFNd0NtVnZzbGlUdTNMSUNVdS12MjJla21oMksxNjVmWW8&usp=sharing

Architecture Designs

Ajax Protocol

Touch Events

 {
   type: 'touchstart',
   detail: {
     width: <touch panel width, integer, in pixels>,
     height: <touch panel height, integer, in pixels>,
     identifier: <A simple unique identifier for server to distinguish touch events between different clients, string>
   }
 }
 {
   type: 'touchmove',
   detail: {
     dx: <dx between current point and starting point, integer, in pixels>,
     dy: <dy between current point and starting point, integer, in pixels>,
     identifier: <should be identical with "touchstart">,
     duration: <duration from "touchstart", integer, in milliseconds>
   }
 }
 {
   type: 'touchend',
   detail: {
     dx: <same as "touchmove">,
     dy: <same as "touchmove">,
     identifier: <should be identical with "touchstart">,
     duration: <same as "touchmove">,
     swipe: <the gesture within this touch, string, should be "left", "right", "up" and "down">
   }
 }

Scroll Events

There are "scrollstart", "scrollmove" and "scrollend" events which details are all identical with corresponding touch events above.

Key Events

 {
   type: 'keypress',
   detail: <KeyEvent constant, string, sush as "DOM_VK_RETURN">
 }

Input Events

 {
   type: 'input',
   detail: {
     clear: <whether to clear the entire string in the current focused input field, boolean>,
     string: <new string to append, string>,
     keycode: <a specified key to be pressed after the string inputted, integer>
   }
 }

Pairing

Meta Bug: bug 1207996

Flowchart

First Time Connection

RemoteControl FirstConnect.png

Enter PIN Code

RemoteControl EnterPIN.png

Resume Connection

RemoteControl ResumeConnection.png

Dismiss Pairing

RemoteControl DismissPairing.png

Protocol

from client to server via AJAX

 {
   pincode: <pincode>
 }

response when success

 {
   verified: true,
   uuid: <uuid>
 }

reponse when error

 {
   verified: false,
   reason: 'expired' / 'invalid'
 }

internal events at server side

 {
   type: 'mozChromeRemoteControlEvent',
   detail: {
     action: 'pin-created',
     pincode: <pincode>
   }
 }
 {
   type: 'mozChromeRemoteControlEvent',
   detail: {
     action: 'pin-destroyed'
   }
 }
 {
   type: 'mozContentEvent',
   detail: {
     type: 'remote-control-pin-dismissed',
     detail: {
       reason: 'timeout' / 'manually'
     }
   }
 }

Secure Connection

To protect private data between user and TV, we provide a secure connection which refers to SSL and jCryption. Here is the concept:

  1. Client requests RSA public key from TV.
  2. Client sends symmetric key and PIN code (if any) to TV, encrypted with public key.
  3. TV decrypts symmetric key with private key
  4. TV generates an UUID, encrypts with symmetric key then sends 2 UUIDs to client, one is encrypted the other is not.
  5. Client decrypts UUID with symmetric key, confirm UUID
  6. Begin remote control with symmetric key.

Goal of Remote Control is to create an easy to use way for every device, we hide public key exchange at the background. User doesn't need to input a long URL with public key nor scan QRCode. Everything is done automatically without interrupting user experience.

No PIN code pairing

With PIN code pairing

Bug Status

Top blockers of bug 1205939 - [TV][2.5][meta][TV side] Remote Control

Full Query
ID Priority Component Assigned to Summary Status Target milestone Feature b2g
1192806 P1 Gaia::TV Eric Tsai (no more review request accepted) [TV 2.5] [meta] Prototyping TV remote control RESOLVED FxOS-S7 (18Sep) 2.5+
1193345 P2 Gaia::TV Tori Chen [:tori] [UX][TV][2.5] (TV Side) Remote Control RESOLVED FxOS-S8 (02Oct) 2.5+
1197749 P1 Gaia::TV::System Eric Tsai (no more review request accepted) [TV][2.6] Receive keyboard/pointer event from client in remote control service RESOLVED --- ---
1197751 P1 General Eric Tsai (no more review request accepted) [TV][2.6] Write a event shuttle in Gecko RESOLVED --- ---
1203048 P1 Gaia::TV::System Luke Chang [:lchang] (inactive) [TV 2.5] Draw a mock mouse cursor in the smart-system app RESOLVED --- ---
1204806 -- Widget: Gonk Eric Tsai (no more review request accepted) [TV 2.6] Draw cursor while virtual mouse is connected to TV RESOLVED FxOS-S2 (10Jul) ---
1207971 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5][meta] Provide a TV remote control app RESOLVED --- 2.5+
1207996 -- Gaia::TV::System Eric Tsai (no more review request accepted) [TV] Implement JPAKE authentication over TLS socket server RESOLVED --- ---
1208006 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5][meta] Implement a client-side page for TV remote control RESOLVED --- 2.5+
1212385 -- Gaia::TV::System Luke Chang [:lchang] (inactive) [TV][2.6][meta] Remote Control features in Smart System RESOLVED --- ---
1215457 P1 Gaia::TV::System [TV 2.5][meta] Secure connection between remote control server and client RESOLVED --- ---
1222306 -- Gaia::TV::System Eric Tsai (no more review request accepted) [TV 2.5] Expose remote control service via mDNS RESOLVED --- ---
1223387 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5][meta] Revise Remote Control string base on copy review result RESOLVED --- 2.5+
1227092 -- Gaia::TV::System The "window.confirm()" dialog shows two "OK" buttons on TV incorrectly RESOLVED --- ---
1227808 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5] Change the settings of Authorized Devices in Remote Control feature to a simple object instead of a serialized string RESOLVED --- ---
1235511 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5] Add the permission to let web components work correctly in the remote control app RESOLVED --- ---
1236808 P1 Gaia::TV Fischer [:Fischer] [TV][2.5] Remove remote control apps from both engineering and production building lists on TV 2.5 branch RESOLVED 2.6 S5 - 1/15 ---
1271220 -- Gaia::TV::Home Luke Chang [:lchang] (inactive) [TV][System] Remove the settings observer in the remote control module RESOLVED --- ---
1282373 P1 Gaia::TV Eric Tsai (no more review request accepted) [TV 2.6][Remote Control] TV removes pairing record if client didn't connect in last 30 days RESOLVED --- ---

19 Total; 0 Open (0%); 19 Resolved (100%); 0 Verified (0%);


Top blockers of bug 1207971 - [TV 2.5][meta] Provide a TV remote control app

Full Query
ID Priority Component Assigned to Summary Status Target milestone Feature b2g
1203853 -- Gaia::TV Luke Chang [:lchang] (inactive) Provide a QR code on the remote control app on TV RESOLVED --- 2.5+
1208003 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5] Implement the functionalities of the TV remote control app RESOLVED --- 2.5+
1212402 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5] Apply visual spec to the TV remote control app RESOLVED --- ---

3 Total; 0 Open (0%); 3 Resolved (100%); 0 Verified (0%);


Top blockers of bug 1208006 - [TV 2.5][meta] Implement a client-side page for TV remote control

Full Query
ID Priority Component Assigned to Summary Status Target milestone Feature b2g
1212403 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5] Apply visual spec to the client-side page of TV remote control RESOLVED --- ---
1212407 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5] Implement the functionalities of the client-side page of TV remote control RESOLVED --- ---
1215075 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5] Implement a pairing page on the client-side RESOLVED --- ---
1218682 -- Gaia::TV Luke Chang [:lchang] (inactive) [TV 2.5] Improve the input function in remote control client by one-way sync RESOLVED --- ---

4 Total; 0 Open (0%); 4 Resolved (100%); 0 Verified (0%);


Top blockers of bug 1212385 - [TV 2.5][meta] Remote Control features in Smart System

Full Query
ID Priority Component Assigned to Summary Status Target milestone Feature b2g
1203045 P2 Gaia::TV::System Luke Chang [:lchang] (inactive) [TV 2.5] Dispatch input messages via mozInputMethod API in server side RESOLVED --- 2.5+
1203048 P1 Gaia::TV::System Luke Chang [:lchang] (inactive) [TV 2.5] Draw a mock mouse cursor in the smart-system app RESOLVED --- ---
1207995 -- Gaia::TV::System Luke Chang [:lchang] (inactive) [TV 2.5] Provide remote control service current control mode RESOLVED FxOS-S10 (30Oct) 2.5+
1214993 -- Gaia::TV::System Luke Chang [:lchang] (inactive) [TV 2.5] "sendKeyEvent" doesn't work when sending "DOM_VK_HOME" to trigger homescreen RESOLVED --- ---
1215076 -- Gaia::TV::System Luke Chang [:lchang] (inactive) [TV 2.5] Implement the remote control pairing notification in TV system RESOLVED --- ---

5 Total; 0 Open (0%); 5 Resolved (100%); 0 Verified (0%);