Вы находитесь на странице: 1из 3

Google Confidential and Proprietary

Quick Introduction to the Email

PartnerProvider App
The Email PartnerProvider app allows OEMs to add additional service providers, including
custom settings such as logos and signatures, to the default list provided by the Gmail app.
This document describes the integration points.

A reference version of the Email PartnerProvider app is given to OEMs to allow them to
specify different providers for Gmail to query when a user creates an account. The app has
the following main functions (all functions are optional and are not dependent on each other):

● Provide the list of email settings for the Gmail app to use:
○ The following attributes can be set for each provider:
■ id​: (required) Must be unique.
■ domain​: (required) Domain of the hosting company. It will be used to
match user's email address to this provider.
■ signature ​: (optional) Signature to be set to the account if given
provider is used. Can be configured based on locale or SIM’s MCC
and/or MNC (see below)
■ Inner elements:
● incoming ​: (required) The configuration for incoming settings.
● outgoing ​: (required) The configuration for outgoing settings.
○ Sample:
<provider id="zoho" domain="zoho.com" signature="@string/zoho_signature">
<incoming … />
<outgoing … />
● Provide a single additional entry for our visual add account flow:
○ This entry consists of an icon (optional) and a string (shown in the UI), and is
not tied to any particular provider. See below for an example of the Gmail add
account flow screen in which this item will be placed.
○ Sample:
<entry label="@string/zoho_label" logo="@drawable/zoho_logo"/>
● Provide a global signature for newly added accounts:
○ String resource with name ​global_signature ​ is used.
○ If account was added with ​provider ​ mentioned above, then the ​signature
specified in the provider will be used. If provider didn’t specify the signature
then ​global_signature ​ will be used as fallback.
○ Sample:
<string name="global_signature">Sent from Android device</string>

10/27/2016 1
Google Confidential and Proprietary

Detailed explanation about each tag and attribute is specified as the comment inside the
resource file. The type of all attributes is string or reference to String resource (except logo,
which is reference to drawable resource). When an attribute is used as a reference to String
resource, providing different values is possible via Android resource qualifiers (see ​Providing
Alternative Resources​). In summary, different values can be provided for different locales,
MCC, MNC, Android OS version, screen sizes, density, orientation, and other qualifiers. The
most useful qualifiers for this app are probably locale, MCC and MNC.

The sample code provided is almost complete. The ​ContentProvider ​ that Gmail
communicates to is implemented and shouldn’t be changed. The only things that OEMs
should change are resources in the ​res​ directory, where providers and additional setup entry
are defined.

These conditions must be met for the Gmail app to use the PartnerProvider app:

1. The PartnerProvider app package must be:

com.android.email.partnerprovider ​.

10/27/2016 2
Google Confidential and Proprietary

2. The PartnerProvider app must be installed in the device’s system image.

3. Gmail must be installed as a system app.
4. All ​ContentProvider ​ queries should return in 2-3 seconds. which should be enough
time, unless Java code is modified and additional work is added, e.g. online queries.
5. Gmail will also check the content of the resulting cursor and discard some or all
entries if something looks odd (e.g. missing fields, invalid values, etc.).

10/27/2016 3