B2G/MarketCustomizations: Difference between revisions

Line 51: Line 51:
SIM card specific customizations are included at build time, but applied at runtime during the First Time Usage experience, or when a SIM card is inserted for the first time.
SIM card specific customizations are included at build time, but applied at runtime during the First Time Usage experience, or when a SIM card is inserted for the first time.


== Buildtime Customization ==
== Buildtime Customization (gaia/distribution) ==
 
=== power/ ===
=== power/ ===
Custom power on/off animations (or static images) are included here. Files can be MP4 for animations or PNG for static images.
Custom power on/off animations (or static images) are included here. Files can be MP4 for animations or PNG for static images.


Line 74: Line 73:


=== wallpapers/ ===
=== wallpapers/ ===
customized wallpapers, define the wallapers in list.json
Custom wallpapers (PNG files) should be included here and listd in list.json.


=== browser ===
=== calendar.json ===
customized bookmarks. Will overwrite init.json file in browser.app (further explained in runtime customization)
 
=== calendar ===
Calendar provider information. Specifying your own Google Oauth credentials is required.
Calendar provider information. Specifying your own Google Oauth credentials is required.


we need `Calendar CalDav` API but not `Calendar` API, which is only available for whitelist developer.
Calendar CalDav API access is needed, which is only available for whitelisted developers. API usage is limited to 1,000,000 requests/day.
The limit is 1,000,000/day.


It means if vendors want to use their account to generate the API key,
If vendors want to use their account to generate the API key, they need to apply using this form first to get access to the Calendar CalDav API: https://developers.google.com/google-apps/calendar/caldav
they need to applied this form first to get access permission to `Calendar CalDav` API
https://developers.google.com/google-apps/calendar/caldav
 
After google add their account into whitelist, vendors are able to get Key for `Calendar CalDav`.


After your account is whitelisted by Google, vendors are able to get a key for the Calendar CalDav API.


Steps:
Steps:


1. (Use OEM's account) enter API console
1. (Using OEM's account) Open the API console:
https://code.google.com/apis/console/b/0
https://code.google.com/apis/console/b/0


2. create a project, enable `calendar caldev API` in `service` tab
2. Create a project and enable `Calendar CalDAV API` in the `Service` tab.


3. click `API Access` tab
3. Click on the `API Access` tab.


4. click `Create an OAuth 2.0 client ID`, Add Product name & logo (will shown in calendar google account authentication page)
4. Click on `Create an OAuth 2.0 client ID`, Add Product name & logo (will be shown in the Google Calendar authentication page)


5. select `Application type` to `Installed application`, `Other`, then create the key.
5. Set `Application type` to `Installed application`, `Other`, then create the key.


6. Click `edit settings`
6. Click `Edit settings` and change `Authorized Redirect URIs` to 'https://oauth.gaiamobile.org/authenticated'
change `Authorized Redirect URIs` to 'https://oauth.gaiamobile.org/authenticated'


7. change client ID and Client secret to customize build's `calendar.json` file
7. Change `Client ID` and `Client Secret` to the id (client_id) and secret (client_secret) used in the `calendar.json` file.


=== contacts ===
=== contacts.json ===
customized contacts
Contacts listed here will be included in the phone's contacts database. For SIM-card dependent customizations, see the Runtime Customization section. See the [https://wiki.mozilla.org/WebAPI/ContactsAPI Contacts API page] for details on the layout of Contacts objects. Here's an example contacts.json file:
[
  {
    "name": ["John Doe"],
    "givenName": ["John"],
    "familyName": ["Doe"],
    "nickname": ["Johnny"],
    "category": ["Work", "Racing Team"],
    "bday": "1980-06-01",
    "email": [
      {
        "type": ["personal"],
        "value": "john.doe@example.org",
        "pref": true
      },
      {
        "type": ["work"],
        "value": "jdoe@example.com"
      }
    ],
    "adr": [
      {
        "type": ["personal"],
        "streetAddress": "123 Foopy St.",
        "locality": "San Francisco",
        "region": "Downtown",
        "postalCode": "94030",
        "countryName": "US"
      }
    ]
  },
  {
    "name": ["CarrierX"],
    "email": [
      {
        "type": ["work"],
        "value": "support@carrierx.com",
      }
    ],
    "url": [
      {
        "type": ["work"],
        "value": "https://www.carrierx.com"
      }
    ]
  }
]


=== costcontrol ===
=== homescreens.json ===
customized costcontrol. Will overwrite config.json file in costcontrol.app
Use this file to define what apps to show in the homescreens, and in which order. For example:


=== homescreens ===
{"homescreens": [
list all bundled apps
  [
    ["apps", "communications", "dialer"],
    ["apps", "sms"],
    ["apps", "browser"],
    ["apps", "camera"]
  ]
]}


=== network types ===
=== network.json (not in customization folder) ===
Set supported network types of the device. Firefox OS supports the following types:
Set the supported network types of the device. Firefox OS supports the following types:
* 'wcdma/gsm' (WCDMA preffered)
* 'wcdma/gsm' (WCDMA preffered)
* 'gsm'
* 'gsm'
Line 132: Line 175:
ex: {"types": ["cdma/evdo", "cdma", "evdo"]}
ex: {"types": ["cdma/evdo", "cdma", "evdo"]}


=== sensors ===
=== sensors.json ===
sensor capabilities
Define sensor capabilities of the device. By default it is:
{ "ambientLight": true }


=== settings ===
=== settings.json ===
set default wallpaper/ringtones, lockscreen enable/disable, bluetooth on/off.. etc
Set default wallpaper/ringtones, lockscreen enable/disable, bluetooth on/off, etc.


=== sms-blacklist ===
=== sms-blacklist ===
customized sms blocklist, blocks senders in this file. Will overwrite blacklist.json file in sms.app
Custom SMS blocklist, blocks senders in this file. Will overwrite blacklist.json file in the SMS app.


=== cellbroadcast ===
=== cellbroadcast ===
Line 157: Line 201:
Default settings are available in [https://mxr.mozilla.org/gaia/source/shared/resources/apn/operator_variant.xml operator_variant.xml].
Default settings are available in [https://mxr.mozilla.org/gaia/source/shared/resources/apn/operator_variant.xml operator_variant.xml].


=== support ===
=== support.json ===
support contacts (include online support & tel support). Will overwrite support.json in settings.app
Support contacts (include online support & tel support). Will overwrite support.json in the Settings app.


Note if you provide an customize file, these customization will overwrite the default settings. So if you want to keep default settings and add some extra resources. You should copy those settings from build-in apps and add your own customization upon them.
Note that these customization will overwrite the default settings, so if you want to keep default settings and add some extra resources, you should copy those settings from the built-in apps and add your own customization upon them.


Following is an example:
Following is an example:
Line 181: Line 225:
  }
  }


FYR:
The build script is in [https://github.com/mozilla-b2g/gaia/blob/master/build/applications-data.js build/applications-data.js]
The build script is in [https://github.com/mozilla-b2g/gaia/blob/master/build/applications-data.js build/applications-data.js]


Confirmed users
100

edits