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

Commit f8014eea authored by Jean Chalard's avatar Jean Chalard
Browse files

Hide the correct button when pressing a new button.

Bug: 7600384
Change-Id: Ic5dbbbbcf19d778dde1316ebb417f1a8ede2d25d
parent b8ff89c8
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ public final class ActionBatch {
            final long downloadId = UpdateHandler.registerDownloadRequest(manager, request, db,
                    mWordList.mId, mWordList.mVersion);
            Utils.l("Starting download of", uri, "with id", downloadId);
            PrivateLog.log("Starting download of " + uri + ", id : " + downloadId, context);
            PrivateLog.log("Starting download of " + uri + ", id : " + downloadId);
        }
    }

@@ -333,7 +333,7 @@ public final class ActionBatch {
                    mWordList.mRemoteFilename, mWordList.mLastUpdate, mWordList.mChecksum,
                    mWordList.mFileSize, mWordList.mVersion, mWordList.mFormatVersion);
            PrivateLog.log("Insert 'available' record for " + mWordList.mDescription
                    + " and locale " + mWordList.mLocale, context);
                    + " and locale " + mWordList.mLocale);
            db.insert(MetadataDbHelper.METADATA_TABLE_NAME, null, values);
        }
    }
@@ -383,7 +383,7 @@ public final class ActionBatch {
                    mWordList.mChecksum, mWordList.mFileSize, mWordList.mVersion,
                    mWordList.mFormatVersion);
            PrivateLog.log("Insert 'preinstalled' record for " + mWordList.mDescription
                    + " and locale " + mWordList.mLocale, context);
                    + " and locale " + mWordList.mLocale);
            db.insert(MetadataDbHelper.METADATA_TABLE_NAME, null, values);
        }
    }
