Merge "Disable unused features" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d4d1512b64
@@ -79,7 +79,6 @@ import libcore.io.IoUtils;
|
|||||||
|
|
||||||
import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE;
|
import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE;
|
||||||
import static android.content.pm.ActivityInfo.FLAG_IMMERSIVE;
|
import static android.content.pm.ActivityInfo.FLAG_IMMERSIVE;
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
|
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE;
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE;
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
|
||||||
@@ -120,6 +119,7 @@ public class PackageParser {
|
|||||||
private static final boolean DEBUG_PARSER = false;
|
private static final boolean DEBUG_PARSER = false;
|
||||||
private static final boolean DEBUG_BACKUP = false;
|
private static final boolean DEBUG_BACKUP = false;
|
||||||
|
|
||||||
|
private static final boolean MULTI_PACKAGE_APK_ENABLED = false;
|
||||||
private static final int MAX_PACKAGES_PER_APK = 5;
|
private static final int MAX_PACKAGES_PER_APK = 5;
|
||||||
|
|
||||||
public static final int APK_SIGNING_UNKNOWN = 0;
|
public static final int APK_SIGNING_UNKNOWN = 0;
|
||||||
@@ -2087,6 +2087,10 @@ public class PackageParser {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
} else if (tagName.equals(TAG_PACKAGE)) {
|
} else if (tagName.equals(TAG_PACKAGE)) {
|
||||||
|
if (!MULTI_PACKAGE_APK_ENABLED) {
|
||||||
|
XmlUtils.skipCurrentTag(parser);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!parseBaseApkChild(pkg, res, parser, flags, outError)) {
|
if (!parseBaseApkChild(pkg, res, parser, flags, outError)) {
|
||||||
// If parsing a child failed the error is already set
|
// If parsing a child failed the error is already set
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import com.android.internal.annotations.GuardedBy;
|
|||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
import com.android.internal.util.XmlUtils;
|
import com.android.internal.util.XmlUtils;
|
||||||
import libcore.io.IoUtils;
|
import libcore.io.IoUtils;
|
||||||
|
import libcore.util.EmptyArray;
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
import org.xmlpull.v1.XmlSerializer;
|
import org.xmlpull.v1.XmlSerializer;
|
||||||
@@ -61,6 +62,8 @@ import java.util.Set;
|
|||||||
class EphemeralApplicationRegistry {
|
class EphemeralApplicationRegistry {
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
|
|
||||||
|
private static final boolean ENABLED = false;
|
||||||
|
|
||||||
private static final String LOG_TAG = "EphemeralAppRegistry";
|
private static final String LOG_TAG = "EphemeralAppRegistry";
|
||||||
|
|
||||||
private static final long DEFAULT_UNINSTALLED_EPHEMERAL_APP_CACHE_DURATION_MILLIS =
|
private static final long DEFAULT_UNINSTALLED_EPHEMERAL_APP_CACHE_DURATION_MILLIS =
|
||||||
@@ -92,6 +95,9 @@ class EphemeralApplicationRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getEphemeralApplicationCookieLPw(String packageName, int userId) {
|
public byte[] getEphemeralApplicationCookieLPw(String packageName, int userId) {
|
||||||
|
if (!ENABLED) {
|
||||||
|
return EmptyArray.BYTE;
|
||||||
|
}
|
||||||
pruneUninstalledEphemeralAppsLPw(userId);
|
pruneUninstalledEphemeralAppsLPw(userId);
|
||||||
|
|
||||||
File cookieFile = peekEphemeralCookieFile(packageName, userId);
|
File cookieFile = peekEphemeralCookieFile(packageName, userId);
|
||||||
@@ -107,6 +113,9 @@ class EphemeralApplicationRegistry {
|
|||||||
|
|
||||||
public boolean setEphemeralApplicationCookieLPw(String packageName,
|
public boolean setEphemeralApplicationCookieLPw(String packageName,
|
||||||
byte[] cookie, int userId) {
|
byte[] cookie, int userId) {
|
||||||
|
if (!ENABLED) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
pruneUninstalledEphemeralAppsLPw(userId);
|
pruneUninstalledEphemeralAppsLPw(userId);
|
||||||
|
|
||||||
PackageParser.Package pkg = mService.mPackages.get(packageName);
|
PackageParser.Package pkg = mService.mPackages.get(packageName);
|
||||||
@@ -138,6 +147,9 @@ class EphemeralApplicationRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap getEphemeralApplicationIconLPw(String packageName, int userId) {
|
public Bitmap getEphemeralApplicationIconLPw(String packageName, int userId) {
|
||||||
|
if (!ENABLED) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
pruneUninstalledEphemeralAppsLPw(userId);
|
pruneUninstalledEphemeralAppsLPw(userId);
|
||||||
|
|
||||||
File iconFile = new File(getEphemeralApplicationDir(packageName, userId),
|
File iconFile = new File(getEphemeralApplicationDir(packageName, userId),
|
||||||
@@ -149,6 +161,9 @@ class EphemeralApplicationRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<EphemeralApplicationInfo> getEphemeralApplicationsLPw(int userId) {
|
public List<EphemeralApplicationInfo> getEphemeralApplicationsLPw(int userId) {
|
||||||
|
if (!ENABLED) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
pruneUninstalledEphemeralAppsLPw(userId);
|
pruneUninstalledEphemeralAppsLPw(userId);
|
||||||
|
|
||||||
List<EphemeralApplicationInfo> result = getInstalledEphemeralApplicationsLPr(userId);
|
List<EphemeralApplicationInfo> result = getInstalledEphemeralApplicationsLPr(userId);
|
||||||
@@ -157,6 +172,9 @@ class EphemeralApplicationRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onPackageInstalledLPw(PackageParser.Package pkg) {
|
public void onPackageInstalledLPw(PackageParser.Package pkg) {
|
||||||
|
if (!ENABLED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
PackageSetting ps = (PackageSetting) pkg.mExtras;
|
PackageSetting ps = (PackageSetting) pkg.mExtras;
|
||||||
if (ps == null) {
|
if (ps == null) {
|
||||||
return;
|
return;
|
||||||
@@ -210,6 +228,9 @@ class EphemeralApplicationRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onPackageUninstalledLPw(PackageParser.Package pkg) {
|
public void onPackageUninstalledLPw(PackageParser.Package pkg) {
|
||||||
|
if (!ENABLED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (pkg == null) {
|
if (pkg == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -235,6 +256,9 @@ class EphemeralApplicationRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onUserRemovedLPw(int userId) {
|
public void onUserRemovedLPw(int userId) {
|
||||||
|
if (!ENABLED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mUninstalledEphemeralApps != null) {
|
if (mUninstalledEphemeralApps != null) {
|
||||||
mUninstalledEphemeralApps.remove(userId);
|
mUninstalledEphemeralApps.remove(userId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user