Merge "Revert "Migrate the usage of sCompatibilityModeEnabled"" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e39067a6e1
@@ -3066,13 +3066,6 @@ public class ParsingPackageUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public static void setCompatibilityModeEnabled(boolean compatibilityModeEnabled) {
|
|
||||||
sCompatibilityModeEnabled = compatibilityModeEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ import static com.android.server.pm.PackageManagerServiceUtils.getLastModifiedTi
|
|||||||
import static com.android.server.pm.PackageManagerServiceUtils.logCriticalInfo;
|
import static com.android.server.pm.PackageManagerServiceUtils.logCriticalInfo;
|
||||||
import static com.android.server.pm.PackageManagerServiceUtils.makeDirRecursive;
|
import static com.android.server.pm.PackageManagerServiceUtils.makeDirRecursive;
|
||||||
import static com.android.server.pm.PackageManagerServiceUtils.verifySignatures;
|
import static com.android.server.pm.PackageManagerServiceUtils.verifySignatures;
|
||||||
import static com.android.server.pm.parsing.PackageInfoUtils.checkUseInstalledOrHidden;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.annotation.AppIdInt;
|
import android.annotation.AppIdInt;
|
||||||
@@ -2516,8 +2515,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
if (DEBUG_PACKAGE_INFO) Log.v(TAG, "getActivityInfo " + component + ": " + a);
|
if (DEBUG_PACKAGE_INFO) Log.v(TAG, "getActivityInfo " + component + ": " + a);
|
||||||
|
|
||||||
AndroidPackage pkg = a == null ? null : mPackages.get(a.getPackageName());
|
AndroidPackage pkg = a == null ? null : mPackages.get(a.getPackageName());
|
||||||
PackageSetting ps = a == null ? null : mSettings.getPackageLPr(a.getPackageName());
|
|
||||||
if (pkg != null && mSettings.isEnabledAndMatchLPr(pkg, a, flags, userId)) {
|
if (pkg != null && mSettings.isEnabledAndMatchLPr(pkg, a, flags, userId)) {
|
||||||
|
PackageSetting ps = mSettings.getPackageLPr(component.getPackageName());
|
||||||
if (ps == null) return null;
|
if (ps == null) return null;
|
||||||
if (shouldFilterApplicationLocked(
|
if (shouldFilterApplicationLocked(
|
||||||
ps, filterCallingUid, component, TYPE_ACTIVITY, userId)) {
|
ps, filterCallingUid, component, TYPE_ACTIVITY, userId)) {
|
||||||
@@ -2527,8 +2526,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
a, flags, ps.readUserState(userId), userId, ps);
|
a, flags, ps.readUserState(userId), userId, ps);
|
||||||
}
|
}
|
||||||
if (resolveComponentName().equals(component)) {
|
if (resolveComponentName().equals(component)) {
|
||||||
return generateDelegateActivityInfo(pkg, ps, new PackageUserState(),
|
return PackageParser.generateActivityInfo(
|
||||||
mResolveActivity, flags, userId);
|
mResolveActivity, flags, new PackageUserState(), userId);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -3174,8 +3173,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
final ResolveInfo ephemeralInstaller = new ResolveInfo(mInstantAppInstallerInfo);
|
final ResolveInfo ephemeralInstaller = new ResolveInfo(mInstantAppInstallerInfo);
|
||||||
ephemeralInstaller.activityInfo = generateDelegateActivityInfo(ps.getPkg(), ps,
|
ephemeralInstaller.activityInfo = PackageParser.generateActivityInfo(
|
||||||
ps.readUserState(userId), instantAppInstallerActivity(), 0 /*flags*/, userId);
|
instantAppInstallerActivity(), 0, ps.readUserState(userId), userId);
|
||||||
ephemeralInstaller.match = IntentFilter.MATCH_CATEGORY_SCHEME_SPECIFIC_PART
|
ephemeralInstaller.match = IntentFilter.MATCH_CATEGORY_SCHEME_SPECIFIC_PART
|
||||||
| IntentFilter.MATCH_ADJUSTMENT_NORMAL;
|
| IntentFilter.MATCH_ADJUSTMENT_NORMAL;
|
||||||
// add a non-generic filter
|
// add a non-generic filter
|
||||||
@@ -3259,7 +3258,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
ai.flags = ps.pkgFlags;
|
ai.flags = ps.pkgFlags;
|
||||||
ai.privateFlags = ps.pkgPrivateFlags;
|
ai.privateFlags = ps.pkgPrivateFlags;
|
||||||
pi.applicationInfo =
|
pi.applicationInfo =
|
||||||
PackageInfoUtils.generateApplicationInfo(p, flags, state, userId, ps);
|
PackageParser.generateApplicationInfo(ai, flags, state, userId);
|
||||||
|
|
||||||
if (DEBUG_PACKAGE_INFO) Log.v(TAG, "ps.pkg is n/a for ["
|
if (DEBUG_PACKAGE_INFO) Log.v(TAG, "ps.pkg is n/a for ["
|
||||||
+ ps.name + "]. Provides a minimum info.");
|
+ ps.name + "]. Provides a minimum info.");
|
||||||
@@ -3375,19 +3374,6 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
return getInstalledPackagesBody(flags, userId, callingUid);
|
return getInstalledPackagesBody(flags, userId, callingUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ActivityInfo generateDelegateActivityInfo(@Nullable AndroidPackage pkg,
|
|
||||||
@Nullable PackageSetting ps, @NonNull PackageUserState state,
|
|
||||||
@Nullable ActivityInfo activity, int flags, int userId) {
|
|
||||||
if (activity == null || pkg == null
|
|
||||||
|| !checkUseInstalledOrHidden(pkg, ps, state, flags)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final ActivityInfo info = new ActivityInfo(activity);
|
|
||||||
info.applicationInfo =
|
|
||||||
PackageInfoUtils.generateApplicationInfo(pkg, flags, state, userId, ps);
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ParceledListSlice<PackageInfo> getInstalledPackagesBody(int flags, int userId,
|
public ParceledListSlice<PackageInfo> getInstalledPackagesBody(int flags, int userId,
|
||||||
int callingUid) {
|
int callingUid) {
|
||||||
// writer
|
// writer
|
||||||
@@ -23672,7 +23658,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
boolean compatibilityModeEnabled = android.provider.Settings.Global.getInt(
|
boolean compatibilityModeEnabled = android.provider.Settings.Global.getInt(
|
||||||
mContext.getContentResolver(),
|
mContext.getContentResolver(),
|
||||||
android.provider.Settings.Global.COMPATIBILITY_MODE, 1) == 1;
|
android.provider.Settings.Global.COMPATIBILITY_MODE, 1) == 1;
|
||||||
ParsingPackageUtils.setCompatibilityModeEnabled(compatibilityModeEnabled);
|
PackageParser.setCompatibilityModeEnabled(compatibilityModeEnabled);
|
||||||
|
|
||||||
if (DEBUG_SETTINGS) {
|
if (DEBUG_SETTINGS) {
|
||||||
Log.d(TAG, "compatibility mode:" + compatibilityModeEnabled);
|
Log.d(TAG, "compatibility mode:" + compatibilityModeEnabled);
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ public class PackageInfoUtils {
|
|||||||
* Returns true if the package is installed and not hidden, or if the caller
|
* Returns true if the package is installed and not hidden, or if the caller
|
||||||
* explicitly wanted all uninstalled and hidden packages as well.
|
* explicitly wanted all uninstalled and hidden packages as well.
|
||||||
*/
|
*/
|
||||||
public static boolean checkUseInstalledOrHidden(AndroidPackage pkg,
|
private static boolean checkUseInstalledOrHidden(AndroidPackage pkg,
|
||||||
PackageSetting pkgSetting, PackageUserState state,
|
PackageSetting pkgSetting, PackageUserState state,
|
||||||
@PackageManager.PackageInfoFlags int flags) {
|
@PackageManager.PackageInfoFlags int flags) {
|
||||||
// Returns false if the package is hidden system app until installed.
|
// Returns false if the package is hidden system app until installed.
|
||||||
|
|||||||
Reference in New Issue
Block a user