Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions AndroidPerfServer.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/framework" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
17 changes: 11 additions & 6 deletions framework/AndroidPerfServerFW.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.androidperf.server;

import android.app.ActivityThread;
import android.app.usage.NetworkStats;
import android.app.usage.NetworkStatsManager;
import android.content.Context;
import android.os.Looper;
import android.os.Build;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.LocalServerSocket;
import android.net.LocalSocket;
import android.net.LocalSocketAddress;
import android.app.usage.NetworkStats;
import android.app.usage.NetworkStatsManager;
import android.os.Build;
import android.os.Looper;
import android.util.Log;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -56,6 +56,11 @@ private void handleData(OutputStream outputStream, String data) {
}
} else if (data.contains("PING")) {
writeMSG(outputStream, "OKAY".getBytes());
} else if (data.contains("convert")) {
//todo 返回的内容
String packageName = data.substring(data.indexOf("convert ")+"convert ".length());
String AppName = getAppName(packageName);
writeMSG(outputStream, packageName.getBytes());
}
}

Expand Down
6 changes: 6 additions & 0 deletions native/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <chrono>
#include <thread>

#undef NDEBUG

using namespace android;

using ::android::base::unique_fd;
Expand Down Expand Up @@ -280,6 +282,10 @@ void AndroidPerf::handleData(int fd, String8 data)
{
writeMSG(fd, "OKAY", 4);
}
else if(data.contains("convert"))
{
requestFramework(data.string(), data.size(), fd);
}
}

void AndroidPerf::writeMSG(int fd, const void *data, size_t size)
Expand Down