Personal tools

B2G/MarketCustomizations

From MozillaWiki

< B2G
Jump to: navigation, search

NOTE: This guide has now been moved to MDN; you should look there for the most current update. See https://developer.mozilla.org/en-US/Firefox_OS/Hacking_Firefox_OS/Market_customizations_guide.

Contents

Customization Overview

Since 1.0.1, Firefox OS use the same mechanism as firefox for customization.

You can download the gaia-distribution-sample.zip to check what can be done with build-time customization. (Send PR to us if you see something changed but not updated)

Below is the tree structure for customize-sample.zip:

 customize-sample
 ├── power
 │   ├── carrier_power_on.png
 │   └── carrier_power_off.png
 ├── ringtones
 │   ├── list.json
 │   └── ringer_dream_theme.ogg
 ├── wallpapers
 │   ├── customize.png
 │   └── list.json
 ├── browser.json
 ├── calendar.json
 ├── contacts.json
 ├── costcontrol.json
 ├── homescreens.json
 ├── network.json
 ├── sensors.json
 ├── settings.json
 ├── sms-blacklist.json
 ├── support.json
 ├── wapuaprof.json 
 └── apps.list


Note that all files are optional. If you don't provide that file, it will fallback to the system defaults.

Steps to Apply Customization

To apply gaia-distribution-sample.zip to Gaia:

  1. Unzip gaia-distribution-sample.zip, assume path is <DISTRIBUTION_PATH>
  2. Clone gaia source code from https://github.com/mozilla-b2g/gaia
  3. You can either put the customization data in GAIA_DIR/distribution/
  4. Or you can specify the location with the GAIA_DISTRIBUTION_DIR environment variable, like this:
   GAIA_DISTRIBUTION_DIR=<DISTRIBUTION_PATH> make production

If a Firefox OS device is connected, you will get a Gaia build with customizations applied.

Note that some customizations are done by the Gaia build scripts. Check Hacking Gaia for Build Script customization.

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 (gaia/distribution)

power/

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

Valid file names are:

  • carrier_power_on.png
  • carrier_power_on.mp4
  • carrier_power_off.png
  • carrier_power_off.mp4

ringtones/

Custom ringtones are included here. list.json should contain the filenames of the ringtones, like this:

 {
   "ringer_classic_courier.opus": "",
   "ringer_dream_theme.ogg": "",
   "ringer_loud_windchimes.opus": "",
   "ringer_bitbounce.opus": ""
 }

Custom ringtones are selectable through 'system ringtones' in settings sound menu. Moreover, default ringtone must be set in settings.json.

wallpapers/

Custom wallpapers (PNG files) should be included here and listed in list.json.

Custom wallpapers can be selected through wallpaper folder. Moreover, default wallpaper must be set in settings.json.

calendar.json

Calendar provider information. Specifying your own Google Oauth credentials is required.

Calendar CalDav API access is needed, which is only available for whitelisted developers. API usage is limited to 1,000,000 requests/day.

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

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

Steps:

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

2. Create a project and enable `Calendar CalDAV API` in the `Service` tab.

3. Click on the `API Access` tab.

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

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

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

7. Change `Client ID` and `Client Secret` to the id (client_id) and secret (client_secret) used in the `calendar.json` file.

contacts.json

Contacts listed here will be included in the phone's contacts database. For SIM-card dependent customizations, see the Runtime Customization section. See the 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"],
    "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"
      }
    ]
  }
]

homescreens.json

Apps

Use this file to define what apps to show in the homescreens, and in which order. For example:

{"homescreens": [
  [
    ["apps", "communications", "dialer"],
    ["apps", "sms"],
    ["apps", "browser"],
    ["apps", "camera"]
  ]
]}

Smart Collections

Smart Collections were introduced in version 1.3.

Predefined Collections

By default, 4 Collections are predefined to reside in the first page of the homescreen. Similarly to Apps, this can be edited in homescreens.json as it's possible to define what Collections to load, what pages they should appear in and in what order. For example:

