Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 992144a8 authored by Mohammadinamul Sheik's avatar Mohammadinamul Sheik Committed by Android Git Automerger
Browse files

am 60415866: [LatinIME] Support MNC permissions.

* commit '60415866':
  [LatinIME] Support MNC permissions.
parents ef1cb855 60415866
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
        coreApp="true"
        package="com.android.inputmethod.latin">

    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
@@ -77,6 +77,13 @@
            </intent-filter>
        </activity>

        <activity
            android:name=".permissions.PermissionsActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:exported="false"
            android:taskAffinity="" >
        </activity>

        <activity android:name=".setup.SetupWizardActivity"
                android:theme="@style/platformActivityTheme"
                android:label="@string/english_ime_name"
+0 −30
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2014, 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>
    <!-- The array of the text of the important notices displayed on the suggestion strip. -->
    <string-array name="important_notice_title_array" translatable="false">
        <!-- empty -->
    </string-array>
    <!-- The array of the contents of the important notices. -->
    <string-array name="important_notice_contents_array" translatable="false">
        <!-- empty -->
    </string-array>
</resources>
+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2015 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>
    <!-- The text shown on the suggestion bar to request the contacts permission info. -->
    <string name="important_notice_suggest_contact_names">Suggest contact names? Touch for info.</string>
</resources>
 No newline at end of file
+0 −25
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2014, 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>
    <integer name="config_important_notice_version">0</integer>
    <!-- Description for option enabling the use by the keyboards of sent/received messages, e-mail and typing history to improve suggestion accuracy [CHAR LIMIT=68] -->
    <string name="use_personalized_dicts_summary">Learn from your communications and typed data to improve suggestions</string>
</resources>
+7 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.inputmethod.latin;

import android.Manifest;
import android.content.Context;
import android.net.Uri;
import android.provider.ContactsContract;
@@ -25,6 +26,7 @@ import android.util.Log;
import com.android.inputmethod.annotations.ExternallyReferenced;
import com.android.inputmethod.latin.ContactsManager.ContactsChangedListener;
import com.android.inputmethod.latin.common.StringUtils;
import com.android.inputmethod.latin.permissions.PermissionsUtil;
import com.android.inputmethod.latin.personalization.AccountUtils;

import java.io.File;
@@ -108,6 +110,11 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary
     * Loads data within content providers to the dictionary.
     */
    private void loadDictionaryForUriLocked(final Uri uri) {
        if (!PermissionsUtil.checkAllPermissionsGranted(
                mContext, Manifest.permission.READ_CONTACTS)) {
            Log.i(TAG, "No permission to read contacts. Not loading the Dictionary.");
        }

        final ArrayList<String> validNames = mContactsManager.getValidNames(uri);
        for (final String name : validNames) {
            addNameLocked(name);
Loading