Skip to content

Commit d0f783c

Browse files
committed
Replace tabbed indents with 4 spaces
1 parent b2b1e59 commit d0f783c

90 files changed

Lines changed: 4138 additions & 4138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

android/sdl_android/src/androidTest/java/com/android/grafika/gles/OffscreenSurfaceTest.java

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -18,88 +18,88 @@
1818
@RunWith(AndroidJUnit4.class)
1919
public class OffscreenSurfaceTest {
2020

21-
private final String TAG = OffscreenSurfaceTest.class.getSimpleName();
22-
private final int mWidth = 1280;
23-
private final int mHeight = 720;
24-
private final int mIterations = 100;
25-
26-
@Test
27-
public void testReadPixels() {
28-
EglCore eglCore = new EglCore(null, 0);
29-
OffscreenSurface offscreenSurface = new OffscreenSurface(eglCore, mWidth, mHeight);
30-
float time = runReadPixelsTest(offscreenSurface);
31-
Log.d(TAG, "runReadPixelsTest returns " + time + " msec");
32-
}
33-
34-
// HELPER test method
35-
/**
36-
* Does a simple bit of rendering and then reads the pixels back.
37-
*
38-
* @return total time (msec order) spent on glReadPixels()
39-
*/
40-
private float runReadPixelsTest(OffscreenSurface eglSurface) {
41-
long totalTime = 0;
42-
43-
eglSurface.makeCurrent();
44-
45-
ByteBuffer pixelBuf = ByteBuffer.allocateDirect(mWidth * mHeight * 4);
46-
pixelBuf.order(ByteOrder.LITTLE_ENDIAN);
47-
48-
Log.d(TAG, "Running...");
49-
float colorMult = 1.0f / mIterations;
50-
for (int i = 0; i < mIterations; i++) {
51-
if ((i % (mIterations / 8)) == 0) {
52-
Log.d(TAG, "iteration " + i);
53-
}
54-
55-
// Clear the screen to a solid color, then add a rectangle. Change the color
56-
// each time.
57-
float r = i * colorMult;
58-
float g = 1.0f - r;
59-
float b = (r + g) / 2.0f;
60-
GLES20.glClearColor(r, g, b, 1.0f);
61-
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
62-
63-
GLES20.glEnable(GLES20.GL_SCISSOR_TEST);
64-
GLES20.glScissor(mWidth / 4, mHeight / 4, mWidth / 2, mHeight / 2);
65-
GLES20.glClearColor(b, g, r, 1.0f);
66-
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
67-
GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
68-
69-
// Try to ensure that rendering has finished.
70-
GLES20.glFinish();
71-
GLES20.glReadPixels(0, 0, 1, 1,
72-
GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, pixelBuf);
73-
74-
// Time individual extraction. Ideally we'd be timing a bunch of these calls
75-
// and measuring the aggregate time, but we want the isolated time, and if we
76-
// just read the same buffer repeatedly we might get some sort of cache effect.
77-
long startWhen = System.nanoTime();
78-
GLES20.glReadPixels(0, 0, mWidth, mHeight,
79-
GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, pixelBuf);
80-
totalTime += System.nanoTime() - startWhen;
81-
}
82-
Log.d(TAG, "done");
83-
84-
// It's not the good idea to request external strage permission in unit test.
85-
boolean requireStoragePermission = false;
86-
if (requireStoragePermission) {
87-
long startWhen = System.nanoTime();
88-
File file = new File(Environment.getExternalStorageDirectory(),
89-
"test.png");
90-
try {
91-
eglSurface.saveFrame(file);
92-
} catch (IOException ioe) {
93-
throw new RuntimeException(ioe);
94-
}
95-
Log.d(TAG, "Saved frame in " + ((System.nanoTime() - startWhen) / 1000000) + "ms");
96-
assertTrue(file.exists());
97-
} else {
98-
// here' we can recognize Unit Test succeeded, but anyway checks to see totalTime and buffer capacity.
99-
assertTrue(pixelBuf.capacity() > 0 && totalTime > 0);
100-
}
101-
102-
return (float)totalTime / 1000000f;
103-
}
21+
private final String TAG = OffscreenSurfaceTest.class.getSimpleName();
22+
private final int mWidth = 1280;
23+
private final int mHeight = 720;
24+
private final int mIterations = 100;
25+
26+
@Test
27+
public void testReadPixels() {
28+
EglCore eglCore = new EglCore(null, 0);
29+
OffscreenSurface offscreenSurface = new OffscreenSurface(eglCore, mWidth, mHeight);
30+
float time = runReadPixelsTest(offscreenSurface);
31+
Log.d(TAG, "runReadPixelsTest returns " + time + " msec");
32+
}
33+
34+
// HELPER test method
35+
/**
36+
* Does a simple bit of rendering and then reads the pixels back.
37+
*
38+
* @return total time (msec order) spent on glReadPixels()
39+
*/
40+
private float runReadPixelsTest(OffscreenSurface eglSurface) {
41+
long totalTime = 0;
42+
43+
eglSurface.makeCurrent();
44+
45+
ByteBuffer pixelBuf = ByteBuffer.allocateDirect(mWidth * mHeight * 4);
46+
pixelBuf.order(ByteOrder.LITTLE_ENDIAN);
47+
48+
Log.d(TAG, "Running...");
49+
float colorMult = 1.0f / mIterations;
50+
for (int i = 0; i < mIterations; i++) {
51+
if ((i % (mIterations / 8)) == 0) {
52+
Log.d(TAG, "iteration " + i);
53+
}
54+
55+
// Clear the screen to a solid color, then add a rectangle. Change the color
56+
// each time.
57+
float r = i * colorMult;
58+
float g = 1.0f - r;
59+
float b = (r + g) / 2.0f;
60+
GLES20.glClearColor(r, g, b, 1.0f);
61+
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
62+
63+
GLES20.glEnable(GLES20.GL_SCISSOR_TEST);
64+
GLES20.glScissor(mWidth / 4, mHeight / 4, mWidth / 2, mHeight / 2);
65+
GLES20.glClearColor(b, g, r, 1.0f);
66+
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
67+
GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
68+
69+
// Try to ensure that rendering has finished.
70+
GLES20.glFinish();
71+
GLES20.glReadPixels(0, 0, 1, 1,
72+
GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, pixelBuf);
73+
74+
// Time individual extraction. Ideally we'd be timing a bunch of these calls
75+
// and measuring the aggregate time, but we want the isolated time, and if we
76+
// just read the same buffer repeatedly we might get some sort of cache effect.
77+
long startWhen = System.nanoTime();
78+
GLES20.glReadPixels(0, 0, mWidth, mHeight,
79+
GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, pixelBuf);
80+
totalTime += System.nanoTime() - startWhen;
81+
}
82+
Log.d(TAG, "done");
83+
84+
// It's not the good idea to request external strage permission in unit test.
85+
boolean requireStoragePermission = false;
86+
if (requireStoragePermission) {
87+
long startWhen = System.nanoTime();
88+
File file = new File(Environment.getExternalStorageDirectory(),
89+
"test.png");
90+
try {
91+
eglSurface.saveFrame(file);
92+
} catch (IOException ioe) {
93+
throw new RuntimeException(ioe);
94+
}
95+
Log.d(TAG, "Saved frame in " + ((System.nanoTime() - startWhen) / 1000000) + "ms");
96+
assertTrue(file.exists());
97+
} else {
98+
// here' we can recognize Unit Test succeeded, but anyway checks to see totalTime and buffer capacity.
99+
assertTrue(pixelBuf.capacity() > 0 && totalTime > 0);
100+
}
101+
102+
return (float)totalTime / 1000000f;
103+
}
104104

105105
}

android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,7 @@ public static boolean validatePermissionItem(PermissionItem item1, PermissionIte
24312431
log("validatePermissionItem", "Items are the same object. No defensive copy took place.");
24322432
return false;
24332433
}
2434-
*/
2434+
*/
24352435
if (!item1.getRpcName().equals(item2.getRpcName())) {
24362436
return false;
24372437
}
@@ -2509,7 +2509,7 @@ public static boolean validateParameterPermissions(ParameterPermissions item1, P
25092509
log("validateParameterPermissions", "Items are the same object. No defensive copy took place.");
25102510
return false;
25112511
}
2512-
*/
2512+
*/
25132513
if (!validateStringList(item1.getAllowed(), item2.getAllowed())) {
25142514
return false;
25152515
}

android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void setUp() {
3535
msg.setPixelPerInch(TestValues.GENERAL_DOUBLE);
3636
msg.setScale(TestValues.GENERAL_DOUBLE);
3737
msg.setAdditionalVideoStreamingCapabilities(TestValues.GENERAL_ADDITIONAL_CAPABILITY_LIST);
38-
msg.setPreferredFPS(TestValues.GENERAL_INTEGER);
38+
msg.setPreferredFPS(TestValues.GENERAL_INTEGER);
3939
}
4040

4141
/**
@@ -51,7 +51,7 @@ public void testRpcValues() {
5151
Double pixelPerInch = msg.getPixelPerInch();
5252
Double scale = msg.getScale();
5353
List<VideoStreamingCapability> additionalVideoStreamingCapabilities = msg.getAdditionalVideoStreamingCapabilities();
54-
Integer preferredFPS = msg.getPreferredFPS();
54+
Integer preferredFPS = msg.getPreferredFPS();
5555

5656
// Valid Tests
5757
assertEquals(TestValues.MATCH, (List<VideoStreamingFormat>) TestValues.GENERAL_VIDEOSTREAMINGFORMAT_LIST, format);
@@ -75,7 +75,7 @@ public void testRpcValues() {
7575
assertNull(TestValues.NULL, msg.getPixelPerInch());
7676
assertNull(TestValues.NULL, msg.getScale());
7777
assertNull(TestValues.NULL, msg.getAdditionalVideoStreamingCapabilities());
78-
assertNull(TestValues.NULL, msg.getPreferredFPS());
78+
assertNull(TestValues.NULL, msg.getPreferredFPS());
7979
}
8080

8181
public void testJson() {
@@ -90,7 +90,7 @@ public void testJson() {
9090
reference.put(VideoStreamingCapability.KEY_DIAGONAL_SCREEN_SIZE, TestValues.GENERAL_DOUBLE);
9191
reference.put(VideoStreamingCapability.KEY_PIXEL_PER_INCH, TestValues.GENERAL_DOUBLE);
9292
reference.put(VideoStreamingCapability.KEY_SCALE, TestValues.GENERAL_DOUBLE);
93-
reference.put(VideoStreamingCapability.KEY_PREFERRED_FPS, TestValues.GENERAL_INTEGER);
93+
reference.put(VideoStreamingCapability.KEY_PREFERRED_FPS, TestValues.GENERAL_INTEGER);
9494

9595
JSONObject underTest = msg.serializeJSON();
9696
assertEquals(TestValues.MATCH, reference.length(), underTest.length());

android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@RunWith(AndroidJUnit4.class)
2525
public class TransportBrokerTest { //FIXME this test class needs to be fixed. At this point these tests are not helpful
2626
RouterServiceValidator rsvp;
27-
// public TransportBrokerThread(Context context, String appId, ComponentName service){
27+
// public TransportBrokerThread(Context context, String appId, ComponentName service){
2828

2929
@Before
3030
public void setUp() throws Exception {

android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ private void checkTrustedRouter(final ValidationStatusCallback callback, final P
233233
* @param context
234234
*/
235235
//private void retrieveBestRouterServiceName(Context context) {
236-
// FindRouterTask task = new FindRouterTask(null);
237-
// task.execute(context);
236+
// FindRouterTask task = new FindRouterTask(null);
237+
// task.execute(context);
238238
//}
239239

240240
/**

android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,9 +1692,9 @@ private boolean bluetoothAvailable() {
16921692
}
16931693

16941694
/**
1695-
* 1. If the app has SDL shut off, shut down
1696-
* 2. if The app has an Alt Transport address or was started by one, stay open
1697-
* 3. If Bluetooth is off/NA shut down
1695+
* 1. If the app has SDL shut off, shut down
1696+
* 2. if The app has an Alt Transport address or was started by one, stay open
1697+
* 3. If Bluetooth is off/NA shut down
16981698
* 4. Anything else
16991699
*/
17001700
public boolean shouldServiceRemainOpen(Intent intent) {
@@ -2743,8 +2743,8 @@ private String getAppIDForSession(int sessionId, boolean newSession, boolean new
27432743
}
27442744

27452745
/* ****************************************************************************************************************************************
2746-
// *********************************************************** LEGACY ****************************************************************
2747-
//*****************************************************************************************************************************************/
2746+
// *********************************************************** LEGACY ****************************************************************
2747+
//*****************************************************************************************************************************************/
27482748
private boolean legacyModeEnabled = false;
27492749

27502750
private void enableLegacyMode(boolean enable) {
@@ -2761,9 +2761,9 @@ private void enableLegacyMode(boolean enable) {
27612761

27622762
}
27632763

2764-
/* ****************************************************************************************************************************************
2765-
// *********************************************************** UTILITY ****************************************************************
2766-
//*****************************************************************************************************************************************/
2764+
/* ****************************************************************************************************************************************
2765+
// *********************************************************** UTILITY ****************************************************************
2766+
//*****************************************************************************************************************************************/
27672767

27682768
private void debugPacket(byte[] bytes) {
27692769
//DEBUG
@@ -2942,9 +2942,9 @@ private void stopClientPings() {
29422942
pingIntent = null;
29432943
}
29442944

2945-
/* ****************************************************************************************************************************************
2946-
// ********************************************************** TINY CLASSES ************************************************************
2947-
//*****************************************************************************************************************************************/
2945+
/* ****************************************************************************************************************************************
2946+
// ********************************************************** TINY CLASSES ************************************************************
2947+
//*****************************************************************************************************************************************/
29482948

29492949
/**
29502950
* This class enables us to compare two router services
@@ -3138,9 +3138,9 @@ public String getAppId() {
31383138
return appId;
31393139
}
31403140

3141-
/*public long getAppId() {
3142-
return appId;
3143-
}*/
3141+
/*public long getAppId() {
3142+
return appId;
3143+
}*/
31443144

31453145
/**
31463146
* This is a convenience variable and may not be used or useful in different protocols

base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseSystemCapabilityManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,12 @@ private void retrieveCapability(final SystemCapabilityType systemCapabilityType,
590590
final GetSystemCapability request = new GetSystemCapability();
591591
request.setSystemCapabilityType(systemCapabilityType);
592592

593-
/*
594-
The subscription flag in the request should be set based on multiple variables:
595-
- if subscribe is null (no change), willSubscribe = current subscription status, or false if the HU does not support subscriptions
596-
- if subscribe is false, then willSubscribe = false
597-
- if subscribe is true and the HU supports subscriptions, then willSubscribe = true
598-
*/
593+
/*
594+
The subscription flag in the request should be set based on multiple variables:
595+
- if subscribe is null (no change), willSubscribe = current subscription status, or false if the HU does not support subscriptions
596+
- if subscribe is false, then willSubscribe = false
597+
- if subscribe is true and the HU supports subscriptions, then willSubscribe = true
598+
*/
599599
boolean shouldSubscribe = (subscribe != null) ? subscribe : isSubscribedToSystemCapability(systemCapabilityType);
600600
final boolean willSubscribe = shouldSubscribe && supportsSubscriptions();
601601
request.setSubscribe(willSubscribe);

base/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333

3434

3535
public enum MessageType {
36-
// START_SESSION,
37-
// START_SESSION_ACK,
38-
// START_SESSION_NACK,
39-
// END_SESSION,
36+
// START_SESSION,
37+
// START_SESSION_ACK,
38+
// START_SESSION_NACK,
39+
// END_SESSION,
4040
UNDEFINED,
4141
BULK,
4242
RPC;

0 commit comments

Comments
 (0)