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

Commit c5f99f39 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Android (Google) Code Review
Browse files

Merge "Fix more things that CloseGuard found."

parents ba22d21c 6689ac8a
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 {
        }
    }
}