Simplification of app initialization
Specify a account query uri in a resource, and remove the old receiver Change-Id: Ia04dccfc95e0bb1854bba2e6f51e2de1546d72ce
This commit is contained in:
parent
258776d784
commit
06c358dfee
|
@ -337,12 +337,6 @@
|
||||||
android:authorities="com.android.email.suggestionsprovider"
|
android:authorities="com.android.email.suggestionsprovider"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
|
|
||||||
<receiver android:name="com.android.mail.providers.protos.boot.AccountReceiver">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.android.email2.providers.protos.boot.intent.ACTION_PROVIDER_CREATED" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
<service android:name="com.android.mail.compose.EmptyService"/>
|
<service android:name="com.android.mail.compose.EmptyService"/>
|
||||||
<!-- Widget -->
|
<!-- Widget -->
|
||||||
<receiver android:name=".provider.WidgetProvider" android:label="@string/app_name">
|
<receiver android:name=".provider.WidgetProvider" android:label="@string/app_name">
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2013 Google Inc.
|
||||||
|
Licensed to The Android Open Source Project.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<!-- List of content provider uris for -->
|
||||||
|
<string-array name="account_providers" translatable="false">
|
||||||
|
<!-- email account list -->
|
||||||
|
<item>content://com.android.email.provider/uiaccts</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
</resources>
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2012 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.android.mail.providers.protos.boot;
|
|
||||||
|
|
||||||
import com.android.emailcommon.provider.EmailContent;
|
|
||||||
import com.android.mail.providers.MailAppProvider;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
|
|
||||||
public class AccountReceiver extends BroadcastReceiver {
|
|
||||||
/**
|
|
||||||
* Intent used to notify interested parties that the Mail provider has been created.
|
|
||||||
*/
|
|
||||||
public static final String ACTION_PROVIDER_CREATED
|
|
||||||
= "com.android.email2.providers.protos.boot.intent.ACTION_PROVIDER_CREATED";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
EmailContent.init(context);
|
|
||||||
MailAppProvider.addAccountsForUriAsync(Uri.parse(EmailContent.CONTENT_URI + "/uiaccts"));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue