Clear application profile data before perform dexOpt (#2141)
This commit is contained in:
parent
5262c52c0f
commit
86fd75ab7a
|
|
@ -83,6 +83,7 @@ public class CompileDialogFragment extends AppCompatDialogFragment {
|
||||||
@Override
|
@Override
|
||||||
protected Throwable doInBackground(String... commands) {
|
protected Throwable doInBackground(String... commands) {
|
||||||
try {
|
try {
|
||||||
|
LSPManagerServiceHolder.getService().clearApplicationProfileData(commands[0]);
|
||||||
if (LSPManagerServiceHolder.getService().performDexOptMode(commands[0])) {
|
if (LSPManagerServiceHolder.getService().performDexOptMode(commands[0])) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -821,6 +821,11 @@ public class LSPManagerService extends ILSPManagerService.Stub {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearApplicationProfileData(String packageName) throws RemoteException {
|
||||||
|
PackageService.clearApplicationProfileData(packageName);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean performDexOptMode(String packageName) throws RemoteException {
|
public boolean performDexOptMode(String packageName) throws RemoteException {
|
||||||
return PackageService.performDexOptMode(packageName);
|
return PackageService.performDexOptMode(packageName);
|
||||||
|
|
|
||||||
|
|
@ -313,11 +313,17 @@ public class PackageService {
|
||||||
return intent;
|
return intent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void clearApplicationProfileData(String packageName) throws RemoteException {
|
||||||
|
IPackageManager pm = getPackageManager();
|
||||||
|
if (pm == null) return;
|
||||||
|
pm.clearApplicationProfileData(packageName);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean performDexOptMode(String packageName) throws RemoteException {
|
public static boolean performDexOptMode(String packageName) throws RemoteException {
|
||||||
IPackageManager pm = getPackageManager();
|
IPackageManager pm = getPackageManager();
|
||||||
if (pm == null) return false;
|
if (pm == null) return false;
|
||||||
return pm.performDexOptMode(packageName,
|
return pm.performDexOptMode(packageName,
|
||||||
SystemProperties.getBoolean("dalvik.vm.usejitprofiles", false),
|
SystemProperties.getBoolean("dalvik.vm.usejitprofiles", false),
|
||||||
"speed", true, true, null);
|
SystemProperties.get("pm.dexopt.install", "speed-profile"), true, true, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,8 @@ public interface IPackageManager extends IInterface {
|
||||||
String targetCompilerFilter, boolean force, boolean bootComplete, String splitName)
|
String targetCompilerFilter, boolean force, boolean bootComplete, String splitName)
|
||||||
throws RemoteException;
|
throws RemoteException;
|
||||||
|
|
||||||
|
void clearApplicationProfileData(String packageName) throws RemoteException;
|
||||||
|
|
||||||
abstract class Stub extends Binder implements IPackageManager {
|
abstract class Stub extends Binder implements IPackageManager {
|
||||||
|
|
||||||
public static IPackageManager asInterface(IBinder obj) {
|
public static IPackageManager asInterface(IBinder obj) {
|
||||||
|
|
|
||||||
|
|
@ -87,4 +87,6 @@ interface ILSPManagerService {
|
||||||
void setDexObfuscate(boolean enable) = 43;
|
void setDexObfuscate(boolean enable) = 43;
|
||||||
|
|
||||||
int getDex2OatWrapperCompatibility() = 44;
|
int getDex2OatWrapperCompatibility() = 44;
|
||||||
|
|
||||||
|
void clearApplicationProfileData(in String packageName) = 45;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue