Skip to content

Commit a306cda

Browse files
Apply style format, run lint/editorconfigCheck during build
1 parent 8d8b732 commit a306cda

23 files changed

+192
-189
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.POSIX:
22
.PHONY: init clean distclean build-openssl build publish-local-snapshot \
3-
publish-local-release publish-remote-snapshot public-remote-release
3+
publish-local-release publish-remote-snapshot public-remote-release check
44
GRADLE = @./gradlew
55

66
init:
@@ -15,11 +15,14 @@ distclean:
1515
build-openssl:
1616
$(GRADLE) buildOpenSSL
1717

18-
build-debug:
18+
check:
19+
$(GRADLE) check
20+
21+
build-debug: check
1922
$(GRADLE) android-database-sqlcipher:bundleDebugAar \
2023
-PdebugBuild=true
2124

22-
build-release:
25+
build-release: check
2326
$(GRADLE) android-database-sqlcipher:bundleReleaseAar \
2427
-PdebugBuild=false
2528

android-database-sqlcipher/src/main/aidl/net/sqlcipher/IContentObserver.aidl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
**
33
** Copyright 2007, The Android Open Source Project
44
**
5-
** Licensed under the Apache License, Version 2.0 (the "License");
6-
** you may not use this file except in compliance with the License.
7-
** You may obtain a copy of the License at
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
88
**
9-
** http://www.apache.org/licenses/LICENSE-2.0
9+
** http://www.apache.org/licenses/LICENSE-2.0
1010
**
11-
** Unless required by applicable law or agreed to in writing, software
12-
** distributed under the License is distributed on an "AS IS" BASIS,
13-
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
** See the License for the specific language governing permissions and
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
1515
** limitations under the License.
1616
*/
1717

android-database-sqlcipher/src/main/cpp/CursorWindow.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
22
* Copyright (C) 2006-2007 The Android Open Source Project
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
99
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
1616

@@ -165,7 +165,7 @@ row_slot_t * CursorWindow::getRowSlot(int row)
165165
chunkPtrOffset = rowChunk - mData + (ROW_SLOT_CHUNK_NUM_ROWS * sizeof(row_slot_t));
166166
}
167167
return (row_slot_t *)(rowChunk + (chunkPos * sizeof(row_slot_t)));
168-
LOG_WINDOW("exit getRowSlot current row num %d, this row %d", mHeader->numRows, row);
168+
LOG_WINDOW("exit getRowSlot current row num %d, this row %d", mHeader->numRows, row);
169169
}
170170

171171
row_slot_t * CursorWindow::allocRowSlot()
@@ -216,7 +216,7 @@ field_slot_t * CursorWindow::getFieldSlotWithCheck(int row, int column)
216216
if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) {
217217
LOGE("Bad request for field slot %d,%d. numRows = %d, numColumns = %d", row, column, mHeader->numRows, mHeader->numColumns);
218218
return NULL;
219-
}
219+
}
220220
row_slot_t * rowSlot = getRowSlot(row);
221221
if (!rowSlot) {
222222
LOGE("Failed to find rowSlot for row %d", row);
@@ -225,9 +225,9 @@ field_slot_t * CursorWindow::getFieldSlotWithCheck(int row, int column)
225225
if (rowSlot->offset == 0 || rowSlot->offset >= mSize) {
226226
LOGE("Invalid rowSlot, offset = %d", rowSlot->offset);
227227
return NULL;
228-
}
228+
}
229229
int fieldDirOffset = rowSlot->offset;
230-
return ((field_slot_t *)offsetToPtr(fieldDirOffset)) + column;
230+
return ((field_slot_t *)offsetToPtr(fieldDirOffset)) + column;
231231
}
232232

233233
uint32_t CursorWindow::read_field_slot(int row, int column, field_slot_t * slotOut)
@@ -236,7 +236,7 @@ uint32_t CursorWindow::read_field_slot(int row, int column, field_slot_t * slotO
236236
if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) {
237237
LOGE("Bad request for field slot %d,%d. numRows = %d, numColumns = %d", row, column, mHeader->numRows, mHeader->numColumns);
238238
return -1;
239-
}
239+
}
240240
row_slot_t * rowSlot = getRowSlot(row);
241241
if (!rowSlot) {
242242
LOGE("Failed to find rowSlot for row %d", row);
@@ -259,7 +259,7 @@ uint32_t CursorWindow::read_field_slot(int row, int column, field_slot_t * slotO
259259

260260
void CursorWindow::copyIn(uint32_t offset, uint8_t const * data, size_t size)
261261
{
262-
assert(offset + size <= mSize);
262+
assert(offset + size <= mSize);
263263
memcpy(mData + offset, data, size);
264264
}
265265

@@ -364,7 +364,7 @@ bool CursorWindow::getLong(unsigned int row, unsigned int col, int64_t * valueOu
364364
if (!fieldSlot || fieldSlot->type != FIELD_TYPE_INTEGER) {
365365
return false;
366366
}
367-
367+
368368
#if WINDOW_STORAGE_INLINE_NUMERICS
369369
*valueOut = fieldSlot->data.l;
370370
#else
@@ -394,7 +394,7 @@ bool CursorWindow::getNull(unsigned int row, unsigned int col, bool * valueOut)
394394
if (!fieldSlot) {
395395
return false;
396396
}
397-
397+
398398
if (fieldSlot->type != FIELD_TYPE_NULL) {
399399
*valueOut = false;
400400
} else {

android-database-sqlcipher/src/main/cpp/CursorWindow.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
22
* Copyright (C) 2006 The Android Open Source Project
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
99
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
1616

@@ -170,7 +170,7 @@ class CursorWindow
170170
row_slot_t * allocRowSlot();
171171

172172
row_slot_t * getRowSlot(int row);
173-
173+
174174
/**
175175
* return NULL if Failed to find rowSlot or
176176
* Invalid rowSlot

android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ namespace sqlcipher {
152152
env->ReleaseCharArrayElements(jKey, jKeyChar, JNI_ABORT);
153153
env->ReleaseStringUTFChars(key, password);
154154
}
155-
155+
156156
void native_rawExecSQL(JNIEnv* env, jobject object, jstring sql)
157157
{
158158
sqlite3 * handle = (sqlite3 *)env->GetLongField(object, offset_db_handle);

android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDebug.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int read_mapinfo(FILE *fp,
108108

109109
again:
110110
skip = 0;
111-
111+
112112
if(fgets(line, 1024, fp) == 0) return 0;
113113

114114
len = strlen(line);
@@ -138,7 +138,7 @@ static int read_mapinfo(FILE *fp,
138138
if (sscanf(line, "Private_Dirty: %d kB", &private_dirty) != 1) return 0;
139139
if (fgets(line, 1024, fp) == 0) return 0;
140140
if (sscanf(line, "Referenced: %d kB", &referenced) != 1) return 0;
141-
141+
142142
if (skip) {
143143
goto again;
144144
}
@@ -154,11 +154,11 @@ static void load_maps(int pid, int *sharedPages, int *privatePages)
154154
{
155155
char tmp[128];
156156
FILE *fp;
157-
157+
158158
sprintf(tmp, "/proc/%d/smaps", pid);
159159
fp = fopen(tmp, "r");
160160
if (fp == 0) return;
161-
161+
162162
while (read_mapinfo(fp, sharedPages, privatePages) != 0) {
163163
// Do nothing
164164
}

android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteQuery.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static jint native_fill_window(JNIEnv* env, jobject object, jobject javaWindow,
115115
int retryCount;
116116
int boundParams;
117117
CursorWindow * window;
118-
118+
119119
if (statement == NULL) {
120120
LOGE("Invalid statement in fillWindow()");
121121
jniThrowException(env, "java/lang/IllegalStateException",
@@ -166,8 +166,8 @@ static jint native_fill_window(JNIEnv* env, jobject object, jobject javaWindow,
166166
LOGE("startPos %d > actual rows %d", startPos, num);
167167
return num;
168168
}
169-
}
170-
169+
}
170+
171171
while(startPos != 0 || numRows < maxRead) {
172172
err = sqlite3_step(statement);
173173
if (err == SQLITE_ROW) {

android-database-sqlcipher/src/main/java/net/sqlcipher/AbstractCursor.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ public CursorWindow getWindow() {
7777
public int getColumnCount() {
7878
return getColumnNames().length;
7979
}
80-
80+
8181
public void deactivate() {
8282
deactivateInternal();
8383
}
84-
84+
8585
/**
8686
* @hide
8787
*/
@@ -92,10 +92,10 @@ public void deactivateInternal() {
9292
}
9393
mDataSetObservable.notifyInvalidated();
9494
}
95-
95+
9696
public boolean requery() {
9797
if (mSelfObserver != null && mSelfObserverRegistered == false) {
98-
98+
9999
mContentResolver.registerContentObserver(mNotifyUri, true, mSelfObserver);
100100
mSelfObserverRegistered = true;
101101
}
@@ -106,7 +106,7 @@ public boolean requery() {
106106
public boolean isClosed() {
107107
return mClosed;
108108
}
109-
109+
110110
public void close() {
111111
mClosed = true;
112112
mContentObservable.unregisterAll();
@@ -143,7 +143,7 @@ public boolean onMove(int oldPosition, int newPosition) {
143143
return true;
144144
}
145145

146-
146+
147147
public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
148148
// Default implementation, uses getString
149149
String result = getString(columnIndex);
@@ -159,7 +159,7 @@ public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
159159
buffer.sizeCopied = 0;
160160
}
161161
}
162-
162+
163163
/* -------------------------------------------------------- */
164164
/* Implementation */
165165
public AbstractCursor() {
@@ -204,7 +204,7 @@ public final boolean moveToPosition(int position) {
204204

205205
return result;
206206
}
207-
207+
208208
/**
209209
* Copy data from cursor to CursorWindow
210210
* @param position start position of data
@@ -388,7 +388,7 @@ public boolean update(int columnIndex, Object obj) {
388388

389389
/**
390390
* Returns <code>true</code> if there are pending updates that have not yet been committed.
391-
*
391+
*
392392
* @return <code>true</code> if there are pending updates that have not yet been committed.
393393
* @hide
394394
* @deprecated
@@ -435,26 +435,26 @@ public void unregisterContentObserver(ContentObserver observer) {
435435
mContentObservable.unregisterObserver(observer);
436436
}
437437
}
438-
438+
439439
/**
440440
* This is hidden until the data set change model has been re-evaluated.
441441
* @hide
442442
*/
443443
protected void notifyDataSetChange() {
444444
mDataSetObservable.notifyChanged();
445445
}
446-
446+
447447
/**
448448
* This is hidden until the data set change model has been re-evaluated.
449449
* @hide
450450
*/
451451
protected DataSetObservable getDataSetObservable() {
452452
return mDataSetObservable;
453-
453+
454454
}
455455
public void registerDataSetObserver(DataSetObserver observer) {
456456
mDataSetObservable.registerObserver(observer);
457-
457+
458458
}
459459

460460
public void unregisterDataSetObserver(DataSetObserver observer) {

android-database-sqlcipher/src/main/java/net/sqlcipher/AbstractWindowedCursor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ public String getString(int columnIndex)
5050

5151
return mWindow.getString(mPos, columnIndex);
5252
}
53-
53+
5454
@Override
5555
public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer)
5656
{
5757
checkPosition();
58-
58+
5959
synchronized(mUpdatedRows) {
6060
if (isFieldUpdated(columnIndex)) {
6161
super.copyStringToBuffer(columnIndex, buffer);
6262
}
6363
}
64-
64+
6565
mWindow.copyStringToBuffer(mPos, columnIndex, buffer);
6666
}
6767

@@ -220,7 +220,7 @@ public int getType(int columnIndex) {
220220
protected void checkPosition()
221221
{
222222
super.checkPosition();
223-
223+
224224
if (mWindow == null) {
225225
throw new StaleDataException("Access closed cursor");
226226
}
@@ -230,7 +230,7 @@ protected void checkPosition()
230230
public CursorWindow getWindow() {
231231
return mWindow;
232232
}
233-
233+
234234
/**
235235
* Set a new cursor window to cursor, usually set a remote cursor window
236236
* @param window cursor window
@@ -241,7 +241,7 @@ public void setWindow(CursorWindow window) {
241241
}
242242
mWindow = window;
243243
}
244-
244+
245245
public boolean hasWindow() {
246246
return mWindow != null;
247247
}

0 commit comments

Comments
 (0)