{"homescreens": [
  [
    ["apps/homescreen/collections", "social"],
    ["apps/homescreen/collections", "games"],
    ["apps/homescreen/collections", "music"],
    ["apps/homescreen/collections", "showbiz"]
  ], [
    ["apps", "communications", "dialer"],
    ["apps", "sms"],
    ["apps", "browser"],
    ["apps", "camera"]
  ]
]}

Note that Collection names are written in lowercase

Additional Collections can be chosen from the following list:

  • Showbiz (discover entertainment apps)
  • Funny (enjoy with latests funny apps)
  • Games (play games online)
  • Local (what's happening around you?)
  • Music (Listen to favorite songs)
  • News (keep updated with your world news sources)
  • Shopping (follow trends)
  • Social (follow you social networks in everywhere)
  • Sports (the best apps about sports)
  • TV (apps related to media)
What collections contain

Collections are composed of

  • Local Apps:
    • Defined in build time by means of manifest files
    • Where are these manifests defined?
      • /apps/homescreen/collections/<collectionName>/manifest.collection
    • How can we define the set of local apps for each one?
      • This is an example for the social collection which contains dialer, sms, contacts and email apps (same mechanism to define apps in homescreens)
{
 "name": "Social",
 "role": "collection",
 "provider_id": "289", // adaptive search identifier
 "apps": [
   ["apps", "communications", "dialer"],
   ["apps", "sms"],
   ["apps", "communications", "contacts"],
   ["apps", "email"]
 ],
 "default_locale": "en-US",
 "icons": {
   "60": "/collections/social/icon.png",
   "90": "/collections/social/icon@1.5x.png",
   "120": "/collections/social/icon@2x.png"
 }
}
  • Remote Apps
    • Supplied by the adaptive search provider in runtime (when online)
How to translate collections

The translations have to be defined in locale files in within the homescreen app

  • apps/homescreen/locales/collections.<langCode>.properties

network.json (not in customization folder)

This will not support in 1.4.

Set the supported network types of the device. Firefox OS supports the following types:

  • 'wcdma/gsm' (WCDMA preffered)
  • 'gsm'
  • 'wcdma'
  • 'wcdma/gsm-auto' (GSM preffered)
  • 'cdma/evdo' (CDMA preffered)
  • 'cdma'
  • 'evdo'
  • 'wcdma/gsm/cdma/evdo' (Automatic)

ex: {"types": ["cdma/evdo", "cdma", "evdo"]}

sensors.json

Define sensor capabilities of the device. By default it is:

{ "ambientLight": true }

settings.json

Set default wallpaper/ringtones, lockscreen enable/disable, bluetooth on/off, etc. You can reference build/config/common-settings.json to customize your settings.json, everything in common-settings.json can be overwrote in GAIA_DISTRIBUTION_DIR/settings.json, for example you can set |wifi.enabled| false to disable wifi by default.

sms-blacklist

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

cellbroadcast

Listening Channels:

  • availability:
    • runtime: Settings - "ril.cellbroadcast.searchlist"
  • type: string,
  • valid format: \d(-\d)?(,\d(-\d))*

Disable event reporting:

  • availability:
    • run time: Settings - "ril.cellbroadcast.disabled"
    • build time: Preference - "ril.cellbroadcast.disabled"
  • type: boolean,
  • meaning: true to completely shutdown Cell Broadcast reporting.

Default settings are available in operator_variant.xml.

support.json

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

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:

{
  "onlinesupport": {
    "href": "http://support.mozilla.org/",
    "title": "Mozilla Support"
  },
  "callsupport": [
    {
      "href": "tel:12345678",
      "title": "Call Support 1"
    },
    {
      "href": "tel:87654321",
      "title": "Call Support 2"
    }
  ]
}

The build script is in build/applications-data.js

WAP user agent profile (wapuaprof)

WAP user agent profile will overrides the user agent information when sending WAP packets. If you want to override WAP user agent profile based on MCC/MNC, you can use this one to do it (further explained in runtime customization).

Runtime Customization

Browser Bookmarks & Default Search Engine

The default bookmarks and default search engine can be customised at build time, with different variants for each country and network in a single build. The customised data is inserted into the browser app the first time it is run, based on the MCC and MNC codes of the SIM card present in the device at the time.

Note: Bookmarks can be customised from version 1.0.1 and default search engine can be customised from version 1.2.

The example below shows a configuration for Vivo in Brazil (724006, where 724 is Brazil and 006 is Vivo according to the MCC and MNC codes listed on Wikpedia), and a default fallback (000000) in case a non-matching SIM card or no SIM card is present.

This configuration is made in the applications-data.js file in the build directory of Gaia, which gets copied into an init.json file in the browser app directory at build time.

content = {
  '000000': {
    'bookmarks': [
      { 'title': 'Mozilla',
        'uri': 'http://mozilla.org',
        'iconUri':
          'data:image/png;base64,AAABAAIAEBAAAAEAIABo[truncated]'
      },
      { 'title': 'Firefox OS',
        'uri': 'http://mozilla.org/firefoxos',
        'iconUri':
          'data:image/png;base64,AAABAAIAEBAAAAEA[truncated]'
      }
    ],
    'searchEngines' : [
       {
         'title': 'Google',
         'uri': 'http://www.google.com/search?q={searchTerms}',
         'iconUri':
           'data:image/png;base64,AAABAAIAEBAAAAEAIABoBAA[truncated]'
       }
     ],
     'settings' : {
       'defaultSearchEngine': 'http://www.google.com/search?q={searchTerms}'
     }
  },

  '724006': {
    "bookmarks": [
      { "title": "Vivo Busca",
        "uri": "http://www.google.com.br/m/search",
        "iconUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC[truncated]"
      },
      { "title": "Serviços e Downloads",
        "uri": "http://vds.vivo.com.br",
        "iconUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACA[truncated]"
      },
      {
        "title": "Site Vivo",
        "uri": "http://www.vivo.com.br/conteudosmartphone",
        "iconUri": "data:image/jpg;base64,/9j/4AAQSkZJRg[truncated]"
      }
    ],
    'searchEngines' : [
       {
         'title': 'Yahoo',
         'uri': 'http://search.yahoo.com/search?q={searchTerms}',
         'iconUri':
           'data:image/png;base64,AAABAAIAEBAAAAEAIABoBAA[truncated]'
       }
     ],
     'settings' : {
       'defaultSearchEngine': 'http://search.yahoo.com/search?q={searchTerms}'
     }
  }
};

In the example, if a Vivo SIM card from Brazil is entered on first run the user will see Vivo bookmarks and Yahoo as the default search engine. If another SIM card or no SIM card is entered on first run the user will see Mozilla bookmarks and Google as the default search engine.

The "defaultSearchEngine" property must match the "uri" property of the search engine specified. This string acts as a template where the "{searchTerms}" placeholder which will get replaced with the user's search query at run time. Other values such as search strings may be appended to the query string in the URL template.

The favicon URLs shown are base64 encoded data URLs of the image data (truncated for brevity) rather than HTTP URLs. This is recommended so that the icons will still appear the first time the browser is run even if the user has not connected to the Internet yet.

Notice that multiple customisations can be applied for different networks and different countries in a single build, with a different 6 digit code representing each variant. The 6 digit code is constructed from the MCC code plus the MNC code, each padded with zeros to ensure it is 3 digits long.

When populating the default data the browser will first look for an exact match with the MCC+MNC codes, then if there is no match it will look for MCC+000, then if there's still no match will fall back to 000+000.

When upgrading between versions of Gaia, new customisations will only be applied if that type of customisation is a new feature in the new version of Gaia being upgraded to. Previous customisations will not be overwritten.

Data and Messaging Settings

Device data and messaging settings are runtime customizable.

To apply specific settings, change gaia/shared/resources/apn/apns_conf_local.xml. Simply add or edit a carrier block:

 <apn carrier="Test Network"
     mcc="001"
     mnc="01"
     apn="internet"
     user="user"
     password="password"
     proxy="127.0.0.1"
     port="8080"
     mmsc="http://127.0.0.1"
     mmsproxy="127.0.0.1"
     mmsport="8080"
     authtype="0"
     type="default,supl,mms"
 />

Change attributes as needed.

Voicemail and Cell Broadcast Settings

Voicemail and Cell Broadcast settings are runtime customizable.

To apply specific settings, change gaia/shared/resources/apn/operator_variant.xml. Add or edit a carrier block:

  <operator carrier="Test Network with Operator Variant Settings"
      mcc="001"
      mnc="01"
      cellBroadcastSearchList="0,1,2,3"
      voicemail="999999"
  />

Change attributes as needed.

WAP user agent profile

WAP user agent profile is another app that supports runtime customization. It overrides the user agent information when sending WAP packets. The overriding is based on MCC/MNC. The profile overriding has url and tagname two parts. But we only support url in current implementation.

WAP user agent uses the same coding style as key, like browser app. But "000000" is used as the default profile. An example can be found at:

  {
    "000000": {
      "url": "http://example.url/default.xml"
    },
    "123001": {
      "url": "http://example.url/custom123001.xml"
    }
  }

In this example, you may find the url of default profile is http://example.url/default.xml, and for mcc=123 and mnc =001 , the url of UA profile is http://example.url/custom123001.xml. If there is another ic card with mcc=123 and mnc=100, the url of UA profile will be http://example.url/default.xml.

If the 000000 is removed from this example, like:

 {
    "123001": {
      "url": "http://example.url/custom123001.xml"
    }
  }

This case means that the url of UA profile of ic card with mcc=123, mnc=001 is overrode as http://example.url/custom123001.xml. All others will not be overrode.

If a case with "000000" and there is no url inside "123001", like:

  {
    "000000": {
      "url": "http://example.url/default.xml"
    },
    "123001": {}
  }

That means all url of UA profile are overrode as http://example.url/default.xml and only not to override ic card with mcc=123, mnc=001.

Applications

Applications installed in Firefox OS can be customized at runtime as well. Those can be installed and placed in the desired position in the homescreen depending on the MCC/MNC. The customized applications will be added to the standard applications.

The definition of which apps are going to be installed at runtime are defined in variant.json configuration file.

  {
    "apps": {
      "puzzle":
        {
          "manifestURL": "https://owd.tid.es/store/packages/fe8e4a866c518a42db9d2041568684c1.webapp"
        },
      "store":
        {
          "manifestURL": "https://owd.tid.es/store/manifest.webapp",
          "installOrigin": "https://www.openwebdevice.com"
        }
    },
    "operators": [
      {
        "id": "movistar-co",
        "mcc-mnc": [
          "214-01",
          "214-02"
        ],
        "apps": [
          {
            "id": "store",
            "screen": 0,
            "location": 2
          }
        ]
      },
      {
        "id": "movistar-mx",
        "mcc-mnc": [
          "215-23"
        ],
        "apps": [
          {
            "id": "store",
            "screen": 0,
            "location": 2
          },
          {
            "id": "puzzle"
          }
        ]
      }
    ]
  }

First object of the json called 'apps' defines the custom applications to be copied at buildtime. The example uses two applications, one hosted (store) and one packaged (puzzle). Notice that while packaged apps only require the manifestURL, hosted ones also need the installOrigin in order to download them.

The second object, called 'operators', is responsible of the configuration based on MCC/MNC. The object contains an array of objects for each MCC/MNC pair. These objects define the id of the operator, a MCC/MNC list for the configuration and a list of 'apps' object defining which applications are going to be installed at runtime. The 'apps' object requires an 'id' property and has two optional arguments to set the position in the homescreen, the screen property sets the screen number and the location sets the position in the screen.

Support contacts, default contacts, wallpaper & ringtone

The same file variant.json used to configure applications at runtime depending on the MCC/MNC, allows to configure specific resources by adding some attributes under each operator object. Thus, an operator can have the following settings:

  { apps: ...
    "operators": [
      {
        "id": "movistar-co",
          "mcc-mnc": [
            "214-01",
            "214-02"
          ],
        "apps": [
          {
            "id": "store",
            "screen": 0,
            "location": 2
          }
        ],
        "support_contacts": "resources/support_contacts_movistar.json",
        "default_contacts": "resources/contacts_movistar.json",
        "ringtone": {
          "path": "resources/Movistar_Mid_ABR_128kbps.ogg",
          "name": "Tono Movistar"
        },
        "wallpaper": "resources/customize.jpg"
      },
      ...
  }

So, for each operator:

  • support_contacts: path to a file containing contacts shown at help screen (Settings -> help). The file format is:
  {
    "onlinesupport": {
      "title": "Mozilla Support",
      "href": "http://test.mozilla.org/support"
    },
    "callsupport1": {
      "title": "Call Support (Primary)",
      "href": "tel:14155550001"
    },
    "callsupport2": {
      "title": "Call Support (Secondary)",
      "href": "tel:14155550002"
    }
  }

Contacts

default_contacts.json should contain contacts that will be preloaded to the contacts application, depending on the MCC/MNC pair present at FTU time. The section names are the MCC/MNC pair, and section contents should be an array of contacts following the same format as contacts.json

For example:

   {
       "123123":
       [
           {name: ["John Doe"]},
           // etc
       ],
   }

Others

  • ringtone: object with two attributes, both mandatory. This object sets the default ringtone.
    • path: path to the ringtone sound file.
    • name: name shown in settings for the ringtone.
  • wallpaper: path to image file (PNG) that will be set as a default wallpaper.

Preload webapp

We currently have some gaia build-in apps and you might want to bundle more your apps in customization. If you want bundle app you developed, you can follow preload app management section instructions as long as you are working within the guidelines of Mozilla's Distribution Agreement. In Pre-bundled webapp section, we provide a script to help you pre-bundled webapp to your build.

Preload App management

you can use apps.list to manage what apps you need to install into gaia. for example you can use below configration to build a gaia only contain system app, homescreen app and settings app:

apps/system
apps/homescreen
apps/settings

you will get a homescreen with one app. you also can use * to add all apps in sepecific directory, like:

apps/*

you can install all apps in apps directory into gaia.

Pre-bundled webapp

Pre-bundled webapp are not quite the same as usual webapp, since Pre-bundled webapp may be seen before internet is ready. It have to store linked icon to buildin base-64 strings, provide correspondent matadata.json, prefetched appcache..., etc.

To package Pre-bundled webapp, we utilize the gaia-preload-app script that help build pre-bundled webapp from a given .webapp URL.


fetch a single webapp

Find a webapp URL that want to bundled with, and run the command:

   $ python preload.py http://<webapp url>

It will generate a folder with target webapp name, ex `accuweather`.


batch process to fetch multiple webapp

You can form a list file that batched the process. The format is

   Facebook,http://fa....
   Twitter,https://twi....

Put `preload.py` script with list file in the same folder, then run the command:

   $ python preload.py

`preload.py` script will parse the list file and do the conversion for you.

Pre-bundled webapp metadata.json format

Every Pre-bundled webapp should have a `metadata.json` within the `<app name>` folder. Marketplace counts on `metadata.json` file for auto-update.

The `metadata.json` can be auto generated by `preload.py` script.

`metadata.json` file is generated by the `manifest.webapp` and web server flags. `metadata.json` properties are

hosted webapp
  • origin: domain name from the webapp url
  • manifestURL: this is the location of the web app manifest for a hosted app
  • installOrigin(hosted): the location the app was installed from in the customization. For customizations, this should always be `https://marketplace.firefox.com`
  • etag: this is webapp manifest etag used for checking for updates. etag value is retrieved by parse html header while download `.webapp` file from web server.
  • "removable": false, set true to make this app not removable from homescreen
  • "type": "certified", set type as "certified" to get extra permission. "previleged" type is not allowed for hosted webapp.
packaged webapp
  • origin: the origin will be 'app://<app name>' ex: 'app://poppit'
  • manifestURL: this should be the location of the mini-manifest. For customizations right now, the manifestURL will always be a mini-manifest from `marketplace.firefox.com`
  • installOrigin(hosted): the location the app was installed from in the customization. For customizations, this should always be `https://marketplace.firefox.com`
  • etag: this is webapp manifest etag used for checking for updates. etag value is retrieved by parse html header while download `.webapp` file from web server.
  • packageEtag: save etag value contained in html header while fetching package from web server
  • "removable": false, set true to make this app not removable from homescreen
  • "type": "privileged", set type as "certified" to get extra permission; Set type as "privileged" to get highest permission of firefox os system.

packaged webapp update.webapp format

packaged webapp has a update.webapp file which is used for auto-update. The format is similar to manifest.webapp, but you have to explicitly address `package_path` and `size` attribute.

  • `package_path` is the path to the packaged(zip) file
  • `size` is package size
   {
   "name": "Game Pack",

   "icons": {"60": "/icon-60.png", "128": "/icon-128.png"},
 
   "version": "1.1.2",
 
   "package_path": "/application.zip",
 
   "developer": {"url": "http://abc.com", "name": "abc Inc."},
 
   "release_notes": "2nd release",
 
   "locales": {"es": {"launch_path": "/index-es.html", "description": "show me customization."}},
 
   "size": 5460141
   }

Pre-bundled webapp Appcache format

If webapp defined the `appcache_path` in `manifest.webapp`. `preload.py` script will fetch the appcache file described in `appcache_path` and pre-fetched all resources described in the appcache file.

The Pre-bundled webapp appcache can be auto generated by `preload.py` script.

The translated file structure is:

   <app name>
      ├── manifest.webapp
      └── cache
            ├── manifest.appcache
            └── <resources>

Note that the file structure is not the same as the appcache file described, but will be translated to gecko recognizable format. What ever name described in `appcache_path` should be renamed to `manifest.appcache` and saved into `cache` folder.

FAQ

(... means Donovan will fill in)

(Many variables will be handled by customize.py (815517))

What can be customized?

  • Brand
    • Start up & Power off animations
      • ...
    • Network name on Lock screen and in Utility Tray.
      • (I think this is controlled remotely from the cell tower?)
    • First Run Experience logos
      • ...
  • Localization
    • Installed locales
      • shared/locales
    • Default locale
      • GAIA_DEFAULT_LOCALE
    • Default keyboard layouts
      • ...
      • (Multiple keyboards can be enabled, not tied to locale)
  • Apps
    • Preinstalled third party apps
      • Handled by customize.py
    • Home grid app placement
      • Handled by customize.py
    • Licensing
      • (What does this mean?)
    • In-app payment provider configuration
      • ...
  • Settings
    • Default screen brightness
    • Device Information - Model (name or #)
    • Device Information - Legal Information link or content
    • Help - Online support link
    • Help - Call support phone number
    • Help - User guide link
    • APN
    • MMS message size limitation
    • MMS message retrieval mode
  • Media preloads
    • Wallpapers
    • Music
    • Videos
    • Gallery
      • see make install-media-samples for example of how to populate these
  • Sounds
    • Start up & Power off
    • Ring tone
    • Message tone
  • Everything.me
    • Option to enable or disable the feature
    • Set of default categories and apps
  • Browser
    • Default bookmarks
    • Default search engine

How and where do you define a customized app grid layout?

  • It's currently in gaia/apps/homescreen/js/init.json
      • customize.py takes care of building this in the correct format

Is it possible to define whether an app is removable in the homescreen configuration?

  • No. All apps that are in /system/b2g are non removable, those in /data are removable. Since all preloaded apps come from /system, we need to move them to /data if we want them to be removable.

How do you add a preloaded packaged app to the build?

  • In gaia/external-apps
  • Many 3rd party apps will not be added to the Gaia repo, so need to determine how to add them. Build step?
    • customize.py will allow entry of the URL to a packaged app or a hosted app manifest, and will download into the correct place and create metadata.json. This will serve as the "build step"

How do you add a preloaded hosted app to the build?

  • They are also added to gaia/external-apps. We have different meta-data for packaged and hosted apps to distinguish them.

How do you prepare a preloaded hosted app for initial offline support?

  • You need to provide all the files to cache in the directory external-apps/MY_APP/cache, and the appcache manifest.

What Marketplace Customizations Are Possible?

  • On-device
    • The customization on the device regarding payments is limited to populating a whitelist of payment providers. There are a couple prefs for this, documented here https://wiki.mozilla.org/WebAPI/WebPayment#Testing
    • For example, Mozilla B2G phones will ship with our implementation of the payment provider (https://github.com/mozilla/webpay#readme) in a whitelist so that it is accessible to the Marketplace and third party apps for in-app purchases via navigator.mozPay(). Some more info on providers is here https://wiki.mozilla.org/WebAPI/WebPaymentProvider
    • If any carrier wants to implement their own payment processor and whitelist it, they are free to do so. However, the Firefox Marketplace is only configured to enable purchases through Mozilla's payment provider at this time.
  • On-server
    • The merchant app sets a price point for the product and Mozilla's backend payment processor chooses the currency based on the user's network. None of currency, regional taxation, L10N is controlled by device configs (yet).
    • Category in the Firefox Marketplace specific to the carrier with your operator logo/name in the region.
    • Features apps / promotions in the Firefox Marketplace specified by the Carrier

There are many other considerations when adding a region or carrier. See https://wiki.mozilla.org/Marketplace/AddingRegionsAndCarriers

How do I package and store per-market customization changes?

  • Store each of the files changed only.
  • Currently these are in various locations in the filesystem.
  • For v2, we should consolidate to a single location, similar to the branding directories we have for Gecko.

How do you build the product with a specific market's configuration?

  • Copy your changed files into a checkout of Gaia, and build using that modified Gaia.
      • customize.py will provide a ui for setting relevant switches and then create the appropriate files in the appropriate places in the gaia checkout, and then build the profile from that gaia.

How to customize power on / off animation?

  • Uses Android bootanimation.zip/desc.txt format.
  • An explanation of this format can be found here: http://www.droidforums.net/forum/droid-hacks/33932-bootanimation-zip-file-explained.html
  • This lets us create multi-part animation sequences where we can specify things like size, framerate, and number of times an animation sequence loops for each part.
  • There is also an animated png transition animation that bridges the gap between this bootanimation.zip sequence and the transition to the lockscreen, which is performed by Gaia.
  • Size on disk of current animation: 8.2 mb (looping) + 3.6 mb (frame 18 transition) = 11.8 mb total
  • Currently, the shutdown animation is a custom css animation based on a design specified in this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=809342

Process Questions

  • Is it better to have specific bugs for each app on a homescreen grid, or just one bug per layout per market?
  • How to deliver/retrieve code for pre-loading? Manual delivery of assets, or suck it from a live app?
  • Who owns gathering the values for these customizations from the carriers?
    • Karen Ward (Content Program Manager) owns it for Pre-installed Apps.
    • Remaining localizations/customizations?