Merge "Fix more things that CloseGuard found."
This commit is contained in:
committed by
Android (Google) Code Review
commit
c5f99f39c6
@@ -7327,16 +7327,22 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
pw.println(" ");
|
||||
pw.println("Package warning messages:");
|
||||
File fname = getSettingsProblemFile();
|
||||
FileInputStream in;
|
||||
FileInputStream in = null;
|
||||
try {
|
||||
in = new FileInputStream(fname);
|
||||
int avail = in.available();
|
||||
byte[] data = new byte[avail];
|
||||
in.read(data);
|
||||
pw.print(new String(data));
|
||||
in.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (IOException e) {
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -799,8 +799,9 @@ public class ProcessStats {
|
||||
}
|
||||
|
||||
private String readFile(String file, char endChar) {
|
||||
FileInputStream is = null;
|
||||
try {
|
||||
FileInputStream is = new FileInputStream(file);
|
||||
is = new FileInputStream(file);
|
||||
int len = is.read(mBuffer);
|
||||
is.close();
|
||||
|
||||
@@ -815,6 +816,13 @@ public class ProcessStats {
|
||||
}
|
||||
} catch (java.io.FileNotFoundException e) {
|
||||
} catch (java.io.IOException e) {
|
||||
} finally {
|
||||
if (is != null) {
|
||||
try {
|
||||
is.close();
|
||||
} catch (java.io.IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -841,4 +849,3 @@ public class ProcessStats {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user