src/api-impl: fix up code style, mainly for code imported from AOSP

used the following (plus manual edits):
`clang-format --style="{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 0}`
This commit is contained in:
Mis012
2023-06-22 11:45:46 +02:00
parent 824b821f5a
commit 0a9591c474
208 changed files with 154568 additions and 150150 deletions

View File

@@ -11,13 +11,13 @@ public class AudioManager {
}
public String getProperty(String name) {
switch(name) {
switch (name) {
case PROPERTY_OUTPUT_FRAMES_PER_BUFFER:
return "256"; // FIXME arbitrary
case PROPERTY_OUTPUT_SAMPLE_RATE:
return "44100"; // FIXME arbitrary
default:
System.out.println("AudioManager.getProperty: >"+name+"< not handled");
System.out.println("AudioManager.getProperty: >" + name + "< not handled");
return "";
}
}
@@ -29,7 +29,7 @@ public class AudioManager {
return 0;
}
public int getStreamVolume (int streamType) {
public int getStreamVolume(int streamType) {
return 0; // arbitrary, shouldn't matter too much?
}
}

View File

@@ -31,10 +31,10 @@ public class AudioTrack {
this.bufferSizeInBytes = bufferSizeInBytes;
this.mode = mode;
System.out.println("\n\n\nAudioTrack("+streamType+", "+sampleRateInHz+", "+channelConfig+", "+audioFormat+", "+bufferSizeInBytes+", "+mode+"); called\n\n\n\n");
System.out.println("\n\n\nAudioTrack(" + streamType + ", " + sampleRateInHz + ", " + channelConfig + ", " + audioFormat + ", " + bufferSizeInBytes + ", " + mode + "); called\n\n\n\n");
int num_channels;
switch(channelConfig) {
switch (channelConfig) {
case 2:
num_channels = 1;
break;
@@ -45,14 +45,14 @@ public class AudioTrack {
native_constructor(streamType, sampleRateInHz, num_channels, audioFormat, bufferSizeInBytes, mode);
}
public static native int getMinBufferSize (int sampleRateInHz, int channelConfig, int audioFormat);
public static native int getMinBufferSize(int sampleRateInHz, int channelConfig, int audioFormat);
public void setPlaybackPositionUpdateListener(OnPlaybackPositionUpdateListener listener) {
this.periodic_update_listener = listener;
}
public int setPositionNotificationPeriod(int periodInFrames) {
System.out.println("\n\n\nsetPositionNotificationPeriod("+periodInFrames+"); called\n\n\n\n");
System.out.println("\n\n\nsetPositionNotificationPeriod(" + periodInFrames + "); called\n\n\n\n");
return 0; // SUCCESS
}
@@ -74,5 +74,5 @@ public class AudioTrack {
System.out.println("calling release(), how did this not get reported before DIDREEEEEEEEEEEEEEEEEEEEEEEEE\n");
}
public native int write (byte[] audioData, int offsetInBytes, int sizeInBytes);
public native int write(byte[] audioData, int offsetInBytes, int sizeInBytes);
}

View File

@@ -6,9 +6,9 @@ public class MediaRouter {
public static final int ROUTE_TYPE_LIVE_VIDEO = 0x2;
public static class RouteInfo {
public Display getPresentationDisplay() {
return new Display();
}
public Display getPresentationDisplay() {
return new Display();
}
}
public RouteInfo getSelectedRoute(int type) {

View File

@@ -4,39 +4,39 @@ import android.content.res.AssetFileDescriptor;
public class SoundPool {
private long nativePool;
private long nativePool;
public interface OnLoadCompleteListener {
/**
* Called when a sound has completed loading.
*
* @param soundPool SoundPool object from the load() method
* @param soundPool the sample ID of the sound loaded.
* @param status the status of the load operation (0 = success)
*/
public void onLoadComplete(SoundPool soundPool, int sampleId, int status);
}
/**
* Called when a sound has completed loading.
*
* @param soundPool SoundPool object from the load() method
* @param soundPool the sample ID of the sound loaded.
* @param status the status of the load operation (0 = success)
*/
public void onLoadComplete(SoundPool soundPool, int sampleId, int status);
}
public SoundPool (int maxStreams, int streamType, int srcQuality) {
nativePool = native_constructor();
public SoundPool(int maxStreams, int streamType, int srcQuality) {
nativePool = native_constructor();
}
public int load(AssetFileDescriptor afd, int priority) {
return nativeLoad(nativePool, android.os.Environment.getExternalStorageDirectory().getPath() + afd.fileName);
return nativeLoad(nativePool, android.os.Environment.getExternalStorageDirectory().getPath() + afd.fileName);
}
/**
* Sets the callback hook for the OnLoadCompleteListener.
*/
public void setOnLoadCompleteListener(OnLoadCompleteListener listener) {
System.out.println("WARNING: SoundPool.setOnLoadCompleteListener not implemented yet");
}
* Sets the callback hook for the OnLoadCompleteListener.
*/
public void setOnLoadCompleteListener(OnLoadCompleteListener listener) {
System.out.println("WARNING: SoundPool.setOnLoadCompleteListener not implemented yet");
}
public final int play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate) {
return nativePlay(nativePool, soundID);
}
public final int play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate) {
return nativePlay(nativePool, soundID);
}
private static native long native_constructor();
private static native int nativeLoad(long nativePool, String path);
public static native int nativePlay(long nativePool, int soundID);
private static native long native_constructor();
private static native int nativeLoad(long nativePool, String path);
public static native int nativePlay(long nativePool, int soundID);
}