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

Commit 6ec72e3f authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Merge commit 'goog/master' into merge_master

parents 6bebbcd5 3cf650de
Loading
Loading
Loading
Loading
+237 −0
Original line number Diff line number Diff line
@@ -23815,6 +23815,219 @@
</field>
</class>
</package>
<package name="android.backup"
>
<class name="BackupDataOutput"
 extends="java.lang.Object"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="BackupDataOutput"
 type="android.backup.BackupDataOutput"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="fd" type="java.io.FileDescriptor">
</parameter>
</constructor>
<method name="close"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="flush"
 return="void"
 abstract="false"
 native="true"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="write"
 return="void"
 abstract="false"
 native="true"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="buffer" type="byte[]">
</parameter>
</method>
<method name="write"
 return="void"
 abstract="false"
 native="true"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="oneByte" type="int">
</parameter>
</method>
<method name="write"
 return="void"
 abstract="false"
 native="true"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="buffer" type="byte[]">
</parameter>
<parameter name="offset" type="int">
</parameter>
<parameter name="count" type="int">
</parameter>
</method>
<method name="writeKey"
 return="void"
 abstract="false"
 native="true"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="key" type="java.lang.String">
</parameter>
</method>
<method name="writeOperation"
 return="void"
 abstract="false"
 native="true"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="op" type="int">
</parameter>
</method>
<field name="OP_DELETE"
 type="int"
 transient="false"
 volatile="false"
 value="2"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="OP_UPDATE"
 type="int"
 transient="false"
 volatile="false"
 value="1"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="FileBackupHelper"
 extends="java.lang.Object"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="FileBackupHelper"
 type="android.backup.FileBackupHelper"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<method name="performBackup"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="oldSnapshot" type="android.os.ParcelFileDescriptor">
</parameter>
<parameter name="newSnapshot" type="android.os.ParcelFileDescriptor">
</parameter>
<parameter name="data" type="android.backup.BackupDataOutput">
</parameter>
<parameter name="files" type="java.lang.String[]">
</parameter>
</method>
</class>
<class name="SharedPreferencesBackupHelper"
 extends="java.lang.Object"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="SharedPreferencesBackupHelper"
 type="android.backup.SharedPreferencesBackupHelper"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<method name="performBackup"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="oldSnapshot" type="android.os.ParcelFileDescriptor">
</parameter>
<parameter name="newSnapshot" type="android.os.ParcelFileDescriptor">
</parameter>
<parameter name="data" type="android.backup.BackupDataOutput">
</parameter>
<parameter name="prefGroups" type="java.lang.String[]">
</parameter>
</method>
</class>
</package>
<package name="android.content"
>
<class name="ActivityNotFoundException"
@@ -63082,6 +63295,30 @@
 visibility="public"
>
</method>
<method name="invalidateAllKeys"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="invalidateKey"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="keyIndex" type="int">
</parameter>
</method>
<method name="isPreviewEnabled"
 return="boolean"
 abstract="false"
+7 −5
Original line number Diff line number Diff line
@@ -316,18 +316,16 @@ public final class ActivityThread {

                float appScale = -1.0f;
                if (ai.supportsDensities != null) {
                    // TODO: precompute this in DisplayMetrics
                    float systemDensityDpi = metrics.density * DisplayMetrics.DEFAULT_DENSITY;
                    int minDiff = Integer.MAX_VALUE;
                    for (int density : ai.supportsDensities) {
                        int tmpDiff = (int) Math.abs(systemDensityDpi - density);
                        int tmpDiff = (int) Math.abs(DisplayMetrics.DEVICE_DENSITY - density);
                        if (tmpDiff == 0) {
                            appScale = 1.0f;
                            break;
                        }
                        // prefer higher density (appScale>1.0), unless that's only option.
                        if (tmpDiff < minDiff && appScale < 1.0f) {
                            appScale = systemDensityDpi / density;
                            appScale = DisplayMetrics.DEVICE_DENSITY / density;
                            minDiff = tmpDiff;
                        }
                    }
@@ -3482,6 +3480,8 @@ public final class ActivityThread {
            }
            mConfiguration.updateFrom(config);
            DisplayMetrics dm = getDisplayMetricsLocked(true);
            DisplayMetrics appDm = new DisplayMetrics();
            appDm.setTo(dm);

            // set it for java, this also affects newly created Resources
            if (config.locale != null) {
@@ -3501,7 +3501,9 @@ public final class ActivityThread {
                    WeakReference<Resources> v = it.next();
                    Resources r = v.get();
                    if (r != null) {
                        r.updateConfiguration(config, dm);
                        // keep the original density based on application cale.
                        appDm.density = r.getDisplayMetrics().density;
                        r.updateConfiguration(config, appDm);
                        //Log.i(TAG, "Updated app resources " + v.getKey()
                        //        + " " + r + ": " + r.getConfiguration());
                    } else {
+31 −0
Original line number Diff line number Diff line
@@ -1183,6 +1183,17 @@ public class SearchManager
     */
    public final static String SUGGEST_URI_PATH_QUERY = "search_suggest_query";

    /**
     * Uri path for shortcut validation.  This is the path that the search manager will use when
     * querying your content provider to refresh a shortcutted suggestion result and to check if it
     * is still valid.  When asked, a source may return an up to date result, or no result.  No
     * result indicates the shortcut refers to a no longer valid sugggestion.
     *
     * @see #SUGGEST_COLUMN_SHORTCUT_ID
     * @hide
     */
    public final static String SUGGEST_URI_PATH_SHORTCUT = "search_suggest_shortcut";
    
    /**
     * MIME type for suggestions data.  You'll use this in your suggestions content provider
     * in the getType() function.
@@ -1302,6 +1313,26 @@ public class SearchManager
     */
    public final static String SUGGEST_COLUMN_QUERY = "suggest_intent_query";

    /**
     * Column name for suggestions cursor. <i>Optional.</i>  This column is used to indicate whether
     * a search suggestion should be stored as a shortcut, and whether it should be validated.  If
     * missing, the result will be stored as a shortcut and never validated.  If set to
     * {@link #SUGGEST_NEVER_MAKE_SHORTCUT}, the result will not be stored as a shortcut.
     * Otherwise, the shortcut id will be used to check back for validation via
     * {@link #SUGGEST_URI_PATH_SHORTCUT}.
     *
     * @hide Pending API council approval.
     */
    public final static String SUGGEST_COLUMN_SHORTCUT_ID = "suggest_shortcut_id";

    /**
     * Column value for suggestion column {@link #SUGGEST_COLUMN_SHORTCUT_ID} when a suggestion
     * should not be stored as a shortcut in global search.
     *
     * @hide Pending API council approval.
     */
    public final static String SUGGEST_NEVER_MAKE_SHORTCUT = "_-1";

    /**
     * If a suggestion has this value in {@link #SUGGEST_COLUMN_INTENT_ACTION},
     * the search dialog will switch to a different suggestion source when the
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009 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 android.backup;

import android.content.Context;

import java.io.FileDescriptor;

public class BackupDataOutput {
    /* package */ FileDescriptor fd;

    public static final int OP_UPDATE = 1;
    public static final int OP_DELETE = 2;

    public BackupDataOutput(Context context, FileDescriptor fd) {
        this.fd = fd;
    }

    public void close() {
        // do we close the fd?
    }
    public native void flush();
    public native void write(byte[] buffer);
    public native void write(int oneByte);
    public native void write(byte[] buffer, int offset, int count);

    public native void writeOperation(int op);
    public native void writeKey(String key);
}
+68 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009 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 android.backup;

import android.content.Context;
import android.os.ParcelFileDescriptor;

import java.io.FileDescriptor;

public class FileBackupHelper {
    /**
     * Based on oldSnapshot, determine which of the files from the application's data directory
     * need to be backed up, write them to the data stream, and fill in newSnapshot with the
     * state as it exists now.
     */
    public static void performBackup(Context context,
            ParcelFileDescriptor oldSnapshot, ParcelFileDescriptor newSnapshot,
            BackupDataOutput data, String[] files) {
        String basePath = context.getFilesDir().getAbsolutePath();
        performBackup_checked(basePath, oldSnapshot, newSnapshot, data, files);
    }

    /**
     * Check the parameters so the native code doens't have to throw all the exceptions
     * since it's easier to do that from java.
     */
    static void performBackup_checked(String basePath,
            ParcelFileDescriptor oldSnapshot, ParcelFileDescriptor newSnapshot,
            BackupDataOutput data, String[] files) {
        if (newSnapshot == null) {
            throw new NullPointerException("newSnapshot==null");
        }
        if (data == null) {
            throw new NullPointerException("data==null");
        }
        if (data.fd == null) {
            throw new NullPointerException("data.fd==null");
        }
        if (files == null) {
            throw new NullPointerException("files==null");
        }

        int err = performBackup_native(basePath, oldSnapshot.getFileDescriptor(),
                newSnapshot.getFileDescriptor(), data.fd, files);

        if (err != 0) {
            throw new RuntimeException("Backup failed"); // TODO: more here
        }
    }

    native private static int performBackup_native(String basePath,
            FileDescriptor oldSnapshot, FileDescriptor newSnapshot,
            FileDescriptor data, String[] files);
}
Loading