1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-02-07 10:40:11 -05:00

Merge branch 'configurable_application_id'

This commit is contained in:
cketti 2015-02-16 21:49:01 +01:00
commit 461778ed11
7 changed files with 55 additions and 51 deletions

View File

@ -52,6 +52,7 @@ android {
} }
debug { debug {
applicationIdSuffix ".debug"
testCoverageEnabled rootProject.testCoverage testCoverageEnabled rootProject.testCoverage
} }
} }

View File

@ -29,36 +29,36 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<permission <permission
android:name="com.fsck.k9.permission.READ_ATTACHMENT" android:name="${applicationId}.permission.READ_ATTACHMENT"
android:description="@string/read_attachment_desc" android:description="@string/read_attachment_desc"
android:label="@string/read_attachment_label" android:label="@string/read_attachment_label"
android:permissionGroup="android.permission-group.MESSAGES" android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="dangerous"/> android:protectionLevel="dangerous"/>
<uses-permission android:name="com.fsck.k9.permission.READ_ATTACHMENT"/> <uses-permission android:name="${applicationId}.permission.READ_ATTACHMENT"/>
<permission <permission
android:name="com.fsck.k9.permission.REMOTE_CONTROL" android:name="${applicationId}.permission.REMOTE_CONTROL"
android:description="@string/remote_control_desc" android:description="@string/remote_control_desc"
android:label="@string/remote_control_label" android:label="@string/remote_control_label"
android:permissionGroup="android.permission-group.MESSAGES" android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="dangerous"/> android:protectionLevel="dangerous"/>
<uses-permission android:name="com.fsck.k9.permission.REMOTE_CONTROL"/> <uses-permission android:name="${applicationId}.permission.REMOTE_CONTROL"/>
<permission <permission
android:name="com.fsck.k9.permission.READ_MESSAGES" android:name="${applicationId}.permission.READ_MESSAGES"
android:description="@string/read_messages_desc" android:description="@string/read_messages_desc"
android:label="@string/read_messages_label" android:label="@string/read_messages_label"
android:permissionGroup="android.permission-group.MESSAGES" android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="dangerous"/> android:protectionLevel="dangerous"/>
<uses-permission android:name="com.fsck.k9.permission.READ_MESSAGES"/> <uses-permission android:name="${applicationId}.permission.READ_MESSAGES"/>
<permission <permission
android:name="com.fsck.k9.permission.DELETE_MESSAGES" android:name="${applicationId}.permission.DELETE_MESSAGES"
android:description="@string/delete_messages_desc" android:description="@string/delete_messages_desc"
android:label="@string/delete_messages_label" android:label="@string/delete_messages_label"
android:permissionGroup="android.permission-group.MESSAGES" android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="dangerous"/> android:protectionLevel="dangerous"/>
<uses-permission android:name="com.fsck.k9.permission.DELETE_MESSAGES"/> <uses-permission android:name="${applicationId}.permission.DELETE_MESSAGES"/>
<application <application
@ -70,7 +70,7 @@
<meta-data <meta-data
android:name="android.app.default_searchable" android:name="android.app.default_searchable"
android:value=".activity.Search"/> android:value="com.fsck.k9.activity.Search"/>
<activity <activity
android:name=".activity.Accounts" android:name=".activity.Accounts"
@ -98,7 +98,7 @@
android:configChanges="locale" android:configChanges="locale"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:label="@string/prefs_title" android:label="@string/prefs_title"
android:taskAffinity="com.fsck.k9.activity.setup.Prefs"/> android:taskAffinity="${applicationId}.activity.setup.Prefs"/>
<activity <activity
android:name=".activity.setup.WelcomeMessage" android:name=".activity.setup.WelcomeMessage"
@ -315,12 +315,12 @@
<receiver <receiver
android:name=".service.RemoteControlReceiver" android:name=".service.RemoteControlReceiver"
android:enabled="true" android:enabled="true"
android:permission="com.fsck.k9.permission.REMOTE_CONTROL"> android:permission="${applicationId}.permission.REMOTE_CONTROL">
<intent-filter> <intent-filter>
<action android:name="com.fsck.k9.K9RemoteControl.set"/> <action android:name="${applicationId}.K9RemoteControl.set"/>
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="com.fsck.k9.K9RemoteControl.requestAccounts"/> <action android:name="${applicationId}.K9RemoteControl.requestAccounts"/>
</intent-filter> </intent-filter>
</receiver> </receiver>
@ -383,7 +383,7 @@
<service <service
android:name=".service.RemoteControlService" android:name=".service.RemoteControlService"
android:enabled="true" android:enabled="true"
android:permission="com.fsck.k9.permission.REMOTE_CONTROL"/> android:permission="${applicationId}.permission.REMOTE_CONTROL"/>
<service <service
android:name=".service.SleepService" android:name=".service.SleepService"
@ -395,24 +395,24 @@
<provider <provider
android:name=".provider.AttachmentProvider" android:name=".provider.AttachmentProvider"
android:authorities="com.fsck.k9.attachmentprovider" android:authorities="${applicationId}.attachmentprovider"
android:exported="true" android:exported="true"
android:grantUriPermissions="true" android:grantUriPermissions="true"
android:multiprocess="true" android:multiprocess="true"
android:readPermission="com.fsck.k9.permission.READ_ATTACHMENT"/> android:readPermission="${applicationId}.permission.READ_ATTACHMENT"/>
<provider <provider
android:name=".provider.MessageProvider" android:name=".provider.MessageProvider"
android:authorities="com.fsck.k9.messageprovider" android:authorities="${applicationId}.messageprovider"
android:exported="true" android:exported="true"
android:grantUriPermissions="true" android:grantUriPermissions="true"
android:multiprocess="true" android:multiprocess="true"
android:readPermission="com.fsck.k9.permission.READ_MESSAGES" android:readPermission="${applicationId}.permission.READ_MESSAGES"
android:writePermission="com.fsck.k9.permission.DELETE_MESSAGES"/> android:writePermission="${applicationId}.permission.DELETE_MESSAGES"/>
<provider <provider
android:name=".provider.EmailProvider" android:name=".provider.EmailProvider"
android:authorities="com.fsck.k9.provider.email" android:authorities="${applicationId}.provider.email"
android:exported="false"/> android:exported="false"/>
</application> </application>

View File

@ -339,18 +339,18 @@ public class K9 extends Application {
public static class Intents { public static class Intents {
public static class EmailReceived { public static class EmailReceived {
public static final String ACTION_EMAIL_RECEIVED = "com.fsck.k9.intent.action.EMAIL_RECEIVED"; public static final String ACTION_EMAIL_RECEIVED = BuildConfig.APPLICATION_ID + ".intent.action.EMAIL_RECEIVED";
public static final String ACTION_EMAIL_DELETED = "com.fsck.k9.intent.action.EMAIL_DELETED"; public static final String ACTION_EMAIL_DELETED = BuildConfig.APPLICATION_ID + ".intent.action.EMAIL_DELETED";
public static final String ACTION_REFRESH_OBSERVER = "com.fsck.k9.intent.action.REFRESH_OBSERVER"; public static final String ACTION_REFRESH_OBSERVER = BuildConfig.APPLICATION_ID + ".intent.action.REFRESH_OBSERVER";
public static final String EXTRA_ACCOUNT = "com.fsck.k9.intent.extra.ACCOUNT"; public static final String EXTRA_ACCOUNT = BuildConfig.APPLICATION_ID + ".intent.extra.ACCOUNT";
public static final String EXTRA_FOLDER = "com.fsck.k9.intent.extra.FOLDER"; public static final String EXTRA_FOLDER = BuildConfig.APPLICATION_ID + ".intent.extra.FOLDER";
public static final String EXTRA_SENT_DATE = "com.fsck.k9.intent.extra.SENT_DATE"; public static final String EXTRA_SENT_DATE = BuildConfig.APPLICATION_ID + ".intent.extra.SENT_DATE";
public static final String EXTRA_FROM = "com.fsck.k9.intent.extra.FROM"; public static final String EXTRA_FROM = BuildConfig.APPLICATION_ID + ".intent.extra.FROM";
public static final String EXTRA_TO = "com.fsck.k9.intent.extra.TO"; public static final String EXTRA_TO = BuildConfig.APPLICATION_ID + ".intent.extra.TO";
public static final String EXTRA_CC = "com.fsck.k9.intent.extra.CC"; public static final String EXTRA_CC = BuildConfig.APPLICATION_ID + ".intent.extra.CC";
public static final String EXTRA_BCC = "com.fsck.k9.intent.extra.BCC"; public static final String EXTRA_BCC = BuildConfig.APPLICATION_ID + ".intent.extra.BCC";
public static final String EXTRA_SUBJECT = "com.fsck.k9.intent.extra.SUBJECT"; public static final String EXTRA_SUBJECT = BuildConfig.APPLICATION_ID + ".intent.extra.SUBJECT";
public static final String EXTRA_FROM_SELF = "com.fsck.k9.intent.extra.FROM_SELF"; public static final String EXTRA_FROM_SELF = BuildConfig.APPLICATION_ID + ".intent.extra.FROM_SELF";
} }
public static class Share { public static class Share {
@ -359,7 +359,7 @@ public class K9 extends Application {
* because of different semantics (String array vs. string with comma separated * because of different semantics (String array vs. string with comma separated
* email addresses) * email addresses)
*/ */
public static final String EXTRA_FROM = "com.fsck.k9.intent.extra.SENDER"; public static final String EXTRA_FROM = BuildConfig.APPLICATION_ID + ".intent.extra.SENDER";
} }
} }

View File

@ -17,7 +17,6 @@ import com.fsck.k9.R;
public class ManageIdentities extends ChooseIdentity { public class ManageIdentities extends ChooseIdentity {
private boolean mIdentitiesChanged = false; private boolean mIdentitiesChanged = false;
public static final String EXTRA_IDENTITIES = "com.fsck.k9.EditIdentity_identities";
private static final int ACTIVITY_EDIT_IDENTITY = 1; private static final int ACTIVITY_EDIT_IDENTITY = 1;

View File

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.fsck.k9.Account; import com.fsck.k9.Account;
import com.fsck.k9.BuildConfig;
import com.fsck.k9.Preferences; import com.fsck.k9.Preferences;
import com.fsck.k9.cache.EmailProviderCacheCursor; import com.fsck.k9.cache.EmailProviderCacheCursor;
import com.fsck.k9.helper.Utility; import com.fsck.k9.helper.Utility;
@ -43,7 +44,7 @@ import android.text.TextUtils;
public class EmailProvider extends ContentProvider { public class EmailProvider extends ContentProvider {
private static final UriMatcher sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH); private static final UriMatcher sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
public static final String AUTHORITY = "com.fsck.k9.provider.email"; public static final String AUTHORITY = BuildConfig.APPLICATION_ID +".provider.email";
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY); public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY);

View File

@ -21,6 +21,7 @@ import android.util.Log;
import com.fsck.k9.Account; import com.fsck.k9.Account;
import com.fsck.k9.AccountStats; import com.fsck.k9.AccountStats;
import com.fsck.k9.BuildConfig;
import com.fsck.k9.K9; import com.fsck.k9.K9;
import com.fsck.k9.Preferences; import com.fsck.k9.Preferences;
import com.fsck.k9.activity.FolderInfoHolder; import com.fsck.k9.activity.FolderInfoHolder;
@ -940,7 +941,7 @@ public class MessageProvider extends ContentProvider {
} }
} }
public static final String AUTHORITY = "com.fsck.k9.messageprovider"; public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".messageprovider";
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY); public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY);

