1c5afb16430a145f20d7c887e45f47b38687054daMarc Blank/*
2c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * Copyright (C) 2012 The Android Open Source Project
3c5afb16430a145f20d7c887e45f47b38687054daMarc Blank *
4c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * Licensed under the Apache License, Version 2.0 (the "License");
5c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * you may not use this file except in compliance with the License.
6c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * You may obtain a copy of the License at
7c5afb16430a145f20d7c887e45f47b38687054daMarc Blank *
8c5afb16430a145f20d7c887e45f47b38687054daMarc Blank *      http://www.apache.org/licenses/LICENSE-2.0
9c5afb16430a145f20d7c887e45f47b38687054daMarc Blank *
10c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * Unless required by applicable law or agreed to in writing, software
11c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * distributed under the License is distributed on an "AS IS" BASIS,
12c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * See the License for the specific language governing permissions and
14c5afb16430a145f20d7c887e45f47b38687054daMarc Blank * limitations under the License.
15c5afb16430a145f20d7c887e45f47b38687054daMarc Blank */
16c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
17c5afb16430a145f20d7c887e45f47b38687054daMarc Blankpackage com.android.mail.providers;
18c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
19c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport android.content.Context;
20c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport android.content.Intent;
21c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport android.net.Uri;
22c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
23c5afb16430a145f20d7c887e45f47b38687054daMarc Blankimport com.android.email.activity.setup.AccountSettings;
24c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
25c5afb16430a145f20d7c887e45f47b38687054daMarc Blankpublic class EmailAccountCacheProvider extends MailAppProvider {
26c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    // Content provider for Email
27c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    private static final String sAuthority = "com.android.email2.accountcache";
28c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    /**
29c5afb16430a145f20d7c887e45f47b38687054daMarc Blank     * Authority for the suggestions provider. This is specified in AndroidManifest.xml and
30c5afb16430a145f20d7c887e45f47b38687054daMarc Blank     * res/xml/searchable.xml.
31c5afb16430a145f20d7c887e45f47b38687054daMarc Blank     */
32c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    private static final String sSuggestionsAuthority = "com.android.email.suggestionsprovider";
33c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
34c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    @Override
35c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    protected String getAuthority() {
36c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        return sAuthority;
37c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    }
38c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
39c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    @Override
40c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    protected Intent getNoAccountsIntent(Context context) {
41c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        Intent intent = new Intent();
42c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        intent.setAction(Intent.ACTION_EDIT);
43c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        intent.setData(Uri.parse("content://ui.email.android.com/settings"));
44c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        intent.putExtra(AccountSettings.EXTRA_NO_ACCOUNTS, true);
45c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        return intent;
46c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    }
47c5afb16430a145f20d7c887e45f47b38687054daMarc Blank
48c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    @Override
49c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    public String getSuggestionAuthority() {
50c5afb16430a145f20d7c887e45f47b38687054daMarc Blank        return sSuggestionsAuthority;
51c5afb16430a145f20d7c887e45f47b38687054daMarc Blank    }
52c5afb16430a145f20d7c887e45f47b38687054daMarc Blank}
53