use of com.android.preload.DumpData in project android_frameworks_base by ResurrectionRemix.
the class ScanPackageAction method work.
private void work(Client c) {
String pkg = c.getClientData().getClientDescription();
Main.getUI().showWaitDialog();
Main.getUI().updateWaitDialog("Retrieving heap data for " + pkg);
try {
Map<String, String> data = Main.findAndGetClassData(device, pkg);
DumpData dumpData = new DumpData(pkg, data, new Date());
dataTableModel.addData(dumpData);
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.android.preload.DumpData in project android_frameworks_base by ResurrectionRemix.
the class ShowDataAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
// TODO(agampe): Auto-generated method stub
int selRow = Main.getUI().getSelectedDataTableRow();
if (selRow != -1) {
DumpData data = dataTableModel.getData().get(selRow);
Map<String, Set<String>> inv = data.invertData();
StringBuilder builder = new StringBuilder();
// First bootclasspath.
add(builder, "Boot classpath:", inv.get(null));
// Now everything else.
for (String k : inv.keySet()) {
if (k != null) {
builder.append("==================\n\n");
add(builder, k, inv.get(k));
}
}
JFrame newFrame = new JFrame(data.getPackageName() + " " + data.getDate());
newFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
newFrame.getContentPane().add(new JScrollPane(new JTextArea(builder.toString())), BorderLayout.CENTER);
newFrame.setSize(800, 600);
newFrame.setLocationRelativeTo(null);
newFrame.setVisible(true);
}
}
use of com.android.preload.DumpData in project android_frameworks_base by ResurrectionRemix.
the class ScanAllPackagesAction method run.
@Override
public void run() {
Main.getUI().showWaitDialog();
try {
Client[] clients = clientUtils.findAllClients(device);
for (Client c : clients) {
String pkg = c.getClientData().getClientDescription();
Main.getUI().showWaitDialog();
Main.getUI().updateWaitDialog("Retrieving heap data for " + pkg);
try {
Map<String, String> data = Main.getClassDataRetriever().getClassData(c);
DumpData dumpData = new DumpData(pkg, data, new Date());
dataTableModel.addData(dumpData);
} catch (Exception e) {
e.printStackTrace();
}
}
} finally {
Main.getUI().hideWaitDialog();
}
}
use of com.android.preload.DumpData in project android_frameworks_base by DirtyUnicorns.
the class ComputeThresholdAction method run.
@Override
public void run() {
Main.getUI().showWaitDialog();
Map<String, Set<String>> uses = new HashMap<String, Set<String>>();
for (DumpData d : dataTableModel.getData()) {
Main.getUI().updateWaitDialog("Merging " + d.getPackageName());
updateClassUse(d.getPackageName(), uses, getBootClassPathClasses(d.getDumpData()));
}
Main.getUI().updateWaitDialog("Computing thresholded set");
Set<String> result = fromThreshold(uses, blacklist, threshold);
Main.getUI().hideWaitDialog();
boolean ret = Main.getUI().showConfirmDialog("Computed a set with " + result.size() + " classes, would you like to save to disk?", "Save?");
if (ret) {
JFileChooser jfc = new JFileChooser();
int ret2 = jfc.showSaveDialog(Main.getUI());
if (ret2 == JFileChooser.APPROVE_OPTION) {
File f = jfc.getSelectedFile();
saveSet(result, f);
}
}
}
use of com.android.preload.DumpData in project android_frameworks_base by DirtyUnicorns.
the class ScanAllPackagesAction method run.
@Override
public void run() {
Main.getUI().showWaitDialog();
try {
Client[] clients = clientUtils.findAllClients(device);
for (Client c : clients) {
String pkg = c.getClientData().getClientDescription();
Main.getUI().showWaitDialog();
Main.getUI().updateWaitDialog("Retrieving heap data for " + pkg);
try {
Map<String, String> data = Main.getClassDataRetriever().getClassData(c);
DumpData dumpData = new DumpData(pkg, data, new Date());
dataTableModel.addData(dumpData);
} catch (Exception e) {
e.printStackTrace();
}
}
} finally {
Main.getUI().hideWaitDialog();
}
}
Aggregations