Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6689ac8a authored by Brad Fitzpatrick's avatar Brad Fitzpatrick
Browse files

Fix more things that CloseGuard found.

Not terribly happy with how the code looks after, though.

Change-Id: I7bf5f78ef6c0ac82339a2e49488ca6e64d13c05e
parent c7bc3d09
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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)  {
                        }
                    }
                }
            }
        }
+9 −2
Original line number Diff line number Diff line
@@ -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 {
        }
    }
}