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

Commit 734733d8 authored by Jatin Matani's avatar Jatin Matani
Browse files

Skeleton code for user dictionary sync

Bug:17464069
Change-Id: If683b80e882c07fba576959346ae74cd445dd83e
parent 37ba3ddd
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -16,9 +16,11 @@

package com.android.inputmethod.latin.accounts;

import android.accounts.Account;
import android.content.Context;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * Utility class for retrieving accounts that may be used for login.
@@ -37,4 +39,9 @@ public class LoginAccountUtils {
    public static String[] getAccountsForLogin(final Context context) {
        return new String[0];
    }

    @Nullable
    public static Account getCurrentAccount(final Context context) {
        return null;
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -50,4 +50,9 @@ public final class ProductionFlags {
     * When {@code false}, account sign-in in keyboard is not yet ready to be enabled.
     */
    public static final boolean ENABLE_ACCOUNT_SIGN_IN = false;

    /**
     * When {@code true}, personal dictionary sync feature is ready to be enabled.
     */
    public static final boolean ENABLE_PERSONAL_DICTIONARY_SYNC = false;
}
+55 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.
 */

package com.android.inputmethod.latin.sync;

import android.content.Context;

import javax.annotation.Nonnull;
import javax.annotation.concurrent.GuardedBy;

public class BeanstalkManager {
    private static final Object sLock = new Object();

    @GuardedBy("sLock")
    private static BeanstalkManager sInstance;

    /**
     * @return the singleton instance of {@link BeanstalkManager}.
     */
    @Nonnull
    public static BeanstalkManager getInstance(Context context) {
        synchronized(sLock) {
            if (sInstance == null) {
                sInstance = new BeanstalkManager(context.getApplicationContext());
            }
        }
        return sInstance;
    }

    private BeanstalkManager(final Context context) {
        // Intentional private constructor for singleton.
    }

    public void onCreate() {
    }

    public void requestSync() {
    }

    public void onDestroy() {
    }
}
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@
    <!--  Option for enabling or disabling the split keyboard layout. [CHAR LIMIT=65]-->
    <string name="enable_split_keyboard">Enable split keyboard</string>

    <string name="sync_now_title" translatable="false">Sync Now</string>
    <string name="sync_now_summary" translatable="false">Sync your personal dictionary</string>
    <string name="sync_now_summary_disabled_signed_out" translatable="false">Select an account to enable sync</string>

    <!-- Option name for including other IMEs in the language switch list [CHAR LIMIT=30] -->
    <string name="include_other_imes_in_language_switch_list">Switch to other input methods</string>
    <!-- Option summary for including other IMEs in the language switch list [CHAR LIMIT=65] -->
+5 −0
Original line number Diff line number Diff line
@@ -34,4 +34,9 @@
        android:summary="@string/enable_metrics_logging_summary"
        android:defaultValue="true"
        android:persistent="true" />

    <!-- This preference (acts like a button) enables the user to initiate an one time sync. -->
    <Preference android:key="pref_beanstalk"
        android:persistent="false"
        android:title="@string/sync_now_title" />
</PreferenceScreen>
Loading