Commit 946ba55e by Yujin Seo

Merge branch 'features/1.4.411_52353_nullpo' into 'features/1.4.412'

Bug #52353 【インターテクノロジー】AbooKCheck 強制終了

See merge request !302
parents f1eea383 0cdd0faa
......@@ -82,9 +82,22 @@ public class DeviceInfo {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
//noinspection deprecation(API21から非推奨になった。無視)
List<RunningTaskInfo> list = am.getRunningTasks(1);
ComponentName cn = list.get(0).topActivity;
String name = cn.getPackageName();
return name.indexOf(context.getPackageName()) > -1;
if (list != null && list.size() > 0) {
ComponentName cn = list.get(0).topActivity;
if (cn != null) {
String name = cn.getPackageName();
if (name != null) {
return name.contains(context.getPackageName());
} else {
Logger.d(TAG, "packageName is null");
}
} else {
Logger.d(TAG, "ComponentName is null");
}
} else {
Logger.d(TAG, "getRunningTasks is empty");
}
return false;
}
private static boolean isEmulator() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment