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
|
||||
protected Throwable doInBackground(String... commands) {
|
||||
try {
|
||||
LSPManagerServiceHolder.getService().clearApplicationProfileData(commands[0]);
|
||||
if (LSPManagerServiceHolder.getService().performDexOptMode(commands[0])) {
|
||||
return null;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -821,6 +821,11 @@ public class LSPManagerService extends ILSPManagerService.Stub {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearApplicationProfileData(String packageName) throws RemoteException {
|
||||
PackageService.clearApplicationProfileData(packageName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performDexOptMode(String packageName) throws RemoteException {
|
||||
return PackageService.performDexOptMode(packageName);
|
||||
|
|
|
|||
|
|
@ -313,11 +313,17 @@ public class PackageService {
|
|||
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 {
|
||||
IPackageManager pm = getPackageManager();
|
||||
if (pm == null) return false;
|
||||
return pm.performDexOptMode(packageName,
|
||||
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)
|
||||
throws RemoteException;
|
||||
|
||||
void clearApplicationProfileData(String packageName) throws RemoteException;
|
||||
|
||||
abstract class Stub extends Binder implements IPackageManager {
|
||||
|
||||
public static IPackageManager asInterface(IBinder obj) {
|
||||
|
|
|
|||
|
|
@ -87,4 +87,6 @@ interface ILSPManagerService {
|
|||
void setDexObfuscate(boolean enable) = 43;
|
||||
|
||||
int getDex2OatWrapperCompatibility() = 44;
|
||||
|
||||
void clearApplicationProfileData(in String packageName) = 45;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue