Loading core/java/android/app/ActivityThread.java +2 −2 Original line number Diff line number Diff line Loading @@ -1540,8 +1540,8 @@ public final class ActivityThread { */ Resources getTopLevelResources(String resDir, String[] overlayDirs, int displayId, Configuration overrideConfiguration, LoadedApk pkgInfo, Context context) { return mResourcesManager.getTopLevelResources(resDir, overlayDirs, displayId, pkgInfo.mPackageName, LoadedApk pkgInfo, Context context, String pkgName) { return mResourcesManager.getTopLevelResources(resDir, overlayDirs, displayId, pkgName, overrideConfiguration, pkgInfo.getCompatibilityInfo(), null, context); } Loading core/java/android/app/ApplicationPackageManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -774,7 +774,8 @@ final class ApplicationPackageManager extends PackageManager { Resources r = mContext.mMainThread.getTopLevelResources( app.uid == Process.myUid() ? app.sourceDir : app.publicSourceDir, app.resourceDirs, Display.DEFAULT_DISPLAY, null, mContext.mPackageInfo, mContext); app.resourceDirs, Display.DEFAULT_DISPLAY, null, mContext.mPackageInfo, mContext, app.packageName); if (r != null) { return r; } Loading core/java/android/app/DownloadManager.java 100644 → 100755 +40 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,13 @@ public class DownloadManager { */ public final static int PAUSED_UNKNOWN = 4; /** * Value of {@link #COLUMN_REASON} when the download is paused by manual. * * @hide */ public final static int PAUSED_BY_MANUAL = 5; /** * Broadcast intent action sent by the download manager when a download completes. */ Loading Loading @@ -865,6 +872,7 @@ public class DownloadManager { parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_TO_RETRY)); parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_FOR_NETWORK)); parts.add(statusClause("=", Downloads.Impl.STATUS_QUEUED_FOR_WIFI)); parts.add(statusClause("=", Downloads.Impl.STATUS_PAUSED_BY_MANUAL)); } if ((mStatusFlags & STATUS_SUCCESSFUL) != 0) { parts.add(statusClause("=", Downloads.Impl.STATUS_SUCCESS)); Loading Loading @@ -1124,6 +1132,34 @@ public class DownloadManager { mResolver.update(mBaseUri, values, getWhereClauseForIds(ids), getWhereArgsForIds(ids)); } /** * Pause the given running download by manual. * * @param id the ID of the download to be paused * @return the number of downloads actually updated * @hide */ public int pauseDownload(long id) { ContentValues values = new ContentValues(); values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_PAUSED_BY_MANUAL); return mResolver.update(ContentUris.withAppendedId(mBaseUri, id), values, null, null); } /** * Resume the given paused download by manual. * * @param id the ID of the download to be resumed * @return the number of downloads actually updated * @hide */ public int resumeDownload(long id) { ContentValues values = new ContentValues(); values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_RUNNING); return mResolver.update(ContentUris.withAppendedId(mBaseUri, id), values, null, null); } /** * Returns maximum size, in bytes, of downloads that may go over a mobile connection; or null if * there's no limit Loading Loading @@ -1360,6 +1396,9 @@ public class DownloadManager { case Downloads.Impl.STATUS_QUEUED_FOR_WIFI: return PAUSED_QUEUED_FOR_WIFI; case Downloads.Impl.STATUS_PAUSED_BY_MANUAL: return PAUSED_BY_MANUAL; default: return PAUSED_UNKNOWN; } Loading Loading @@ -1415,6 +1454,7 @@ public class DownloadManager { case Downloads.Impl.STATUS_WAITING_TO_RETRY: case Downloads.Impl.STATUS_WAITING_FOR_NETWORK: case Downloads.Impl.STATUS_QUEUED_FOR_WIFI: case Downloads.Impl.STATUS_PAUSED_BY_MANUAL: return STATUS_PAUSED; case Downloads.Impl.STATUS_SUCCESS: Loading core/java/android/app/LoadedApk.java +1 −1 Original line number Diff line number Diff line Loading @@ -493,7 +493,7 @@ public final class LoadedApk { public Resources getResources(ActivityThread mainThread) { if (mResources == null) { mResources = mainThread.getTopLevelResources(mResDir, mOverlayDirs, Display.DEFAULT_DISPLAY, null, this, mainThread.getSystemContext()); Display.DEFAULT_DISPLAY, null, this, mainThread.getSystemContext(), mPackageName); } return mResources; } Loading core/java/android/app/ResourcesManager.java +2 −9 Original line number Diff line number Diff line Loading @@ -193,6 +193,7 @@ public class ResourcesManager { //} AssetManager assets = new AssetManager(); assets.setAppName(packageName); assets.setThemeSupport(compatInfo.isThemeable); if (assets.addAssetPath(resDir) == 0) { return null; Loading Loading @@ -268,18 +269,10 @@ public class ResourcesManager { */ private void setActivityIcons(Resources r) { SparseArray<PackageItemInfo> iconResources = new SparseArray<PackageItemInfo>(); String pkgName = null; String pkgName = r.getAssets().getAppName(); PackageInfo pkgInfo = null; ApplicationInfo appInfo = null; int count = r.getAssets().getBasePackageCount(); if (count > 1) { pkgName = r.getAssets().getBasePackageName(1); } else if (count <= 1) { return; } try { pkgInfo = getPackageManager().getPackageInfo(pkgName, PackageManager.GET_ACTIVITIES, UserHandle.myUserId()); } catch (RemoteException e1) { Loading Loading
core/java/android/app/ActivityThread.java +2 −2 Original line number Diff line number Diff line Loading @@ -1540,8 +1540,8 @@ public final class ActivityThread { */ Resources getTopLevelResources(String resDir, String[] overlayDirs, int displayId, Configuration overrideConfiguration, LoadedApk pkgInfo, Context context) { return mResourcesManager.getTopLevelResources(resDir, overlayDirs, displayId, pkgInfo.mPackageName, LoadedApk pkgInfo, Context context, String pkgName) { return mResourcesManager.getTopLevelResources(resDir, overlayDirs, displayId, pkgName, overrideConfiguration, pkgInfo.getCompatibilityInfo(), null, context); } Loading
core/java/android/app/ApplicationPackageManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -774,7 +774,8 @@ final class ApplicationPackageManager extends PackageManager { Resources r = mContext.mMainThread.getTopLevelResources( app.uid == Process.myUid() ? app.sourceDir : app.publicSourceDir, app.resourceDirs, Display.DEFAULT_DISPLAY, null, mContext.mPackageInfo, mContext); app.resourceDirs, Display.DEFAULT_DISPLAY, null, mContext.mPackageInfo, mContext, app.packageName); if (r != null) { return r; } Loading
core/java/android/app/DownloadManager.java 100644 → 100755 +40 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,13 @@ public class DownloadManager { */ public final static int PAUSED_UNKNOWN = 4; /** * Value of {@link #COLUMN_REASON} when the download is paused by manual. * * @hide */ public final static int PAUSED_BY_MANUAL = 5; /** * Broadcast intent action sent by the download manager when a download completes. */ Loading Loading @@ -865,6 +872,7 @@ public class DownloadManager { parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_TO_RETRY)); parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_FOR_NETWORK)); parts.add(statusClause("=", Downloads.Impl.STATUS_QUEUED_FOR_WIFI)); parts.add(statusClause("=", Downloads.Impl.STATUS_PAUSED_BY_MANUAL)); } if ((mStatusFlags & STATUS_SUCCESSFUL) != 0) { parts.add(statusClause("=", Downloads.Impl.STATUS_SUCCESS)); Loading Loading @@ -1124,6 +1132,34 @@ public class DownloadManager { mResolver.update(mBaseUri, values, getWhereClauseForIds(ids), getWhereArgsForIds(ids)); } /** * Pause the given running download by manual. * * @param id the ID of the download to be paused * @return the number of downloads actually updated * @hide */ public int pauseDownload(long id) { ContentValues values = new ContentValues(); values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_PAUSED_BY_MANUAL); return mResolver.update(ContentUris.withAppendedId(mBaseUri, id), values, null, null); } /** * Resume the given paused download by manual. * * @param id the ID of the download to be resumed * @return the number of downloads actually updated * @hide */ public int resumeDownload(long id) { ContentValues values = new ContentValues(); values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_RUNNING); return mResolver.update(ContentUris.withAppendedId(mBaseUri, id), values, null, null); } /** * Returns maximum size, in bytes, of downloads that may go over a mobile connection; or null if * there's no limit Loading Loading @@ -1360,6 +1396,9 @@ public class DownloadManager { case Downloads.Impl.STATUS_QUEUED_FOR_WIFI: return PAUSED_QUEUED_FOR_WIFI; case Downloads.Impl.STATUS_PAUSED_BY_MANUAL: return PAUSED_BY_MANUAL; default: return PAUSED_UNKNOWN; } Loading Loading @@ -1415,6 +1454,7 @@ public class DownloadManager { case Downloads.Impl.STATUS_WAITING_TO_RETRY: case Downloads.Impl.STATUS_WAITING_FOR_NETWORK: case Downloads.Impl.STATUS_QUEUED_FOR_WIFI: case Downloads.Impl.STATUS_PAUSED_BY_MANUAL: return STATUS_PAUSED; case Downloads.Impl.STATUS_SUCCESS: Loading
core/java/android/app/LoadedApk.java +1 −1 Original line number Diff line number Diff line Loading @@ -493,7 +493,7 @@ public final class LoadedApk { public Resources getResources(ActivityThread mainThread) { if (mResources == null) { mResources = mainThread.getTopLevelResources(mResDir, mOverlayDirs, Display.DEFAULT_DISPLAY, null, this, mainThread.getSystemContext()); Display.DEFAULT_DISPLAY, null, this, mainThread.getSystemContext(), mPackageName); } return mResources; } Loading
core/java/android/app/ResourcesManager.java +2 −9 Original line number Diff line number Diff line Loading @@ -193,6 +193,7 @@ public class ResourcesManager { //} AssetManager assets = new AssetManager(); assets.setAppName(packageName); assets.setThemeSupport(compatInfo.isThemeable); if (assets.addAssetPath(resDir) == 0) { return null; Loading Loading @@ -268,18 +269,10 @@ public class ResourcesManager { */ private void setActivityIcons(Resources r) { SparseArray<PackageItemInfo> iconResources = new SparseArray<PackageItemInfo>(); String pkgName = null; String pkgName = r.getAssets().getAppName(); PackageInfo pkgInfo = null; ApplicationInfo appInfo = null; int count = r.getAssets().getBasePackageCount(); if (count > 1) { pkgName = r.getAssets().getBasePackageName(1); } else if (count <= 1) { return; } try { pkgInfo = getPackageManager().getPackageInfo(pkgName, PackageManager.GET_ACTIVITIES, UserHandle.myUserId()); } catch (RemoteException e1) { Loading