Loading api/current.xml +362 −54 Original line number Original line Diff line number Diff line Loading @@ -1145,33 +1145,33 @@ visibility="public" visibility="public" > > </field> </field> <field name="WRITE_GSERVICES" <field name="WRITE_EXTERNAL_STORAGE" type="java.lang.String" type="java.lang.String" transient="false" transient="false" volatile="false" volatile="false" value=""android.permission.WRITE_GSERVICES"" value=""android.permission.WRITE_EXTERNAL_STORAGE"" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > </field> </field> <field name="WRITE_OWNER_DATA" <field name="WRITE_GSERVICES" type="java.lang.String" type="java.lang.String" transient="false" transient="false" volatile="false" volatile="false" value=""android.permission.WRITE_OWNER_DATA"" value=""android.permission.WRITE_GSERVICES"" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > </field> </field> <field name="WRITE_EXTERNAL_STORAGE" <field name="WRITE_OWNER_DATA" type="java.lang.String" type="java.lang.String" transient="false" transient="false" volatile="false" volatile="false" value=""android.permission.WRITE_EXTERNAL_STORAGE"" value=""android.permission.WRITE_OWNER_DATA"" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" Loading Loading @@ -28029,7 +28029,7 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="operations" type="android.content.ContentProviderOperation[]"> <parameter name="operations" type="java.util.ArrayList<android.content.ContentProviderOperation>"> </parameter> </parameter> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> </exception> </exception> Loading Loading @@ -28373,7 +28373,7 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="operations" type="android.content.ContentProviderOperation[]"> <parameter name="operations" type="java.util.ArrayList<android.content.ContentProviderOperation>"> </parameter> </parameter> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> </exception> </exception> Loading Loading @@ -28808,7 +28808,7 @@ visibility="public" visibility="public" > > </method> </method> <method name="withEntity" <method name="withExpectedCount" return="android.content.ContentProviderOperation.Builder" return="android.content.ContentProviderOperation.Builder" abstract="false" abstract="false" native="false" native="false" Loading @@ -28818,10 +28818,10 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="entity" type="android.content.Entity"> <parameter name="count" type="int"> </parameter> </parameter> </method> </method> <method name="withExpectedCount" <method name="withSelection" return="android.content.ContentProviderOperation.Builder" return="android.content.ContentProviderOperation.Builder" abstract="false" abstract="false" native="false" native="false" Loading @@ -28831,10 +28831,12 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="count" type="int"> <parameter name="selection" type="java.lang.String"> </parameter> <parameter name="selectionArgs" type="java.lang.String[]"> </parameter> </parameter> </method> </method> <method name="withSelection" <method name="withSelectionBackReference" return="android.content.ContentProviderOperation.Builder" return="android.content.ContentProviderOperation.Builder" abstract="false" abstract="false" native="false" native="false" Loading @@ -28844,12 +28846,12 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="selection" type="java.lang.String"> <parameter name="selectionArgIndex" type="int"> </parameter> </parameter> <parameter name="selectionArgs" type="java.lang.String[]"> <parameter name="previousResult" type="int"> </parameter> </parameter> </method> </method> <method name="withSelectionBackReferences" <method name="withValue" return="android.content.ContentProviderOperation.Builder" return="android.content.ContentProviderOperation.Builder" abstract="false" abstract="false" native="false" native="false" Loading @@ -28859,7 +28861,24 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="backReferences" type="java.util.Map<java.lang.Integer, java.lang.Integer>"> <parameter name="key" type="java.lang.String"> </parameter> <parameter name="value" type="java.lang.Object"> </parameter> </method> <method name="withValueBackReference" return="android.content.ContentProviderOperation.Builder" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="key" type="java.lang.String"> </parameter> <parameter name="previousResult" type="int"> </parameter> </parameter> </method> </method> <method name="withValueBackReferences" <method name="withValueBackReferences" Loading Loading @@ -29126,7 +29145,7 @@ > > <parameter name="authority" type="java.lang.String"> <parameter name="authority" type="java.lang.String"> </parameter> </parameter> <parameter name="operations" type="android.content.ContentProviderOperation[]"> <parameter name="operations" type="java.util.ArrayList<android.content.ContentProviderOperation>"> </parameter> </parameter> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> </exception> </exception> Loading Loading @@ -29206,23 +29225,6 @@ <parameter name="values" type="android.content.ContentValues"> <parameter name="values" type="android.content.ContentValues"> </parameter> </parameter> </method> </method> <method name="insertEntity" return="android.net.Uri" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="uri" type="android.net.Uri"> </parameter> <parameter name="entity" type="android.content.Entity"> </parameter> <exception name="RemoteException" type="android.os.RemoteException"> </exception> </method> <method name="notifyChange" <method name="notifyChange" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -29442,23 +29444,6 @@ <parameter name="selectionArgs" type="java.lang.String[]"> <parameter name="selectionArgs" type="java.lang.String[]"> </parameter> </parameter> </method> </method> <method name="updateEntity" return="int" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="uri" type="android.net.Uri"> </parameter> <parameter name="entity" type="android.content.Entity"> </parameter> <exception name="RemoteException" type="android.os.RemoteException"> </exception> </method> <method name="validateSyncExtrasBundle" <method name="validateSyncExtrasBundle" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -32623,9 +32608,9 @@ </interface> </interface> <class name="Entity" <class name="Entity" extends="java.lang.Object" extends="java.lang.Object" abstract="true" abstract="false" static="false" static="false" final="false" final="true" deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > Loading @@ -32638,7 +32623,123 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="values" type="android.content.ContentValues"> </parameter> </constructor> </constructor> <method name="addSubValue" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="uri" type="android.net.Uri"> </parameter> <parameter name="values" type="android.content.ContentValues"> </parameter> </method> <method name="describeContents" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getEntityValues" return="android.content.ContentValues" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getSubValues" return="java.util.ArrayList<android.content.Entity.NamedContentValues>" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="writeToParcel" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="dest" type="android.os.Parcel"> </parameter> <parameter name="flags" type="int"> </parameter> </method> <field name="CREATOR" type="android.os.Parcelable.Creator" transient="false" volatile="false" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> </class> <class name="Entity.NamedContentValues" extends="java.lang.Object" abstract="false" static="true" final="false" deprecated="not deprecated" visibility="public" > <constructor name="Entity.NamedContentValues" type="android.content.Entity.NamedContentValues" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="uri" type="android.net.Uri"> </parameter> <parameter name="values" type="android.content.ContentValues"> </parameter> </constructor> <field name="uri" type="android.net.Uri" transient="false" volatile="false" static="false" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="values" type="android.content.ContentValues" transient="false" volatile="false" static="false" final="true" deprecated="not deprecated" visibility="public" > </field> </class> </class> <interface name="EntityIterator" <interface name="EntityIterator" abstract="true" abstract="true" Loading Loading @@ -38091,6 +38192,16 @@ visibility="public" visibility="public" > > </field> </field> <field name="expandable" type="boolean" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="flags" <field name="flags" type="int" type="int" transient="false" transient="false" Loading Loading @@ -39948,6 +40059,17 @@ visibility="public" visibility="public" > > </field> </field> <field name="GET_EXPANDABLE" type="int" transient="false" volatile="false" value="131072" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="GET_GIDS" <field name="GET_GIDS" type="int" type="int" transient="false" transient="false" Loading Loading @@ -44377,6 +44499,32 @@ <parameter name="columnIndex" type="int"> <parameter name="columnIndex" type="int"> </parameter> </parameter> </method> </method> <method name="isFloat" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="columnIndex" type="int"> </parameter> </method> <method name="isLong" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="columnIndex" type="int"> </parameter> </method> <method name="isNull" <method name="isNull" return="boolean" return="boolean" abstract="false" abstract="false" Loading @@ -44390,6 +44538,19 @@ <parameter name="columnIndex" type="int"> <parameter name="columnIndex" type="int"> </parameter> </parameter> </method> </method> <method name="isString" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="columnIndex" type="int"> </parameter> </method> <method name="setWindow" <method name="setWindow" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -45470,6 +45631,36 @@ <parameter name="col" type="int"> <parameter name="col" type="int"> </parameter> </parameter> </method> </method> <method name="isFloat" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="row" type="int"> </parameter> <parameter name="col" type="int"> </parameter> </method> <method name="isLong" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="row" type="int"> </parameter> <parameter name="col" type="int"> </parameter> </method> <method name="isNull" <method name="isNull" return="boolean" return="boolean" abstract="false" abstract="false" Loading @@ -45485,6 +45676,21 @@ <parameter name="col" type="int"> <parameter name="col" type="int"> </parameter> </parameter> </method> </method> <method name="isString" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="row" type="int"> </parameter> <parameter name="col" type="int"> </parameter> </method> <method name="newFromParcel" <method name="newFromParcel" return="android.database.CursorWindow" return="android.database.CursorWindow" abstract="false" abstract="false" Loading Loading @@ -49914,6 +50120,19 @@ <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturePerformedListener"> <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturePerformedListener"> </parameter> </parameter> </method> </method> <method name="addOnGesturingListener" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturingListener"> </parameter> </method> <method name="cancelClearAnimation" <method name="cancelClearAnimation" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -50114,6 +50333,17 @@ visibility="public" visibility="public" > > </method> </method> <method name="removeAllOnGesturingListeners" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="removeOnGestureListener" <method name="removeOnGestureListener" return="void" return="void" abstract="false" abstract="false" Loading @@ -50140,6 +50370,19 @@ <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturePerformedListener"> <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturePerformedListener"> </parameter> </parameter> </method> </method> <method name="removeOnGesturingListener" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturingListener"> </parameter> </method> <method name="setEventsInterceptionEnabled" <method name="setEventsInterceptionEnabled" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -50419,6 +50662,40 @@ </parameter> </parameter> </method> </method> </interface> </interface> <interface name="GestureOverlayView.OnGesturingListener" abstract="true" static="true" final="false" deprecated="not deprecated" visibility="public" > <method name="onGesturingEnded" return="void" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="overlay" type="android.gesture.GestureOverlayView"> </parameter> </method> <method name="onGesturingStarted" return="void" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="overlay" type="android.gesture.GestureOverlayView"> </parameter> </method> </interface> <class name="GesturePoint" <class name="GesturePoint" extends="java.lang.Object" extends="java.lang.Object" abstract="false" abstract="false" Loading Loading @@ -51855,6 +52132,16 @@ visibility="public" visibility="public" > > </field> </field> <field name="inInputShareable" type="boolean" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="inJustDecodeBounds" <field name="inJustDecodeBounds" type="boolean" type="boolean" transient="false" transient="false" Loading @@ -51875,6 +52162,16 @@ visibility="public" visibility="public" > > </field> </field> <field name="inPurgeable" type="boolean" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="inSampleSize" <field name="inSampleSize" type="int" type="int" transient="false" transient="false" Loading Loading @@ -111435,6 +111732,17 @@ visibility="public" visibility="public" > > </field> </field> <field name="SHOW_WEB_SUGGESTIONS" type="java.lang.String" transient="false" volatile="false" value=""show_web_suggestions"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="SOUND_EFFECTS_ENABLED" <field name="SOUND_EFFECTS_ENABLED" type="java.lang.String" type="java.lang.String" transient="false" transient="false" cmds/am/src/com/android/commands/am/Am.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -526,7 +526,7 @@ public class Am { private void showUsage() { private void showUsage() { System.err.println("usage: am [start|broadcast|instrument|profile]"); System.err.println("usage: am [start|broadcast|instrument|profile]"); System.err.println(" am start -D INTENT"); System.err.println(" am start [-D] INTENT"); System.err.println(" am broadcast INTENT"); System.err.println(" am broadcast INTENT"); System.err.println(" am instrument [-r] [-e <ARG_NAME> <ARG_VALUE>] [-p <PROF_FILE>]"); System.err.println(" am instrument [-r] [-e <ARG_NAME> <ARG_VALUE>] [-p <PROF_FILE>]"); System.err.println(" [-w] <COMPONENT> "); System.err.println(" [-w] <COMPONENT> "); Loading cmds/backup/backup.cpp +16 −1 Original line number Original line 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. */ #include <utils/backup_helpers.h> #include <utils/BackupHelpers.h> #include <utils/String8.h> #include <utils/String8.h> #include <fcntl.h> #include <fcntl.h> Loading core/java/android/app/ActivityThread.java +12 −67 Original line number Original line Diff line number Diff line Loading @@ -162,7 +162,7 @@ public final class ActivityThread { return metrics; return metrics; } } Resources getTopLevelResources(String appDir, float applicationScale) { Resources getTopLevelResources(String appDir, PackageInfo pkgInfo) { synchronized (mPackages) { synchronized (mPackages) { //Log.w(TAG, "getTopLevelResources: " + appDir); //Log.w(TAG, "getTopLevelResources: " + appDir); WeakReference<Resources> wr = mActiveResources.get(appDir); WeakReference<Resources> wr = mActiveResources.get(appDir); Loading @@ -181,23 +181,17 @@ public final class ActivityThread { if (assets.addAssetPath(appDir) == 0) { if (assets.addAssetPath(appDir) == 0) { return null; return null; } } DisplayMetrics metrics = getDisplayMetricsLocked(false); ApplicationInfo appInfo; // density used to load resources try { // scaledDensity is calculated in Resources constructor appInfo = getPackageManager().getApplicationInfo( // pkgInfo.getPackageName(), boolean usePreloaded = true; PackageManager.GET_SUPPORTS_DENSITIES | PackageManager.GET_EXPANDABLE); } catch (RemoteException e) { // TODO: use explicit flag to indicate the compatibility mode. throw new AssertionError(e); if (applicationScale != 1.0f) { usePreloaded = false; DisplayMetrics newMetrics = new DisplayMetrics(); newMetrics.setTo(metrics); float newDensity = metrics.density / applicationScale; newMetrics.updateDensity(newDensity); metrics = newMetrics; } } //Log.i(TAG, "Resource:" + appDir + ", display metrics=" + metrics); //Log.i(TAG, "Resource:" + appDir + ", display metrics=" + metrics); r = new Resources(assets, metrics, getConfiguration(), usePreloaded); DisplayMetrics metrics = getDisplayMetricsLocked(false); r = new Resources(assets, metrics, getConfiguration(), appInfo); //Log.i(TAG, "Created app resources " + r + ": " + r.getConfiguration()); //Log.i(TAG, "Created app resources " + r + ": " + r.getConfiguration()); // XXX need to remove entries when weak references go away // XXX need to remove entries when weak references go away mActiveResources.put(appDir, new WeakReference<Resources>(r)); mActiveResources.put(appDir, new WeakReference<Resources>(r)); Loading Loading @@ -225,7 +219,6 @@ public final class ActivityThread { private Resources mResources; private Resources mResources; private ClassLoader mClassLoader; private ClassLoader mClassLoader; private Application mApplication; private Application mApplication; private float mApplicationScale; private final HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>> mReceivers private final HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>> mReceivers = new HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>>(); = new HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>>(); Loading Loading @@ -268,8 +261,6 @@ public final class ActivityThread { mClassLoader = mSystemContext.getClassLoader(); mClassLoader = mSystemContext.getClassLoader(); mResources = mSystemContext.getResources(); mResources = mSystemContext.getResources(); } } mApplicationScale = -1.0f; } } public PackageInfo(ActivityThread activityThread, String name, public PackageInfo(ActivityThread activityThread, String name, Loading @@ -288,7 +279,6 @@ public final class ActivityThread { mIncludeCode = true; mIncludeCode = true; mClassLoader = systemContext.getClassLoader(); mClassLoader = systemContext.getClassLoader(); mResources = systemContext.getResources(); mResources = systemContext.getResources(); mApplicationScale = systemContext.getApplicationScale(); } } public String getPackageName() { public String getPackageName() { Loading @@ -299,45 +289,6 @@ public final class ActivityThread { return mSecurityViolation; 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) { int minDiff = Integer.MAX_VALUE; for (int density : ai.supportsDensities) { 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 = DisplayMetrics.DEVICE_DENSITY / 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 * Gets the array of shared libraries that are listed as * used by the given package. * used by the given package. Loading Loading @@ -495,7 +446,7 @@ public final class ActivityThread { public Resources getResources(ActivityThread mainThread) { public Resources getResources(ActivityThread mainThread) { if (mResources == null) { if (mResources == null) { mResources = mainThread.getTopLevelResources(mResDir, getApplicationScale()); mResources = mainThread.getTopLevelResources(mResDir, this); } } return mResources; return mResources; } } Loading Loading @@ -3606,8 +3557,6 @@ public final class ActivityThread { } } mConfiguration.updateFrom(config); mConfiguration.updateFrom(config); DisplayMetrics dm = getDisplayMetricsLocked(true); DisplayMetrics dm = getDisplayMetricsLocked(true); DisplayMetrics appDm = new DisplayMetrics(); appDm.setTo(dm); // set it for java, this also affects newly created Resources // set it for java, this also affects newly created Resources if (config.locale != null) { if (config.locale != null) { Loading @@ -3627,11 +3576,7 @@ public final class ActivityThread { WeakReference<Resources> v = it.next(); WeakReference<Resources> v = it.next(); Resources r = v.get(); Resources r = v.get(); if (r != null) { if (r != null) { // keep the original density based on application cale. r.updateConfiguration(config, dm); appDm.updateDensity(r.getDisplayMetrics().density); r.updateConfiguration(config, appDm); // reset appDm.setTo(dm); //Log.i(TAG, "Updated app resources " + v.getKey() //Log.i(TAG, "Updated app resources " + v.getKey() // + " " + r + ": " + r.getConfiguration()); // + " " + r + ": " + r.getConfiguration()); } else { } else { Loading core/java/android/app/ApplicationContext.java +11 −15 Original line number Original line Diff line number Diff line Loading @@ -554,19 +554,6 @@ class ApplicationContext extends Context { } } } } /** * @hide */ @Override public float getApplicationScale() { if (mPackageInfo != null) { return mPackageInfo.getApplicationScale(); } else { // same as system density return 1.0f; } } @Override @Override public void setWallpaper(Bitmap bitmap) throws IOException { public void setWallpaper(Bitmap bitmap) throws IOException { try { try { Loading Loading @@ -2044,8 +2031,7 @@ class ApplicationContext extends Context { ActivityThread.PackageInfo pi = mContext.mMainThread.getPackageInfoNoCheck(app); ActivityThread.PackageInfo pi = mContext.mMainThread.getPackageInfoNoCheck(app); Resources r = mContext.mMainThread.getTopLevelResources( Resources r = mContext.mMainThread.getTopLevelResources( app.uid == Process.myUid() ? app.sourceDir app.uid == Process.myUid() ? app.sourceDir : app.publicSourceDir, : app.publicSourceDir, pi); pi.getApplicationScale()); if (r != null) { if (r != null) { return r; return r; } } Loading Loading @@ -2440,6 +2426,16 @@ class ApplicationContext extends Context { } } } } @Override public void replacePreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity) { try { mPM.replacePreferredActivity(filter, match, set, activity); } catch (RemoteException e) { // Should never happen! } } @Override @Override public void clearPackagePreferredActivities(String packageName) { public void clearPackagePreferredActivities(String packageName) { try { try { Loading Loading
api/current.xml +362 −54 Original line number Original line Diff line number Diff line Loading @@ -1145,33 +1145,33 @@ visibility="public" visibility="public" > > </field> </field> <field name="WRITE_GSERVICES" <field name="WRITE_EXTERNAL_STORAGE" type="java.lang.String" type="java.lang.String" transient="false" transient="false" volatile="false" volatile="false" value=""android.permission.WRITE_GSERVICES"" value=""android.permission.WRITE_EXTERNAL_STORAGE"" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > </field> </field> <field name="WRITE_OWNER_DATA" <field name="WRITE_GSERVICES" type="java.lang.String" type="java.lang.String" transient="false" transient="false" volatile="false" volatile="false" value=""android.permission.WRITE_OWNER_DATA"" value=""android.permission.WRITE_GSERVICES"" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > </field> </field> <field name="WRITE_EXTERNAL_STORAGE" <field name="WRITE_OWNER_DATA" type="java.lang.String" type="java.lang.String" transient="false" transient="false" volatile="false" volatile="false" value=""android.permission.WRITE_EXTERNAL_STORAGE"" value=""android.permission.WRITE_OWNER_DATA"" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" Loading Loading @@ -28029,7 +28029,7 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="operations" type="android.content.ContentProviderOperation[]"> <parameter name="operations" type="java.util.ArrayList<android.content.ContentProviderOperation>"> </parameter> </parameter> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> </exception> </exception> Loading Loading @@ -28373,7 +28373,7 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="operations" type="android.content.ContentProviderOperation[]"> <parameter name="operations" type="java.util.ArrayList<android.content.ContentProviderOperation>"> </parameter> </parameter> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> </exception> </exception> Loading Loading @@ -28808,7 +28808,7 @@ visibility="public" visibility="public" > > </method> </method> <method name="withEntity" <method name="withExpectedCount" return="android.content.ContentProviderOperation.Builder" return="android.content.ContentProviderOperation.Builder" abstract="false" abstract="false" native="false" native="false" Loading @@ -28818,10 +28818,10 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="entity" type="android.content.Entity"> <parameter name="count" type="int"> </parameter> </parameter> </method> </method> <method name="withExpectedCount" <method name="withSelection" return="android.content.ContentProviderOperation.Builder" return="android.content.ContentProviderOperation.Builder" abstract="false" abstract="false" native="false" native="false" Loading @@ -28831,10 +28831,12 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="count" type="int"> <parameter name="selection" type="java.lang.String"> </parameter> <parameter name="selectionArgs" type="java.lang.String[]"> </parameter> </parameter> </method> </method> <method name="withSelection" <method name="withSelectionBackReference" return="android.content.ContentProviderOperation.Builder" return="android.content.ContentProviderOperation.Builder" abstract="false" abstract="false" native="false" native="false" Loading @@ -28844,12 +28846,12 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="selection" type="java.lang.String"> <parameter name="selectionArgIndex" type="int"> </parameter> </parameter> <parameter name="selectionArgs" type="java.lang.String[]"> <parameter name="previousResult" type="int"> </parameter> </parameter> </method> </method> <method name="withSelectionBackReferences" <method name="withValue" return="android.content.ContentProviderOperation.Builder" return="android.content.ContentProviderOperation.Builder" abstract="false" abstract="false" native="false" native="false" Loading @@ -28859,7 +28861,24 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="backReferences" type="java.util.Map<java.lang.Integer, java.lang.Integer>"> <parameter name="key" type="java.lang.String"> </parameter> <parameter name="value" type="java.lang.Object"> </parameter> </method> <method name="withValueBackReference" return="android.content.ContentProviderOperation.Builder" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="key" type="java.lang.String"> </parameter> <parameter name="previousResult" type="int"> </parameter> </parameter> </method> </method> <method name="withValueBackReferences" <method name="withValueBackReferences" Loading Loading @@ -29126,7 +29145,7 @@ > > <parameter name="authority" type="java.lang.String"> <parameter name="authority" type="java.lang.String"> </parameter> </parameter> <parameter name="operations" type="android.content.ContentProviderOperation[]"> <parameter name="operations" type="java.util.ArrayList<android.content.ContentProviderOperation>"> </parameter> </parameter> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> <exception name="OperationApplicationException" type="android.content.OperationApplicationException"> </exception> </exception> Loading Loading @@ -29206,23 +29225,6 @@ <parameter name="values" type="android.content.ContentValues"> <parameter name="values" type="android.content.ContentValues"> </parameter> </parameter> </method> </method> <method name="insertEntity" return="android.net.Uri" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="uri" type="android.net.Uri"> </parameter> <parameter name="entity" type="android.content.Entity"> </parameter> <exception name="RemoteException" type="android.os.RemoteException"> </exception> </method> <method name="notifyChange" <method name="notifyChange" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -29442,23 +29444,6 @@ <parameter name="selectionArgs" type="java.lang.String[]"> <parameter name="selectionArgs" type="java.lang.String[]"> </parameter> </parameter> </method> </method> <method name="updateEntity" return="int" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="uri" type="android.net.Uri"> </parameter> <parameter name="entity" type="android.content.Entity"> </parameter> <exception name="RemoteException" type="android.os.RemoteException"> </exception> </method> <method name="validateSyncExtrasBundle" <method name="validateSyncExtrasBundle" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -32623,9 +32608,9 @@ </interface> </interface> <class name="Entity" <class name="Entity" extends="java.lang.Object" extends="java.lang.Object" abstract="true" abstract="false" static="false" static="false" final="false" final="true" deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > Loading @@ -32638,7 +32623,123 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="values" type="android.content.ContentValues"> </parameter> </constructor> </constructor> <method name="addSubValue" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="uri" type="android.net.Uri"> </parameter> <parameter name="values" type="android.content.ContentValues"> </parameter> </method> <method name="describeContents" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getEntityValues" return="android.content.ContentValues" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getSubValues" return="java.util.ArrayList<android.content.Entity.NamedContentValues>" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="writeToParcel" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="dest" type="android.os.Parcel"> </parameter> <parameter name="flags" type="int"> </parameter> </method> <field name="CREATOR" type="android.os.Parcelable.Creator" transient="false" volatile="false" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> </class> <class name="Entity.NamedContentValues" extends="java.lang.Object" abstract="false" static="true" final="false" deprecated="not deprecated" visibility="public" > <constructor name="Entity.NamedContentValues" type="android.content.Entity.NamedContentValues" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="uri" type="android.net.Uri"> </parameter> <parameter name="values" type="android.content.ContentValues"> </parameter> </constructor> <field name="uri" type="android.net.Uri" transient="false" volatile="false" static="false" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="values" type="android.content.ContentValues" transient="false" volatile="false" static="false" final="true" deprecated="not deprecated" visibility="public" > </field> </class> </class> <interface name="EntityIterator" <interface name="EntityIterator" abstract="true" abstract="true" Loading Loading @@ -38091,6 +38192,16 @@ visibility="public" visibility="public" > > </field> </field> <field name="expandable" type="boolean" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="flags" <field name="flags" type="int" type="int" transient="false" transient="false" Loading Loading @@ -39948,6 +40059,17 @@ visibility="public" visibility="public" > > </field> </field> <field name="GET_EXPANDABLE" type="int" transient="false" volatile="false" value="131072" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="GET_GIDS" <field name="GET_GIDS" type="int" type="int" transient="false" transient="false" Loading Loading @@ -44377,6 +44499,32 @@ <parameter name="columnIndex" type="int"> <parameter name="columnIndex" type="int"> </parameter> </parameter> </method> </method> <method name="isFloat" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="columnIndex" type="int"> </parameter> </method> <method name="isLong" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="columnIndex" type="int"> </parameter> </method> <method name="isNull" <method name="isNull" return="boolean" return="boolean" abstract="false" abstract="false" Loading @@ -44390,6 +44538,19 @@ <parameter name="columnIndex" type="int"> <parameter name="columnIndex" type="int"> </parameter> </parameter> </method> </method> <method name="isString" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="columnIndex" type="int"> </parameter> </method> <method name="setWindow" <method name="setWindow" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -45470,6 +45631,36 @@ <parameter name="col" type="int"> <parameter name="col" type="int"> </parameter> </parameter> </method> </method> <method name="isFloat" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="row" type="int"> </parameter> <parameter name="col" type="int"> </parameter> </method> <method name="isLong" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="row" type="int"> </parameter> <parameter name="col" type="int"> </parameter> </method> <method name="isNull" <method name="isNull" return="boolean" return="boolean" abstract="false" abstract="false" Loading @@ -45485,6 +45676,21 @@ <parameter name="col" type="int"> <parameter name="col" type="int"> </parameter> </parameter> </method> </method> <method name="isString" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="row" type="int"> </parameter> <parameter name="col" type="int"> </parameter> </method> <method name="newFromParcel" <method name="newFromParcel" return="android.database.CursorWindow" return="android.database.CursorWindow" abstract="false" abstract="false" Loading Loading @@ -49914,6 +50120,19 @@ <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturePerformedListener"> <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturePerformedListener"> </parameter> </parameter> </method> </method> <method name="addOnGesturingListener" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturingListener"> </parameter> </method> <method name="cancelClearAnimation" <method name="cancelClearAnimation" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -50114,6 +50333,17 @@ visibility="public" visibility="public" > > </method> </method> <method name="removeAllOnGesturingListeners" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="removeOnGestureListener" <method name="removeOnGestureListener" return="void" return="void" abstract="false" abstract="false" Loading @@ -50140,6 +50370,19 @@ <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturePerformedListener"> <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturePerformedListener"> </parameter> </parameter> </method> </method> <method name="removeOnGesturingListener" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="listener" type="android.gesture.GestureOverlayView.OnGesturingListener"> </parameter> </method> <method name="setEventsInterceptionEnabled" <method name="setEventsInterceptionEnabled" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -50419,6 +50662,40 @@ </parameter> </parameter> </method> </method> </interface> </interface> <interface name="GestureOverlayView.OnGesturingListener" abstract="true" static="true" final="false" deprecated="not deprecated" visibility="public" > <method name="onGesturingEnded" return="void" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="overlay" type="android.gesture.GestureOverlayView"> </parameter> </method> <method name="onGesturingStarted" return="void" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="overlay" type="android.gesture.GestureOverlayView"> </parameter> </method> </interface> <class name="GesturePoint" <class name="GesturePoint" extends="java.lang.Object" extends="java.lang.Object" abstract="false" abstract="false" Loading Loading @@ -51855,6 +52132,16 @@ visibility="public" visibility="public" > > </field> </field> <field name="inInputShareable" type="boolean" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="inJustDecodeBounds" <field name="inJustDecodeBounds" type="boolean" type="boolean" transient="false" transient="false" Loading @@ -51875,6 +52162,16 @@ visibility="public" visibility="public" > > </field> </field> <field name="inPurgeable" type="boolean" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="inSampleSize" <field name="inSampleSize" type="int" type="int" transient="false" transient="false" Loading Loading @@ -111435,6 +111732,17 @@ visibility="public" visibility="public" > > </field> </field> <field name="SHOW_WEB_SUGGESTIONS" type="java.lang.String" transient="false" volatile="false" value=""show_web_suggestions"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="SOUND_EFFECTS_ENABLED" <field name="SOUND_EFFECTS_ENABLED" type="java.lang.String" type="java.lang.String" transient="false" transient="false"
cmds/am/src/com/android/commands/am/Am.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -526,7 +526,7 @@ public class Am { private void showUsage() { private void showUsage() { System.err.println("usage: am [start|broadcast|instrument|profile]"); System.err.println("usage: am [start|broadcast|instrument|profile]"); System.err.println(" am start -D INTENT"); System.err.println(" am start [-D] INTENT"); System.err.println(" am broadcast INTENT"); System.err.println(" am broadcast INTENT"); System.err.println(" am instrument [-r] [-e <ARG_NAME> <ARG_VALUE>] [-p <PROF_FILE>]"); System.err.println(" am instrument [-r] [-e <ARG_NAME> <ARG_VALUE>] [-p <PROF_FILE>]"); System.err.println(" [-w] <COMPONENT> "); System.err.println(" [-w] <COMPONENT> "); Loading
cmds/backup/backup.cpp +16 −1 Original line number Original line 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. */ #include <utils/backup_helpers.h> #include <utils/BackupHelpers.h> #include <utils/String8.h> #include <utils/String8.h> #include <fcntl.h> #include <fcntl.h> Loading
core/java/android/app/ActivityThread.java +12 −67 Original line number Original line Diff line number Diff line Loading @@ -162,7 +162,7 @@ public final class ActivityThread { return metrics; return metrics; } } Resources getTopLevelResources(String appDir, float applicationScale) { Resources getTopLevelResources(String appDir, PackageInfo pkgInfo) { synchronized (mPackages) { synchronized (mPackages) { //Log.w(TAG, "getTopLevelResources: " + appDir); //Log.w(TAG, "getTopLevelResources: " + appDir); WeakReference<Resources> wr = mActiveResources.get(appDir); WeakReference<Resources> wr = mActiveResources.get(appDir); Loading @@ -181,23 +181,17 @@ public final class ActivityThread { if (assets.addAssetPath(appDir) == 0) { if (assets.addAssetPath(appDir) == 0) { return null; return null; } } DisplayMetrics metrics = getDisplayMetricsLocked(false); ApplicationInfo appInfo; // density used to load resources try { // scaledDensity is calculated in Resources constructor appInfo = getPackageManager().getApplicationInfo( // pkgInfo.getPackageName(), boolean usePreloaded = true; PackageManager.GET_SUPPORTS_DENSITIES | PackageManager.GET_EXPANDABLE); } catch (RemoteException e) { // TODO: use explicit flag to indicate the compatibility mode. throw new AssertionError(e); if (applicationScale != 1.0f) { usePreloaded = false; DisplayMetrics newMetrics = new DisplayMetrics(); newMetrics.setTo(metrics); float newDensity = metrics.density / applicationScale; newMetrics.updateDensity(newDensity); metrics = newMetrics; } } //Log.i(TAG, "Resource:" + appDir + ", display metrics=" + metrics); //Log.i(TAG, "Resource:" + appDir + ", display metrics=" + metrics); r = new Resources(assets, metrics, getConfiguration(), usePreloaded); DisplayMetrics metrics = getDisplayMetricsLocked(false); r = new Resources(assets, metrics, getConfiguration(), appInfo); //Log.i(TAG, "Created app resources " + r + ": " + r.getConfiguration()); //Log.i(TAG, "Created app resources " + r + ": " + r.getConfiguration()); // XXX need to remove entries when weak references go away // XXX need to remove entries when weak references go away mActiveResources.put(appDir, new WeakReference<Resources>(r)); mActiveResources.put(appDir, new WeakReference<Resources>(r)); Loading Loading @@ -225,7 +219,6 @@ public final class ActivityThread { private Resources mResources; private Resources mResources; private ClassLoader mClassLoader; private ClassLoader mClassLoader; private Application mApplication; private Application mApplication; private float mApplicationScale; private final HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>> mReceivers private final HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>> mReceivers = new HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>>(); = new HashMap<Context, HashMap<BroadcastReceiver, ReceiverDispatcher>>(); Loading Loading @@ -268,8 +261,6 @@ public final class ActivityThread { mClassLoader = mSystemContext.getClassLoader(); mClassLoader = mSystemContext.getClassLoader(); mResources = mSystemContext.getResources(); mResources = mSystemContext.getResources(); } } mApplicationScale = -1.0f; } } public PackageInfo(ActivityThread activityThread, String name, public PackageInfo(ActivityThread activityThread, String name, Loading @@ -288,7 +279,6 @@ public final class ActivityThread { mIncludeCode = true; mIncludeCode = true; mClassLoader = systemContext.getClassLoader(); mClassLoader = systemContext.getClassLoader(); mResources = systemContext.getResources(); mResources = systemContext.getResources(); mApplicationScale = systemContext.getApplicationScale(); } } public String getPackageName() { public String getPackageName() { Loading @@ -299,45 +289,6 @@ public final class ActivityThread { return mSecurityViolation; 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) { int minDiff = Integer.MAX_VALUE; for (int density : ai.supportsDensities) { 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 = DisplayMetrics.DEVICE_DENSITY / 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 * Gets the array of shared libraries that are listed as * used by the given package. * used by the given package. Loading Loading @@ -495,7 +446,7 @@ public final class ActivityThread { public Resources getResources(ActivityThread mainThread) { public Resources getResources(ActivityThread mainThread) { if (mResources == null) { if (mResources == null) { mResources = mainThread.getTopLevelResources(mResDir, getApplicationScale()); mResources = mainThread.getTopLevelResources(mResDir, this); } } return mResources; return mResources; } } Loading Loading @@ -3606,8 +3557,6 @@ public final class ActivityThread { } } mConfiguration.updateFrom(config); mConfiguration.updateFrom(config); DisplayMetrics dm = getDisplayMetricsLocked(true); DisplayMetrics dm = getDisplayMetricsLocked(true); DisplayMetrics appDm = new DisplayMetrics(); appDm.setTo(dm); // set it for java, this also affects newly created Resources // set it for java, this also affects newly created Resources if (config.locale != null) { if (config.locale != null) { Loading @@ -3627,11 +3576,7 @@ public final class ActivityThread { WeakReference<Resources> v = it.next(); WeakReference<Resources> v = it.next(); Resources r = v.get(); Resources r = v.get(); if (r != null) { if (r != null) { // keep the original density based on application cale. r.updateConfiguration(config, dm); appDm.updateDensity(r.getDisplayMetrics().density); r.updateConfiguration(config, appDm); // reset appDm.setTo(dm); //Log.i(TAG, "Updated app resources " + v.getKey() //Log.i(TAG, "Updated app resources " + v.getKey() // + " " + r + ": " + r.getConfiguration()); // + " " + r + ": " + r.getConfiguration()); } else { } else { Loading
core/java/android/app/ApplicationContext.java +11 −15 Original line number Original line Diff line number Diff line Loading @@ -554,19 +554,6 @@ class ApplicationContext extends Context { } } } } /** * @hide */ @Override public float getApplicationScale() { if (mPackageInfo != null) { return mPackageInfo.getApplicationScale(); } else { // same as system density return 1.0f; } } @Override @Override public void setWallpaper(Bitmap bitmap) throws IOException { public void setWallpaper(Bitmap bitmap) throws IOException { try { try { Loading Loading @@ -2044,8 +2031,7 @@ class ApplicationContext extends Context { ActivityThread.PackageInfo pi = mContext.mMainThread.getPackageInfoNoCheck(app); ActivityThread.PackageInfo pi = mContext.mMainThread.getPackageInfoNoCheck(app); Resources r = mContext.mMainThread.getTopLevelResources( Resources r = mContext.mMainThread.getTopLevelResources( app.uid == Process.myUid() ? app.sourceDir app.uid == Process.myUid() ? app.sourceDir : app.publicSourceDir, : app.publicSourceDir, pi); pi.getApplicationScale()); if (r != null) { if (r != null) { return r; return r; } } Loading Loading @@ -2440,6 +2426,16 @@ class ApplicationContext extends Context { } } } } @Override public void replacePreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity) { try { mPM.replacePreferredActivity(filter, match, set, activity); } catch (RemoteException e) { // Should never happen! } } @Override @Override public void clearPackagePreferredActivities(String packageName) { public void clearPackagePreferredActivities(String packageName) { try { try { Loading