diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 39b40cf35fa382cf08b2dc9ffd842758a4e3a4a5..af804450481b53f928e7cd5031fa9bfbf0b67b00 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="32" + android:versionName="2.4.1" > diff --git a/README.md b/README.md index a88a782d78d5c9a5976664f9501c03e6c651031f..6b1c20082a049f8a2cab7513b33c14dffb91d622 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,82 @@ -##Emmagee - a practical, handy performance test tool for specified Android App - -Emmagee is a practical, handy performance test tool for specified Android App, which can monitor CPU, memory, -network traffic, battery current and status([Some devices are not supported](https://github.com/NetEase/Emmagee/wiki/Some-devices-are-not-supported)), new features such as top activity and heap size if rooted([Root Toast may continously show](https://github.com/NetEase/Emmagee/wiki/FAQ)), are also supported in the [latest version](https://github.com/NetEase/Emmagee/releases). Additionally, it also provides several cool features such as customizing interval of collecting data, -rendering real-time process status in a floating window, and much more. - - * Homepage: https://github.com/NetEase/Emmagee - * Wiki: https://github.com/NetEase/Emmagee/wiki - * Issues: https://github.com/NetEase/Emmagee/issues - * FAQ: https://github.com/NetEase/Emmagee/wiki/FAQ - * Tags: Android, Java - - -  - -  - - -## Why should I use Emmagee? - -Unlike most other performance test tools that only do system-level monitoring, Emmagee provides the ability to monitor any single App. Other advantages that -you should not miss: -* Open source -* Easy to use -* Process-specific monitoring, including CPU, memory, network traffic, battery current, launching time and status -* Floating window that renders real-time process status -* CSV format report that can be converted into any other format you want -* User-defined collecting interval -* Fully support Android 2.2 and above - -## How to use Emmagee? - -First of all ,you should have Emmagee.apk,download [here](https://github.com/NetEase/Emmagee/releases) or -build the apk file youself [here](https://github.com/NetEase/Emmagee/wiki/How-to-build-emmage.apk%3F),then : - -1. Start Emmagee App -2. Configure interval -3. Select a target process -4. Click Start button - -And Enjoy! - -If you want to stop the test, just go back to Emmagee and click Stop button. - -## Coming Soon -* We want you to decide! - -## How to Contribute? - -You are welcome to contribute to Emmagee, meanwhile you'd better follow the rules below - -* It's *NOT* recommended to submit a pull request directly to Emmagee's `master` branch. `develop` branch is more appropriate -* Follow common Java coding conventions -* Put all Java class files under *com.netease* package -* Add the following [license](#license) in each Java class file - -## Contributors -* NetEase, Inc. -* [yrom](https://github.com/yrom) -* [LukeOwncloud](https://github.com/LukeOwncloud) - -## License -(The Apache License) - -Copyright (c) 2012-2015 NetEase, Inc. and other contributors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +## Emmagee - a practical, handy performance test tool for specified Android App + +Emmagee is a practical, handy performance test tool for specified Android App, which can monitor CPU, memory, +network traffic, battery current and status([Some devices are not supported](https://github.com/NetEase/Emmagee/wiki/Some-devices-are-not-supported)), new features such as top activity and heap size if rooted([Root Toast may continously show](https://github.com/NetEase/Emmagee/wiki/FAQ)), are also supported in the [latest version](https://github.com/NetEase/Emmagee/releases). Additionally, it also provides several cool features such as customizing interval of collecting data, +rendering real-time process status in a floating window, and much more. + + * Homepage: https://github.com/NetEase/Emmagee + * Wiki: https://github.com/NetEase/Emmagee/wiki + * Issues: https://github.com/NetEase/Emmagee/issues + * FAQ: https://github.com/NetEase/Emmagee/wiki/FAQ + * Tags: Android, Java + + +  + +  + + +## Why should I use Emmagee? + +Unlike most other performance test tools that only do system-level monitoring, Emmagee provides the ability to monitor any single App. Other advantages that +you should not miss: +* Open source +* Easy to use +* Process-specific monitoring, including CPU, memory, network traffic, battery current, launching time and status +* Floating window that renders real-time process status +* CSV format report that can be converted into any other format you want +* User-defined collecting interval +* Fully support Android 2.2 and above + +## How to use Emmagee? + +First of all ,you should have Emmagee.apk,download [here](https://github.com/NetEase/Emmagee/releases) or +build the apk file youself [here](https://github.com/NetEase/Emmagee/wiki/How-to-build-emmage.apk%3F),then : + +1. Start Emmagee App +2. Configure interval +3. Select a target process +4. Click Start button + +And Enjoy! + +If you want to stop the test, just go back to Emmagee and click Stop button. + +## Android 5.0 and above + +* `Android 5.0 and above`: getRunningTasks() and getRunningAppProcesses() are deprecated and only return your application process, so it is unable to get TopActivity from Android 5.0. +* `Android 7.0`: Google has restricted access to /proc, and also can not get pid of target application from TOP command in Android 7.0, I am so sorry to tell that 7.0 can not be supported. + +## Coming Soon +* We want you to decide! + +## How to Contribute? + +You are welcome to contribute to Emmagee, meanwhile you'd better follow the rules below + +* It's *NOT* recommended to submit a pull request directly to Emmagee's `master` branch. `develop` branch is more appropriate +* Follow common Java coding conventions +* Put all Java class files under *com.netease* package +* Add the following [license](#license) in each Java class file + +## Contributors +* NetEase, Inc. +* [yrom](https://github.com/yrom) +* [LukeOwncloud](https://github.com/LukeOwncloud) + +## License +(The Apache License) + +Copyright (c) 2012-2015 NetEase, Inc. and other contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/res/drawable-hdpi/goback.png b/res/drawable-hdpi/goback.png deleted file mode 100644 index 1472206be7e97a579f6820bdf2d5e2fb15c44599..0000000000000000000000000000000000000000 Binary files a/res/drawable-hdpi/goback.png and /dev/null differ diff --git a/res/drawable-hdpi/left_arrow.png b/res/drawable-hdpi/left_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..d102ef92a294d14f9c7065c3194d519c57f3ef86 Binary files /dev/null and b/res/drawable-hdpi/left_arrow.png differ diff --git a/res/drawable-hdpi/refresh.png b/res/drawable-hdpi/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..2eab627ff53c14b1901c77a126ed9e767c2d7ba0 Binary files /dev/null and b/res/drawable-hdpi/refresh.png differ diff --git a/res/drawable-hdpi/settings.png b/res/drawable-hdpi/settings.png index 79f590b7e651a14b8634280b2f14cb77ecd7d40a..68d9f5f402f41221fd331ff568d70f486e8fe48e 100644 Binary files a/res/drawable-hdpi/settings.png and b/res/drawable-hdpi/settings.png differ diff --git a/res/drawable-hdpi/settings_pressed.png b/res/drawable-hdpi/settings_pressed.png index 6c8cfe172f5cae392ebf3c50d10e54837dde1aef..b8e5bffd2ae19dd7bcf0b036f4d24d64047f69ab 100644 Binary files a/res/drawable-hdpi/settings_pressed.png and b/res/drawable-hdpi/settings_pressed.png differ diff --git a/res/drawable/settings_button.xml b/res/drawable/settings_button.xml index a7bf01a676d728630fc4299859406e12d4fc06c1..872cc8671bafe714d35478df278c8db8d4cd8685 100644 --- a/res/drawable/settings_button.xml +++ b/res/drawable/settings_button.xml @@ -1,7 +1,5 @@ - - diff --git a/res/layout/list_item.xml b/res/layout/list_item.xml index 588331302f9bb8cfba9d72b8cbf0afdfef9b2e66..a91263b7c7eade40b2b83dcd70b73287e3c4a230 100644 --- a/res/layout/list_item.xml +++ b/res/layout/list_item.xml @@ -14,8 +14,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" - android:maxHeight="80px" - android:maxWidth="80px" + android:maxHeight="100px" + android:maxWidth="100px" android:layout_gravity="center" android:layout_marginRight="10dp" android:layout_marginLeft="10dp" /> @@ -26,6 +26,8 @@ android:layout_height="wrap_content" android:textSize="18sp" android:textColor="#5B5B5B" + android:singleLine="true" + android:ellipsize="end" android:gravity="center_vertical"/> \ No newline at end of file diff --git a/res/layout/navigation_bar.xml b/res/layout/navigation_bar.xml index e17a4663d29b9a59fc4ecb77b9f89da02a3a2d5a..5762d94fb35160eaaf70e402ddf3b04afc730db1 100644 --- a/res/layout/navigation_bar.xml +++ b/res/layout/navigation_bar.xml @@ -18,7 +18,7 @@ android:id="@+id/go_back" android:layout_width="wrap_content" android:layout_height="match_parent" - android:src="@drawable/btn_back" /> + android:src="@drawable/left_arrow" /> - + 关于 邮件配置 版本 - Emmagee是一个简单易上手的Android性能监测小工具, - 主要用于监控单个App的CPU,内存,流量,电量,电流以及整体性能状态, + Emmagee是一个简单易上手的Android性能监测工具, + 主要用于监控单个App的CPU,内存,流量,电量,电流,帧率以及整体性能状态, 同时支持自定义的监控频率以及性能数据的实时显示. 开发团队:网易(杭州)质量保障部 项目地址:https://github.com/NetEase/Emmagee @@ -84,6 +84,9 @@ 统计Heap数据 (需要root) - 无法获取root权限,请确认手机是否已经root过 + 无法获取root权限,请确认手机是否已root 应用退出后停止监听 + + 列表更新成功 + 由于Google的限制,Emmagee无法支持7.0及以上版本 diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 9887524bfa4cffef414a7e4c3cff802fb791380e..0a3fd0311bb93cf975e5d5255d92135667a362b8 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -20,7 +20,7 @@ 40dp 10dp - 5dp + 10dp 1px diff --git a/res/values/strings.xml b/res/values/strings.xml index 0c7d5ca2587c4c4dd6f03b1acbcda05eda5b6f94..183414ff2cb96fc3627bc7ffa85c518e76171332 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -70,7 +70,7 @@ Mail Settings Version Emmagee is a practical, handy performance test tool for specified - Android App, which can monitor CPU, memory, network traffic, battery current and status. + Android App, which can monitor CPU, memory, network traffic, battery current, fps and status. Additionally, it also provides several cool features such as customizing interval of collecting data, rendering real-time process status in a floating window, and much more. Team:QA, Netease(Hangzhou) @@ -85,4 +85,7 @@ (root is necessary) Fail to get root permission, please check if this phone is rooted Stop monitoring when app exited + + Update List Successfully + Don\'t support 7.0 and above while Google has restricted access to shell commands and file system diff --git a/src/com/netease/qa/emmagee/activity/AboutActivity.java b/src/com/netease/qa/emmagee/activity/AboutActivity.java index 14b34ec94819b136e35bb6fe4f05078c49505422..552ec8f874ba78e047e168c5d5091928cedd809d 100644 --- a/src/com/netease/qa/emmagee/activity/AboutActivity.java +++ b/src/com/netease/qa/emmagee/activity/AboutActivity.java @@ -16,20 +16,20 @@ */ package com.netease.qa.emmagee.activity; +import com.netease.qa.emmagee.R; + import android.app.Activity; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Bundle; import android.util.Log; import android.view.View; -import android.view.Window; import android.view.View.OnClickListener; +import android.view.Window; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; -import com.netease.qa.emmagee.R; - /** * About Page of Emmagee * diff --git a/src/com/netease/qa/emmagee/activity/MailSettingsActivity.java b/src/com/netease/qa/emmagee/activity/MailSettingsActivity.java index 245bd152275d5ea906746982179fcc4f70d9a858..ddd2a8e5e1316eb9518ad3138d4d8817422ae98d 100644 --- a/src/com/netease/qa/emmagee/activity/MailSettingsActivity.java +++ b/src/com/netease/qa/emmagee/activity/MailSettingsActivity.java @@ -19,6 +19,10 @@ package com.netease.qa.emmagee.activity; import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.netease.qa.emmagee.R; +import com.netease.qa.emmagee.utils.EncryptData; +import com.netease.qa.emmagee.utils.Settings; + import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; @@ -27,17 +31,13 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.util.Log; import android.view.View; -import android.view.Window; import android.view.View.OnClickListener; +import android.view.Window; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; -import com.netease.qa.emmagee.R; -import com.netease.qa.emmagee.utils.EncryptData; -import com.netease.qa.emmagee.utils.Settings; - /** * Mail Setting Page of Emmagee * diff --git a/src/com/netease/qa/emmagee/activity/MainPageActivity.java b/src/com/netease/qa/emmagee/activity/MainPageActivity.java index 56cfb42540bc6d2b9e39366b035a296fcc14739f..fdf8a9deebc59b2c5649250ef6fb46920dcacc63 100644 --- a/src/com/netease/qa/emmagee/activity/MainPageActivity.java +++ b/src/com/netease/qa/emmagee/activity/MainPageActivity.java @@ -16,15 +16,20 @@ */ package com.netease.qa.emmagee.activity; -import java.io.DataOutputStream; import java.io.IOException; import java.util.List; +import com.netease.qa.emmagee.R; +import com.netease.qa.emmagee.service.EmmageeService; +import com.netease.qa.emmagee.utils.ProcessInfo; +import com.netease.qa.emmagee.utils.Programe; + import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; @@ -44,11 +49,6 @@ import android.widget.RadioButton; import android.widget.TextView; import android.widget.Toast; -import com.netease.qa.emmagee.R; -import com.netease.qa.emmagee.service.EmmageeService; -import com.netease.qa.emmagee.utils.ProcessInfo; -import com.netease.qa.emmagee.utils.Programe; - /** * Main Page of Emmagee * @@ -60,7 +60,6 @@ public class MainPageActivity extends Activity { private static final int TIMEOUT = 20000; - private List processList; private ProcessInfo processInfo; private Intent monitorService; private ListView lstViProgramme; @@ -74,6 +73,7 @@ public class MainPageActivity extends Activity { private ImageView ivBtnSet; private LinearLayout layBtnSet; private Long mExitTime = (long) 0; + private ListAdapter la; @Override public void onCreate(Bundle savedInstanceState) { @@ -87,50 +87,56 @@ public class MainPageActivity extends Activity { btnTest.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - monitorService = new Intent(); - monitorService.setClass(MainPageActivity.this, EmmageeService.class); - if (getString(R.string.start_test).equals(btnTest.getText().toString())) { - ListAdapter adapter = (ListAdapter) lstViProgramme.getAdapter(); - if (adapter.checkedProg != null) { - String packageName = adapter.checkedProg.getPackageName(); - String processName = adapter.checkedProg.getProcessName(); - Intent intent = getPackageManager().getLaunchIntentForPackage(packageName); - String startActivity = ""; - Log.d(LOG_TAG, packageName); - // clear logcat - try { - Runtime.getRuntime().exec("logcat -c"); - } catch (IOException e) { - Log.d(LOG_TAG, e.getMessage()); + if (Build.VERSION.SDK_INT < 24) { + monitorService = new Intent(); + monitorService.setClass(MainPageActivity.this, EmmageeService.class); + if (getString(R.string.start_test).equals(btnTest.getText().toString())) { + ListAdapter adapter = (ListAdapter) lstViProgramme.getAdapter(); + if (adapter.checkedProg != null) { + String packageName = adapter.checkedProg.getPackageName(); + String processName = adapter.checkedProg.getProcessName(); + Intent intent = getPackageManager().getLaunchIntentForPackage(packageName); + String startActivity = ""; + Log.d(LOG_TAG, packageName); + // clear logcat + try { + Runtime.getRuntime().exec("logcat -c"); + } catch (IOException e) { + Log.d(LOG_TAG, e.getMessage()); + } + try { + startActivity = intent.resolveActivity(getPackageManager()).getShortClassName(); + startActivity(intent); + } catch (Exception e) { + Toast.makeText(MainPageActivity.this, getString(R.string.can_not_start_app_toast), Toast.LENGTH_LONG).show(); + return; + } + waitForAppStart(packageName); + monitorService.putExtra("processName", processName); + monitorService.putExtra("pid", pid); + monitorService.putExtra("uid", uid); + monitorService.putExtra("packageName", packageName); + monitorService.putExtra("startActivity", startActivity); + startService(monitorService); + isServiceStop = false; + btnTest.setText(getString(R.string.stop_test)); + } else { + Toast.makeText(MainPageActivity.this, getString(R.string.choose_app_toast), Toast.LENGTH_LONG).show(); } - try { - startActivity = intent.resolveActivity(getPackageManager()).getShortClassName(); - startActivity(intent); - } catch (Exception e) { - Toast.makeText(MainPageActivity.this, getString(R.string.can_not_start_app_toast), Toast.LENGTH_LONG).show(); - return; - } - waitForAppStart(packageName); - monitorService.putExtra("processName", processName); - monitorService.putExtra("pid", pid); - monitorService.putExtra("uid", uid); - monitorService.putExtra("packageName", packageName); - monitorService.putExtra("startActivity", startActivity); - startService(monitorService); - isServiceStop = false; - btnTest.setText(getString(R.string.stop_test)); } else { - Toast.makeText(MainPageActivity.this, getString(R.string.choose_app_toast), Toast.LENGTH_LONG).show(); + btnTest.setText(getString(R.string.start_test)); + Toast.makeText(MainPageActivity.this, getString(R.string.test_result_file_toast) + EmmageeService.resultFilePath, + Toast.LENGTH_LONG).show(); + stopService(monitorService); } } else { - btnTest.setText(getString(R.string.start_test)); - Toast.makeText(MainPageActivity.this, getString(R.string.test_result_file_toast) + EmmageeService.resultFilePath, - Toast.LENGTH_LONG).show(); - stopService(monitorService); + Toast.makeText(MainPageActivity.this, getString(R.string.nougat_warning),Toast.LENGTH_LONG).show(); } } }); - lstViProgramme.setAdapter(new ListAdapter()); + + la = new ListAdapter(processInfo.getAllPackages(getBaseContext())); + lstViProgramme.setAdapter(la); lstViProgramme.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView adapterView, View view, int i, long l) { @@ -140,7 +146,7 @@ public class MainPageActivity extends Activity { }); nbTitle.setText(getString(R.string.app_name)); - ivGoBack.setVisibility(ImageView.INVISIBLE); + ivGoBack.setImageResource(R.drawable.refresh); ivBtnSet.setImageResource(R.drawable.settings_button); layBtnSet.setOnClickListener(new OnClickListener() { @Override @@ -148,6 +154,15 @@ public class MainPageActivity extends Activity { goToSettingsActivity(); } }); + + ivGoBack.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View arg0) { + Toast.makeText(MainPageActivity.this, R.string.update_list, Toast.LENGTH_SHORT).show(); + la.swapItems(processInfo.getAllPackages(getBaseContext())); + } + }); + receiver = new UpdateReceiver(); IntentFilter filter = new IntentFilter(); filter.addAction(EmmageeService.SERVICE_ACTION); @@ -257,8 +272,8 @@ public class MainPageActivity extends Activity { Programe checkedProg; int lastCheckedPosition = -1; - public ListAdapter() { - programes = processInfo.getAllPackages(getBaseContext()); + public ListAdapter(List programes) { + this.programes = programes; } @Override @@ -275,6 +290,11 @@ public class MainPageActivity extends Activity { public long getItemId(int position) { return position; } + + public void swapItems(List programes) { + this.programes = programes; + notifyDataSetChanged(); + } @Override public View getView(int position, View convertView, ViewGroup parent) { diff --git a/src/com/netease/qa/emmagee/activity/SettingsActivity.java b/src/com/netease/qa/emmagee/activity/SettingsActivity.java index f51535afe0620c6bac907557d85e8718eceb2d6b..59163ede71ff1608e458df5f412ef545d71e6a8a 100644 --- a/src/com/netease/qa/emmagee/activity/SettingsActivity.java +++ b/src/com/netease/qa/emmagee/activity/SettingsActivity.java @@ -18,14 +18,17 @@ package com.netease.qa.emmagee.activity; import java.io.DataOutputStream; +import com.netease.qa.emmagee.R; +import com.netease.qa.emmagee.utils.Settings; + import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.View; -import android.view.Window; import android.view.View.OnClickListener; +import android.view.Window; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.LinearLayout; @@ -35,9 +38,6 @@ import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; import android.widget.Toast; -import com.netease.qa.emmagee.R; -import com.netease.qa.emmagee.utils.Settings; - /** * Setting Page of Emmagee * diff --git a/src/com/netease/qa/emmagee/service/EmmageeService.java b/src/com/netease/qa/emmagee/service/EmmageeService.java index 0204cc4b3931b7f881d81befcde0709969b5ec6d..9c19b54f15d150ffcd8ac67c1ad65ddaac66da2e 100644 --- a/src/com/netease/qa/emmagee/service/EmmageeService.java +++ b/src/com/netease/qa/emmagee/service/EmmageeService.java @@ -32,6 +32,20 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Locale; +import com.netease.qa.emmagee.R; +import com.netease.qa.emmagee.activity.MainPageActivity; +import com.netease.qa.emmagee.utils.Constants; +import com.netease.qa.emmagee.utils.CpuInfo; +import com.netease.qa.emmagee.utils.CurrentInfo; +import com.netease.qa.emmagee.utils.EncryptData; +import com.netease.qa.emmagee.utils.FpsInfo; +import com.netease.qa.emmagee.utils.MailSender; +import com.netease.qa.emmagee.utils.MemoryInfo; +import com.netease.qa.emmagee.utils.MyApplication; +import com.netease.qa.emmagee.utils.ProcessInfo; +import com.netease.qa.emmagee.utils.Programe; +import com.netease.qa.emmagee.utils.Settings; + import android.app.Activity; import android.app.PendingIntent; import android.app.Service; @@ -60,20 +74,6 @@ import android.widget.Button; import android.widget.TextView; import android.widget.Toast; -import com.netease.qa.emmagee.R; -import com.netease.qa.emmagee.activity.MainPageActivity; -import com.netease.qa.emmagee.utils.Constants; -import com.netease.qa.emmagee.utils.CpuInfo; -import com.netease.qa.emmagee.utils.CurrentInfo; -import com.netease.qa.emmagee.utils.EncryptData; -import com.netease.qa.emmagee.utils.FpsInfo; -import com.netease.qa.emmagee.utils.MailSender; -import com.netease.qa.emmagee.utils.MemoryInfo; -import com.netease.qa.emmagee.utils.MyApplication; -import com.netease.qa.emmagee.utils.ProcessInfo; -import com.netease.qa.emmagee.utils.Programe; -import com.netease.qa.emmagee.utils.Settings; - /** * Service running in background * diff --git a/src/com/netease/qa/emmagee/utils/CpuInfo.java b/src/com/netease/qa/emmagee/utils/CpuInfo.java index c7f7f21fd75e9f66474757886f1a8048954cac45..cd2858762495d233f2e83bd6378b4ed3a9bcc8fc 100644 --- a/src/com/netease/qa/emmagee/utils/CpuInfo.java +++ b/src/com/netease/qa/emmagee/utils/CpuInfo.java @@ -29,14 +29,13 @@ import java.util.Calendar; import java.util.Locale; import java.util.regex.Pattern; +import com.netease.qa.emmagee.R; import com.netease.qa.emmagee.service.EmmageeService; import android.content.Context; import android.os.Build; import android.util.Log; -import com.netease.qa.emmagee.R; - /** * operate CPU information * diff --git a/src/com/netease/qa/emmagee/utils/CustomizedAuthenticator.java b/src/com/netease/qa/emmagee/utils/CustomizedAuthenticator.java index 2b6fe43ffa9c431cddff8d0f632b17e1a57ab51b..e2be858ab441ed8cb60328a64945201978ec6cd0 100644 --- a/src/com/netease/qa/emmagee/utils/CustomizedAuthenticator.java +++ b/src/com/netease/qa/emmagee/utils/CustomizedAuthenticator.java @@ -1,6 +1,7 @@ package com.netease.qa.emmagee.utils; -import javax.mail.*; +import javax.mail.Authenticator; +import javax.mail.PasswordAuthentication; /** * Customized Authenticator diff --git a/src/com/netease/qa/emmagee/utils/EncryptData.java b/src/com/netease/qa/emmagee/utils/EncryptData.java index e305fdff853d915667d7c47f12a16d5e3267ffa8..c595d1888a5be3a1c85fd9da0346bf01cff6974e 100644 --- a/src/com/netease/qa/emmagee/utils/EncryptData.java +++ b/src/com/netease/qa/emmagee/utils/EncryptData.java @@ -1,6 +1,6 @@ package com.netease.qa.emmagee.utils; -import java.security.*; +import java.security.Key; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; diff --git a/src/com/netease/qa/emmagee/utils/MemoryInfo.java b/src/com/netease/qa/emmagee/utils/MemoryInfo.java index 24a1517ec400cf15e860a0a91f5b7235d4496a51..84be2a4f6a99fb8198b6740ad1d01b8b56b9a2c7 100644 --- a/src/com/netease/qa/emmagee/utils/MemoryInfo.java +++ b/src/com/netease/qa/emmagee/utils/MemoryInfo.java @@ -21,7 +21,6 @@ import java.io.DataOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; -import java.text.DecimalFormat; import android.app.ActivityManager; import android.content.Context; diff --git a/src/com/netease/qa/emmagee/utils/ProcessInfo.java b/src/com/netease/qa/emmagee/utils/ProcessInfo.java index 16f5a087dd90c52d0ca56fd29ec1c6f301951c9c..c6a26bc1ff1137bef703367021a378ba36565de1 100644 --- a/src/com/netease/qa/emmagee/utils/ProcessInfo.java +++ b/src/com/netease/qa/emmagee/utils/ProcessInfo.java @@ -210,6 +210,9 @@ public class ProcessInfo { ActivityManager manager = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); // Note: getRunningTasks is deprecated in API 21(Official) +// if (Build.VERSION.SDK_INT >= 21) { +// return Constants.NA; +// } List runningTaskInfos = manager.getRunningTasks(1); if (runningTaskInfos != null) return (runningTaskInfos.get(0).topActivity).toString(); diff --git a/src/com/netease/qa/emmagee/utils/TrafficInfo.java b/src/com/netease/qa/emmagee/utils/TrafficInfo.java index 4d597af65e936e50719fe3975f6feb2b330a5153..5e6a04f1aedf5c66499c9358be9909e8f390ffd5 100644 --- a/src/com/netease/qa/emmagee/utils/TrafficInfo.java +++ b/src/com/netease/qa/emmagee/utils/TrafficInfo.java @@ -16,10 +16,6 @@ */ package com.netease.qa.emmagee.utils; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.RandomAccessFile; - import android.net.TrafficStats; import android.util.Log;