@@ -424,7 +424,7 @@ public final class ActionBatch {
                    mWordList.mRemoteFilename, mWordList.mLastUpdate, mWordList.mChecksum,
                    mWordList.mFileSize, mWordList.mVersion, mWordList.mFormatVersion);
            PrivateLog.log("Updating record for " + mWordList.mDescription
                    + " and locale " + mWordList.mLocale, context);
                    + " and locale " + mWordList.mLocale);
            db.update(MetadataDbHelper.METADATA_TABLE_NAME, values,
                    MetadataDbHelper.WORDLISTID_COLUMN + " = ? AND "
                            + MetadataDbHelper.VERSION_COLUMN + " = ?",
+8 −8
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ public final class DictionaryProvider extends ContentProvider {
     */
    @Override
    public String getType(final Uri uri) {
        PrivateLog.log("Asked for type of : " + uri, this);
        PrivateLog.log("Asked for type of : " + uri);
        final int match = matchUri(uri);
        switch (match) {
            case NO_MATCH: return null;
@@ -220,7 +220,7 @@ public final class DictionaryProvider extends ContentProvider {
    public Cursor query(final Uri uri, final String[] projection, final String selection,
            final String[] selectionArgs, final String sortOrder) {
        Utils.l("Uri =", uri);
        PrivateLog.log("Query : " + uri, this);
        PrivateLog.log("Query : " + uri);
        final String clientId = getClientId(uri);
        final int match = matchUri(uri);
        switch (match) {
@@ -228,7 +228,7 @@ public final class DictionaryProvider extends ContentProvider {
            case DICTIONARY_V2_WHOLE_LIST:
                final Cursor c = MetadataDbHelper.queryDictionaries(getContext(), clientId);
                Utils.l("List of dictionaries with count", c.getCount());
                PrivateLog.log("Returned a list of " + c.getCount() + " items", this);
                PrivateLog.log("Returned a list of " + c.getCount() + " items");
                return c;
            case DICTIONARY_V2_DICT_INFO:
                // In protocol version 2, we return null if the client is unknown. Otherwise
@@ -248,10 +248,10 @@ public final class DictionaryProvider extends ContentProvider {
                // TODO: pass clientId to the following function
                DictionaryService.updateNowIfNotUpdatedInAVeryLongTime(getContext());
                if (null != dictFiles && dictFiles.size() > 0) {
                    PrivateLog.log("Returned " + dictFiles.size() + " files", this);
                    PrivateLog.log("Returned " + dictFiles.size() + " files");
                    return new ResourcePathCursor(dictFiles);
                } else {
                    PrivateLog.log("No dictionary files for this URL", this);
                    PrivateLog.log("No dictionary files for this URL");
                    return new ResourcePathCursor(Collections.<WordListInfo>emptyList());
                }
            // V2_METADATA and V2_DATAFILE are not supported for query()
@@ -488,7 +488,7 @@ public final class DictionaryProvider extends ContentProvider {
    public Uri insert(final Uri uri, final ContentValues values)
            throws UnsupportedOperationException {
        if (null == uri || null == values) return null; // Should never happen but let's be safe
        PrivateLog.log("Insert, uri = " + uri.toString(), this);
        PrivateLog.log("Insert, uri = " + uri.toString());
        final String clientId = getClientId(uri);
        switch (matchUri(uri)) {
            case DICTIONARY_V2_METADATA:
@@ -517,7 +517,7 @@ public final class DictionaryProvider extends ContentProvider {
                break;
            case DICTIONARY_V1_WHOLE_LIST:
            case DICTIONARY_V1_DICT_INFO:
                PrivateLog.log("Attempt to insert : " + uri, this);
                PrivateLog.log("Attempt to insert : " + uri);
                throw new UnsupportedOperationException(
                        "Insertion in the dictionary is not supported in this version");
        }
@@ -532,7 +532,7 @@ public final class DictionaryProvider extends ContentProvider {
    @Override
    public int update(final Uri uri, final ContentValues values, final String selection,
            final String[] selectionArgs) throws UnsupportedOperationException {
        PrivateLog.log("Attempt to update : " + uri, this);
        PrivateLog.log("Attempt to update : " + uri);
        throw new UnsupportedOperationException("Updating dictionary words is not supported");
    }
}
+2 −3
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.IBinder;
import android.text.format.DateUtils;
import android.util.Log;
@@ -190,7 +189,7 @@ public final class DictionaryService extends Service {
        // is still more recent than UPDATE_FREQUENCY, do nothing.
        if (!isLastUpdateAtLeastThisOld(context, UPDATE_FREQUENCY)) return;

        PrivateLog.log("Date changed - registering alarm", context);
        PrivateLog.log("Date changed - registering alarm");
        AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);

        // Best effort to wake between midnight and MAX_ALARM_DELAY in the morning.
@@ -215,7 +214,7 @@ public final class DictionaryService extends Service {
    private static boolean isLastUpdateAtLeastThisOld(final Context context, final long time) {
        final long now = System.currentTimeMillis();
        final long lastUpdate = MetadataDbHelper.getOldestUpdateTime(context);
        PrivateLog.log("Last update was " + lastUpdate, context);
        PrivateLog.log("Last update was " + lastUpdate);
        return lastUpdate + time < now;
    }

+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@ final class LogProblemReporter implements ProblemReporter {
        TAG = tag;
    }

    @Override
    public void report(final Exception e) {
        Log.e(TAG, "Reporting problem : " + e);
        Log.e(TAG, "Reporting problem", e);
    }
}
+1 −4
Original line number Diff line number Diff line
@@ -16,13 +16,11 @@

package com.android.inputmethod.dictionarypack;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;

@@ -309,8 +307,7 @@ public class MetadataDbHelper extends SQLiteOpenHelper {
     * @param uri the metadata URI we just downloaded
     */
    public static void saveLastUpdateTimeOfUri(final Context context, final String uri) {
        PrivateLog.log("Save last update time of URI : " + uri + " " + System.currentTimeMillis(),
                context);
        PrivateLog.log("Save last update time of URI : " + uri + " " + System.currentTimeMillis());
        final ContentValues values = new ContentValues();
        values.put(CLIENT_LAST_UPDATE_DATE_COLUMN, System.currentTimeMillis());
        final SQLiteDatabase defaultDb = getDb(context, null);
Loading