api-impl: add stubs, put Vibrator.java in meson.build (oops), sort sources with LC_ALL=C sort -h

This commit is contained in:
Mis012
2024-03-15 20:02:18 +01:00
parent 19f1747e0d
commit fa1aa36f6b
6 changed files with 111 additions and 84 deletions

View File

@@ -2,4 +2,6 @@ package android.graphics.drawable;
public class AnimationDrawable extends Drawable {
public void addFrame(Drawable drawable, int dummy) {}
public void start() {}
public void stop() {}
}

View File

@@ -12,4 +12,6 @@ public final class PowerManager {
public WakeLock newWakeLock(int levelAndFlags, String tag) {
return new WakeLock();
}
public void userActivity(long dummy, boolean dummy2) {}
}

View File

@@ -1,4 +1,22 @@
package android.os;
import android.util.Slog;
public class Vibrator {
public void vibrate(long millis) {
Slog.v("Vibrator", "vibration motor go burrrr for "+millis+"ms");
}
public void vibrate (final long[] pattern, int repeat) {
Thread t = new Thread(new Runnable() {
public void run() {
for(int i = 0; i < pattern.length; i++) {
if(i%2 == 0)
try { Thread.sleep(pattern[i]); } catch(InterruptedException e) {}
else
vibrate(pattern[i]);
}
}
});
t.start();
}
}

View File

@@ -10,4 +10,6 @@ public class Animation {
public void cancel() {}
public void setFillBefore(boolean dummy) {}
public void setFillAfter(boolean dummy) {}
}