View File

@ -5,6 +5,8 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import com.fsck.k9.BuildConfig;
/** /**
* Utillity definitions for Android applications to control the behavior of K-9 Mail. All such applications must declare the following permission: * Utillity definitions for Android applications to control the behavior of K-9 Mail. All such applications must declare the following permission:
* <uses-permission android:name="com.fsck.k9.permission.REMOTE_CONTROL"/> * <uses-permission android:name="com.fsck.k9.permission.REMOTE_CONTROL"/>
@ -24,14 +26,14 @@ public class K9RemoteControl {
* Permission that every application sending a broadcast to K-9 for Remote Control purposes should send on every broadcast. * Permission that every application sending a broadcast to K-9 for Remote Control purposes should send on every broadcast.
* Prevent other applications from intercepting the broadcasts. * Prevent other applications from intercepting the broadcasts.
*/ */
public final static String K9_REMOTE_CONTROL_PERMISSION = "com.fsck.k9.permission.REMOTE_CONTROL"; public final static String K9_REMOTE_CONTROL_PERMISSION = BuildConfig.APPLICATION_ID + ".permission.REMOTE_CONTROL";
/** /**
* {@link Intent} Action to be sent to K-9 using {@link ContextWrapper.sendOrderedBroadcast} in order to fetch the list of configured Accounts. * {@link Intent} Action to be sent to K-9 using {@link ContextWrapper.sendOrderedBroadcast} in order to fetch the list of configured Accounts.
* The responseData will contain two String[] with keys K9_ACCOUNT_UUIDS and K9_ACCOUNT_DESCRIPTIONS * The responseData will contain two String[] with keys K9_ACCOUNT_UUIDS and K9_ACCOUNT_DESCRIPTIONS
*/ */
public final static String K9_REQUEST_ACCOUNTS = "com.fsck.k9.K9RemoteControl.requestAccounts"; public final static String K9_REQUEST_ACCOUNTS = BuildConfig.APPLICATION_ID + ".K9RemoteControl.requestAccounts";
public final static String K9_ACCOUNT_UUIDS = "com.fsck.k9.K9RemoteControl.accountUuids"; public final static String K9_ACCOUNT_UUIDS = BuildConfig.APPLICATION_ID + ".K9RemoteControl.accountUuids";
public final static String K9_ACCOUNT_DESCRIPTIONS = "com.fsck.k9.K9RemoteControl.accountDescriptions"; public final static String K9_ACCOUNT_DESCRIPTIONS = BuildConfig.APPLICATION_ID + ".K9RemoteControl.accountDescriptions";
/** /**
* The {@link {@link Intent}} Action to set in order to cause K-9 to check mail. (Not yet implemented) * The {@link {@link Intent}} Action to set in order to cause K-9 to check mail. (Not yet implemented)
@ -41,17 +43,17 @@ public class K9RemoteControl {
/** /**
* The {@link {@link Intent}} Action to set when remotely changing K-9 Mail settings * The {@link {@link Intent}} Action to set when remotely changing K-9 Mail settings
*/ */
public final static String K9_SET = "com.fsck.k9.K9RemoteControl.set"; public final static String K9_SET = BuildConfig.APPLICATION_ID + ".K9RemoteControl.set";
/** /**
* The key of the {@link Intent} Extra to set to hold the UUID of a single Account's settings to change. Used only if K9_ALL_ACCOUNTS * The key of the {@link Intent} Extra to set to hold the UUID of a single Account's settings to change. Used only if K9_ALL_ACCOUNTS
* is absent or false. * is absent or false.
*/ */
public final static String K9_ACCOUNT_UUID = "com.fsck.k9.K9RemoteControl.accountUuid"; public final static String K9_ACCOUNT_UUID = BuildConfig.APPLICATION_ID + ".K9RemoteControl.accountUuid";
/** /**
* The key of the {@link Intent} Extra to set to control if the settings will apply to all Accounts, or to the one * The key of the {@link Intent} Extra to set to control if the settings will apply to all Accounts, or to the one
* specified with K9_ACCOUNT_UUID * specified with K9_ACCOUNT_UUID
*/ */
public final static String K9_ALL_ACCOUNTS = "com.fsck.k9.K9RemoteControl.allAccounts"; public final static String K9_ALL_ACCOUNTS = BuildConfig.APPLICATION_ID + ".K9RemoteControl.allAccounts";
public final static String K9_ENABLED = "true"; public final static String K9_ENABLED = "true";
public final static String K9_DISABLED = "false"; public final static String K9_DISABLED = "false";
@ -60,17 +62,17 @@ public class K9RemoteControl {
* Key for the {@link Intent} Extra for controlling whether notifications will be generated for new unread mail. * Key for the {@link Intent} Extra for controlling whether notifications will be generated for new unread mail.
* Acceptable values are K9_ENABLED and K9_DISABLED * Acceptable values are K9_ENABLED and K9_DISABLED
*/ */
public final static String K9_NOTIFICATION_ENABLED = "com.fsck.k9.K9RemoteControl.notificationEnabled"; public final static String K9_NOTIFICATION_ENABLED = BuildConfig.APPLICATION_ID + ".K9RemoteControl.notificationEnabled";
/* /*
* Key for the {@link Intent} Extra for controlling whether K-9 will sound the ringtone for new unread mail. * Key for the {@link Intent} Extra for controlling whether K-9 will sound the ringtone for new unread mail.
* Acceptable values are K9_ENABLED and K9_DISABLED * Acceptable values are K9_ENABLED and K9_DISABLED
*/ */
public final static String K9_RING_ENABLED = "com.fsck.k9.K9RemoteControl.ringEnabled"; public final static String K9_RING_ENABLED = BuildConfig.APPLICATION_ID + ".K9RemoteControl.ringEnabled";
/* /*
* Key for the {@link Intent} Extra for controlling whether K-9 will activate the vibrator for new unread mail. * Key for the {@link Intent} Extra for controlling whether K-9 will activate the vibrator for new unread mail.
* Acceptable values are K9_ENABLED and K9_DISABLED * Acceptable values are K9_ENABLED and K9_DISABLED
*/ */
public final static String K9_VIBRATE_ENABLED = "com.fsck.k9.K9RemoteControl.vibrateEnabled"; public final static String K9_VIBRATE_ENABLED = BuildConfig.APPLICATION_ID + ".K9RemoteControl.vibrateEnabled";
public final static String K9_FOLDERS_NONE = "NONE"; public final static String K9_FOLDERS_NONE = "NONE";
public final static String K9_FOLDERS_ALL = "ALL"; public final static String K9_FOLDERS_ALL = "ALL";
@ -82,27 +84,27 @@ public class K9RemoteControl {
* Acceptable values are K9_FOLDERS_ALL, K9_FOLDERS_FIRST_CLASS, K9_FOLDERS_FIRST_AND_SECOND_CLASS, * Acceptable values are K9_FOLDERS_ALL, K9_FOLDERS_FIRST_CLASS, K9_FOLDERS_FIRST_AND_SECOND_CLASS,
* K9_FOLDERS_NOT_SECOND_CLASS, K9_FOLDERS_NONE * K9_FOLDERS_NOT_SECOND_CLASS, K9_FOLDERS_NONE
*/ */
public final static String K9_PUSH_CLASSES = "com.fsck.k9.K9RemoteControl.pushClasses"; public final static String K9_PUSH_CLASSES = BuildConfig.APPLICATION_ID + ".K9RemoteControl.pushClasses";
/** /**
* Key for the {@link Intent} Extra to set for controlling which folders to be synchronized with Poll. * Key for the {@link Intent} Extra to set for controlling which folders to be synchronized with Poll.
* Acceptable values are K9_FOLDERS_ALL, K9_FOLDERS_FIRST_CLASS, K9_FOLDERS_FIRST_AND_SECOND_CLASS, * Acceptable values are K9_FOLDERS_ALL, K9_FOLDERS_FIRST_CLASS, K9_FOLDERS_FIRST_AND_SECOND_CLASS,
* K9_FOLDERS_NOT_SECOND_CLASS, K9_FOLDERS_NONE * K9_FOLDERS_NOT_SECOND_CLASS, K9_FOLDERS_NONE
*/ */
public final static String K9_POLL_CLASSES = "com.fsck.k9.K9RemoteControl.pollClasses"; public final static String K9_POLL_CLASSES = BuildConfig.APPLICATION_ID + ".K9RemoteControl.pollClasses";
public final static String[] K9_POLL_FREQUENCIES = { "-1", "1", "5", "10", "15", "30", "60", "120", "180", "360", "720", "1440"}; public final static String[] K9_POLL_FREQUENCIES = { "-1", "1", "5", "10", "15", "30", "60", "120", "180", "360", "720", "1440"};
/** /**
* Key for the {@link Intent} Extra to set with the desired poll frequency. The value is a String representing a number of minutes. * Key for the {@link Intent} Extra to set with the desired poll frequency. The value is a String representing a number of minutes.
* Acceptable values are available in K9_POLL_FREQUENCIES * Acceptable values are available in K9_POLL_FREQUENCIES
*/ */
public final static String K9_POLL_FREQUENCY = "com.fsck.k9.K9RemoteControl.pollFrequency"; public final static String K9_POLL_FREQUENCY = BuildConfig.APPLICATION_ID + ".K9RemoteControl.pollFrequency";
/** /**
* Key for the {@link Intent} Extra to set for controlling K-9's global "Background sync" setting. * Key for the {@link Intent} Extra to set for controlling K-9's global "Background sync" setting.
* Acceptable values are K9_BACKGROUND_OPERATIONS_ALWAYS, K9_BACKGROUND_OPERATIONS_NEVER * Acceptable values are K9_BACKGROUND_OPERATIONS_ALWAYS, K9_BACKGROUND_OPERATIONS_NEVER
* K9_BACKGROUND_OPERATIONS_WHEN_CHECKED_AUTO_SYNC * K9_BACKGROUND_OPERATIONS_WHEN_CHECKED_AUTO_SYNC
*/ */
public final static String K9_BACKGROUND_OPERATIONS = "com.fsck.k9.K9RemoteControl.backgroundOperations"; public final static String K9_BACKGROUND_OPERATIONS = BuildConfig.APPLICATION_ID + ".K9RemoteControl.backgroundOperations";
public final static String K9_BACKGROUND_OPERATIONS_ALWAYS = "ALWAYS"; public final static String K9_BACKGROUND_OPERATIONS_ALWAYS = "ALWAYS";
public final static String K9_BACKGROUND_OPERATIONS_NEVER = "NEVER"; public final static String K9_BACKGROUND_OPERATIONS_NEVER = "NEVER";
public final static String K9_BACKGROUND_OPERATIONS_WHEN_CHECKED_AUTO_SYNC = "WHEN_CHECKED_AUTO_SYNC"; public final static String K9_BACKGROUND_OPERATIONS_WHEN_CHECKED_AUTO_SYNC = "WHEN_CHECKED_AUTO_SYNC";
@ -111,7 +113,7 @@ public class K9RemoteControl {
* Key for the {@link Intent} Extra to set for controlling which display theme K-9 will use. Acceptable values are * Key for the {@link Intent} Extra to set for controlling which display theme K-9 will use. Acceptable values are
* K9_THEME_LIGHT, K9_THEME_DARK * K9_THEME_LIGHT, K9_THEME_DARK
*/ */
public final static String K9_THEME = "com.fsck.k9.K9RemoteControl.theme"; public final static String K9_THEME = BuildConfig.APPLICATION_ID + ".K9RemoteControl.theme";
public final static String K9_THEME_LIGHT = "LIGHT"; public final static String K9_THEME_LIGHT = "LIGHT";
public final static String K9_THEME_DARK = "DARK"; public final static String K9_THEME_DARK = "DARK";