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

Commit fa6eda01 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Merge commit 'goog/master' into merge_master

Conflicts:
	libs/surfaceflinger/Layer.cpp
	libs/surfaceflinger/SurfaceFlinger.cpp
	opengl/libagl/egl.cpp
	opengl/libs/EGL/egl.cpp
	opengl/libs/GLES_CM/gl.cpp
	opengl/libs/GLES_CM/gl_api.in
	opengl/libs/gl_entries.in
	opengl/libs/tools/glapigen
parents d5046059 072868a4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ LOCAL_SRC_FILES += \
	core/java/android/app/ITransientNotification.aidl \
	core/java/android/app/IWallpaperService.aidl \
	core/java/android/app/IWallpaperServiceCallback.aidl \
	core/java/android/backup/IBackupManager.aidl \
	core/java/android/backup/IBackupService.aidl \
	core/java/android/bluetooth/IBluetoothA2dp.aidl \
	core/java/android/bluetooth/IBluetoothDevice.aidl \
	core/java/android/bluetooth/IBluetoothDeviceCallback.aidl \
@@ -105,6 +107,7 @@ LOCAL_SRC_FILES += \
	core/java/com/android/internal/app/IUsageStats.aidl \
	core/java/com/android/internal/appwidget/IAppWidgetService.aidl \
	core/java/com/android/internal/appwidget/IAppWidgetHost.aidl \
	core/java/com/android/internal/backup/IBackupTransport.aidl \
	core/java/com/android/internal/os/IResultReceiver.aidl \
	core/java/com/android/internal/view/IInputContext.aidl \
	core/java/com/android/internal/view/IInputContextCallback.aidl \
+195 −18
Original line number Diff line number Diff line
@@ -848,6 +848,17 @@
 visibility="public"
>
</field>
<field name="SDCARD_WRITE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.permission.SDCARD_WRITE&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SEND_SMS"
 type="java.lang.String"
 transient="false"
@@ -1283,6 +1294,17 @@
 visibility="public"
>
</field>
<field name="STORAGE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.permission-group.STORAGE&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SYSTEM_TOOLS"
 type="java.lang.String"
 transient="false"
@@ -1553,7 +1575,7 @@
 type="int"
 transient="false"
 volatile="false"
 value="16843372"
 value="16843373"
 static="true"
 final="true"
 deprecated="not deprecated"
@@ -2605,6 +2627,17 @@
 visibility="public"
>
</field>
<field name="density"
 type="int"
 transient="false"
 volatile="false"
 value="16843372"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="dependency"
 type="int"
 transient="false"
@@ -27084,6 +27117,17 @@
 visibility="public"
>
</field>
<field name="BACKUP_SERVICE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;backup&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="BIND_AUTO_CREATE"
 type="int"
 transient="false"
@@ -33853,6 +33897,17 @@
 visibility="public"
>
</field>
<field name="supportsDensities"
 type="int[]"
 transient="false"
 volatile="false"
 value="null"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="taskAffinity"
 type="java.lang.String"
 transient="false"
@@ -35843,6 +35898,17 @@
 visibility="public"
>
</field>
<field name="GET_SUPPORTS_DENSITIES"
 type="int"
 transient="false"
 volatile="false"
 value="32768"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="GET_UNINSTALLED_PACKAGES"
 type="int"
 transient="false"
@@ -47422,7 +47488,7 @@
<method name="freeGlCaches"
 return="void"
 abstract="false"
 native="true"
 native="false"
 synchronized="false"
 static="true"
 final="false"
@@ -75477,19 +75543,6 @@
 visibility="public"
>
</constructor>
<method name="_glGetString"
 return="java.lang.String"
 abstract="false"
 native="true"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="name" type="int">
</parameter>
</method>
<method name="glActiveTexture"
 return="void"
 abstract="false"
@@ -76294,9 +76347,9 @@
<method name="glGetString"
 return="java.lang.String"
 abstract="false"
 native="false"
 native="true"
 synchronized="false"
 static="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
