Skip to content

Commit

Permalink
fix: 代码质量与规范调整
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahzzhang committed Mar 13, 2024
1 parent b558d67 commit fc2f16a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 0 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,10 @@ configurations {

dependencies {
implementation 'androidx.annotation:annotation:1.1.0'
// implementation files('libs/beacon-android-release-3.1.2-cover.jar')
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// implementation 'androidx.room:room-runtime:2.2.0'
// annotationProcessor 'androidx.room:room-compiler:2.2.0'

doclava 'com.google.doclava:doclava:1.0.6'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public final class NetworkChangeManager {

private volatile static INetworkChangeObservable sNetworkChangeObservable;
private static volatile INetworkChangeObservable sNetworkChangeObservable;

public static void install(Context context) {
if (null == context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void onReceive(Context context, Intent intent) {
mayChangeNetwork(appContext);
}
}, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
} catch (Exception e){
} catch (Exception e) {
DnsLog.w("network register failed " + e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private SQLiteDatabase getDb() {
try {
mDb = getWritableDatabase();
} catch (Exception e) {

DnsLog.e("get db error " + e);
}
}
return mDb;
Expand All @@ -54,7 +54,7 @@ private SQLiteDatabase getDb() {
public List<LookupCache> getAll() {
synchronized (mLock) {
ArrayList<LookupCache> lists = new ArrayList<>();
SQLiteDatabase db = null;
SQLiteDatabase db;
Cursor cursor = null;

try {
Expand All @@ -76,7 +76,8 @@ public List<LookupCache> getAll() {
if (cursor != null) {
cursor.close();
}
} catch (Exception ignored) {
} catch (Exception e) {
DnsLog.e("cursor close error " + e);
}
}
return lists;
Expand All @@ -100,7 +101,8 @@ public void insert(LookupCache lookupCache) {
if (db != null) {
try {
db.endTransaction();
} catch (Exception ignored) {
} catch (Exception e) {
DnsLog.e("db end transaction error " + e);
}
}
}
Expand Down Expand Up @@ -128,7 +130,8 @@ public void delete(String[] hosts) {
if (db != null) {
try {
db.endTransaction();
} catch (Exception ignored) {
} catch (Exception e) {
DnsLog.e("db end transaction error " + e);
}
}
}
Expand Down

0 comments on commit fc2f16a

Please sign in to comment.