Mechanism is a bit different though: SufraceFlinger process that is responsible for acquiring touchscreen input, temporarily boosts CPU and GPU frequencies to make sure screen animations are nice and fluid.
Mechanism is a bit different though: SufraceFlinger process that is responsible for acquiring touchscreen input, temporarily boosts CPU and GPU frequencies to make sure screen animations are nice and fluid.
Maybe the map turns as you turn so as to maintain compass north.
Of course, for most developers that might mean to not update/invalidate() a map view constantly :)
Only if they do not have enough load, that is. If you have an actually loaded background process on Android it by itself will keep the clocks high. If you have a process that has short bursts of work, though, then the duration of that burst will definitely vary in response to touch boost. This is all the same as "regular" linux as it's just an aspect of most governors (ondemand, interactive, etc...)
As in, touching the display will never make this loop go faster:
void busyLoop() {
Random rand = new Random();
int data[] = new int[1000];
for (int i = 0; i < data.length; i++) {
data[i] = rand.nextInt();
}
while (true) {
measure(() -> {
for (int i = 0; i < data.length; i++) {
data[i] = (data[i] * 4) % 1000;
}
});
}
}
The hypothetical measure will observe duration to normalize to a number and then it'll stay roughly there until thermal throttling kicks in.If, however, the loop was to look more like this:
void busyLoop() {
Random rand = new Random();
int data[] = new int[1000];
for (int i = 0; i < data.length; i++) {
data[i] = rand.nextInt();
}
while (true) {
measure(() -> {
for (int i = 0; i < data.length; i++) {
data[i] = (data[i] * 4) % 1000;
}
});
try {
Thread.sleep(5);
} catch (InterruptedException ex) {}
}
}
Then you would see the measured duration decrease when your finger was on the screen vs. not, because the kernel will consistently see that the task is not keeping the CPU it's scheduled on loaded above a threshold, so the clocks will go down all the way to idle.