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

Commit afe23b81 authored by Li Li's avatar Li Li Committed by Android (Google) Code Review
Browse files

Merge "Freezer: check freeze binder ioctl"

parents 238f84fc 3a9b8aef
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -645,21 +645,25 @@ public final class CachedAppOptimizer {
            char state = (char) fr.read();
            char state = (char) fr.read();


            if (state == '1' || state == '0') {
            if (state == '1' || state == '0') {
                // Also check freezer binder ioctl
                getBinderFreezeInfo(Process.myPid());
                supported = true;
                supported = true;
            } else {
            } else {
                Slog.e(TAG_AM, "unexpected value in cgroup.freeze");
                Slog.e(TAG_AM, "unexpected value in cgroup.freeze");
            }
            }
        } catch (java.io.FileNotFoundException e) {
        } catch (java.io.FileNotFoundException e) {
            Slog.d(TAG_AM, "cgroup.freeze not present");
            Slog.w(TAG_AM, "cgroup.freeze not present");
        } catch (RuntimeException e) {
            Slog.w(TAG_AM, "unable to read freezer info");
        } catch (Exception e) {
        } catch (Exception e) {
            Slog.d(TAG_AM, "unable to read cgroup.freeze: " + e.toString());
            Slog.w(TAG_AM, "unable to read cgroup.freeze: " + e.toString());
        }
        }


        if (fr != null) {
        if (fr != null) {
            try {
            try {
                fr.close();
                fr.close();
            } catch (java.io.IOException e) {
            } catch (java.io.IOException e) {
                Slog.e(TAG_AM, "Exception closing freezer.killable: " + e.toString());
                Slog.e(TAG_AM, "Exception closing cgroup.freeze: " + e.toString());
            }
            }
        }
        }