This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!CpuInfo.locked && isSustainedPerformanceModeSupported()) { | |
sustainedPerformanceModeInUse = true | |
} | |
private val activityLifecycleCallbacks = object : Application.ActivityLifecycleCallbacks { | |
@SuppressLint("NewApi") // window API guarded by [isSustainedPerformanceModeSupported] | |
override fun onActivityCreated(activity: Activity, bundle: Bundle?) { | |
if (sustainedPerformanceModeInUse) { | |
activity.window.setSustainedPerformanceMode(true) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val dest = "/data/local/tmp/lockClocks.sh" | |
val source = javaClass.classLoader.getResource("scripts/lockClocks.sh") | |
val tmpSource = Files.createTempFile("lockClocks.sh", null).toString() | |
Files.copy( | |
source.openStream(), | |
Paths.get(tmpSource), | |
StandardCopyOption.REPLACE_EXISTING | |
) | |
adb.execSync("push $tmpSource $dest") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class AndroidBenchmarkRunner : AndroidJUnitRunner() { | |
@CallSuper | |
override fun waitForActivitiesToComplete() { | |
// We don't call the super method here, since we have | |
// an activity we intend to persist between tests | |
// TODO: somehow wait for every activity but IsolationActivity | |
// Before/After each test, from the test thread, synchronously launch | |
// our IsolationActivity if it's not already resumed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.yangweigbh.traceana; | |
import android.os.Handler; | |
import android.os.HandlerThread; | |
import android.os.Looper; | |
import android.util.Log; | |
import java.util.concurrent.ConcurrentHashMap; | |
public class ThreadWatcher { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.* | |
/** | |
* Created by yangwei-ms on 2017/7/14. | |
*/ | |
class SkipList<T>(private val comparator: Comparator<T>) { | |
private var curHeight: Int = 1 | |
private val head: Node<T> = Node(null, MAX_HEIGHT) | |
private val rnd: Random = Random(System.currentTimeMillis()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface NetworkEventProvider { | |
void setListener(Listener listener); | |
interface Listener { | |
/** | |
* @param networkStatus {@link com.birbit.android.jobqueue.network.NetworkUtil.NetworkStatus} | |
*/ | |
void onNetworkChange(@NetworkUtil.NetworkStatus int networkStatus); | |
} | |
} |
NewerOlder