@@ -151860,6 +151913,25 @@
<parameter name="contentLength" type="long">
</parameter>
</method>
<method name="onExceededDatabaseQuota"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="url" type="java.lang.String">
</parameter>
<parameter name="databaseIdentifier" type="java.lang.String">
</parameter>
<parameter name="currentQuota" type="long">
</parameter>
<parameter name="quotaUpdater" type="android.webkit.WebStorage.QuotaUpdater">
</parameter>
</method>
<method name="onFormResubmission"
 return="void"
 abstract="false"
@@ -153501,6 +153573,25 @@
<parameter name="resultMsg" type="android.os.Message">
</parameter>
</method>
<method name="onExceededDatabaseQuota"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="url" type="java.lang.String">
</parameter>
<parameter name="databaseIdentifier" type="java.lang.String">
</parameter>
<parameter name="currentQuota" type="long">
</parameter>
<parameter name="quotaUpdater" type="android.webkit.WebStorage.QuotaUpdater">
</parameter>
</method>
<method name="onJsAlert"
 return="boolean"
 abstract="false"
@@ -153886,6 +153977,28 @@
 visibility="public"
>
</method>
<method name="getDatabaseEnabled"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getDatabasePath"
 return="java.lang.String"
 abstract="false"
 native="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getDefaultFixedFontSize"
 return="int"
 abstract="false"
@@ -154226,6 +154339,32 @@
<parameter name="font" type="java.lang.String">
</parameter>
</method>
<method name="setDatabaseEnabled"
 return="void"
 abstract="false"
 native="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="flag" type="boolean">
</parameter>
</method>
<method name="setDatabasePath"
 return="void"
 abstract="false"
 native="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="databasePath" type="java.lang.String">
</parameter>
</method>
<method name="setDefaultFixedFontSize"
 return="void"
 abstract="false"
@@ -154780,6 +154919,44 @@
>
</method>
</class>
<class name="WebStorage"
 extends="java.lang.Object"
 abstract="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="WebStorage"
 type="android.webkit.WebStorage"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
</class>
<interface name="WebStorage.QuotaUpdater"
 abstract="true"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<method name="updateQuota"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="newQuota" type="long">
</parameter>
</method>
</interface>
<class name="WebSyncManager"
 extends="java.lang.Object"
 abstract="true"
@@ -159749,7 +159926,7 @@
</interface>
<class name="CheckedTextView"
 extends="android.widget.TextView"
 abstract="true"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
+74 −5
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ public final class ActivityThread {
        return metrics;
    }

    Resources getTopLevelResources(String appDir) {
    Resources getTopLevelResources(String appDir, float applicationScale) {
        synchronized (mPackages) {
            //Log.w(TAG, "getTopLevelResources: " + appDir);
            WeakReference<Resources> wr = mActiveResources.get(appDir);
@@ -181,7 +181,27 @@ public final class ActivityThread {
                return null;
            }
            DisplayMetrics metrics = getDisplayMetricsLocked(false);
            r = new Resources(assets, metrics, getConfiguration());
            // density used to load resources
            // scaledDensity is calculated in Resources constructor
            //
            boolean usePreloaded = true;

            // TODO: use explicit flag to indicate the compatibility mode.
            if (applicationScale != 1.0f) {
                usePreloaded = false;
                DisplayMetrics newMetrics = new DisplayMetrics();
                newMetrics.setTo(metrics);
                float invertedScale = 1.0f / applicationScale;
                newMetrics.density *= invertedScale;
                newMetrics.xdpi *= invertedScale;
                newMetrics.ydpi *= invertedScale;
                newMetrics.widthPixels *= invertedScale;
                newMetrics.heightPixels *= invertedScale;
                metrics = newMetrics;
            }
            //Log.i(TAG, "Resource:" + appDir + ", density " + newMetrics.density + ", orig density:" +
            //      metrics.density);
            r = new Resources(assets, metrics, getConfiguration(), usePreloaded);
            //Log.i(TAG, "Created app resources " + r + ": " + r.getConfiguration());
            // XXX need to remove entries when weak references go away
            mActiveResources.put(appDir, new WeakReference<Resources>(r));
@@ -209,6 +229,8 @@ public final class ActivityThread {
        private Resources mResources;
        private ClassLoader mClassLoader;
        private Application mApplication;
        private float mApplicationScale;

        private final HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>> mReceivers
            = new HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>>();
        private final HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>> mUnregisteredReceivers
@@ -250,6 +272,8 @@ public final class ActivityThread {
                mClassLoader = mSystemContext.getClassLoader();
                mResources = mSystemContext.getResources();
            }

            mApplicationScale = -1.0f;
        }

        public PackageInfo(ActivityThread activityThread, String name,
@@ -268,6 +292,7 @@ public final class ActivityThread {
            mIncludeCode = true;
            mClassLoader = systemContext.getClassLoader();
            mResources = systemContext.getResources();
            mApplicationScale = systemContext.getApplicationScale();
        }

        public String getPackageName() {
@@ -278,6 +303,47 @@ public final class ActivityThread {
            return mSecurityViolation;
        }

        public float getApplicationScale() {
            if (mApplicationScale > 0.0f) {
                return mApplicationScale;
            }
            DisplayMetrics metrics = mActivityThread.getDisplayMetricsLocked(false);
            // Find out the density scale (relative to 160) of the supported density  that
            // is closest to the system's density.
            try {
                ApplicationInfo ai = getPackageManager().getApplicationInfo(
                        mPackageName, PackageManager.GET_SUPPORTS_DENSITIES);

                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);
                        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;
                            minDiff = tmpDiff;
                        }
                    }
                }
                if (appScale < 0.0f) {
                    mApplicationScale = metrics.density;
                } else {
                    mApplicationScale = appScale;
                }
            } catch (RemoteException e) {
                throw new AssertionError(e);
            }
            if (localLOGV) Log.v(TAG, "appScale=" + mApplicationScale + ", pkg=" + mPackageName);
            return mApplicationScale;
        }

        /**
         * Gets the array of shared libraries that are listed as
         * used by the given package.
@@ -435,7 +501,7 @@ public final class ActivityThread {

        public Resources getResources(ActivityThread mainThread) {
            if (mResources == null) {
                mResources = mainThread.getTopLevelResources(mResDir);
                mResources = mainThread.getTopLevelResources(mResDir, getApplicationScale());
            }
            return mResources;
        }
@@ -3497,6 +3563,9 @@ public final class ActivityThread {
            EventLog.writeEvent(SQLITE_MEM_RELEASED_EVENT_LOG_TAG, sqliteReleased);
        }
        
        // Ask graphics to free up as much as possible (font/image caches)
        Canvas.freeCaches();

        BinderInternal.forceGc("mem");
    }

+16 −1
Original line number Diff line number Diff line
@@ -553,6 +553,19 @@ class ApplicationContext extends Context {
        }
    }

    /**
     * @hide
     */
    @Override
    public float getApplicationScale() {
        if (mPackageInfo != null) {
            return mPackageInfo.getApplicationScale();
        } else {
            // same as system density
            return 1.0f;
        }
    }

    @Override
    public void setWallpaper(Bitmap bitmap) throws IOException  {
        try {
@@ -2024,9 +2037,11 @@ class ApplicationContext extends Context {
            if (app.packageName.equals("system")) {
                return mContext.mMainThread.getSystemContext().getResources();
            }
            ActivityThread.PackageInfo pi = mContext.mMainThread.getPackageInfoNoCheck(app);
            Resources r = mContext.mMainThread.getTopLevelResources(
                    app.uid == Process.myUid() ? app.sourceDir
                    : app.publicSourceDir);
                    : app.publicSourceDir,
                    pi.getApplicationScale());
            if (r != null) {
                return r;
            }
+1 −0
Original line number Diff line number Diff line
@@ -22,4 +22,5 @@ import android.server.search.SearchableInfo;
/** @hide */
interface ISearchManager {
   SearchableInfo getSearchableInfo(in ComponentName launchActivity, boolean globalSearch);
   List<SearchableInfo> getSearchablesInGlobalSearch();
}
Loading