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

Commit 62acb388 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Prevent fail to get device config while dumping package service" into sc-dev

parents 024f239d 1db5dd18
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -27803,13 +27803,23 @@ public class PackageManagerService extends IPackageManager.Stub
    }
    private static String getDefaultTimeouts() {
        return DeviceConfig.getString(DeviceConfig.NAMESPACE_PACKAGE_MANAGER_SERVICE,
        final long token = Binder.clearCallingIdentity();
        try {
            return DeviceConfig.getString(NAMESPACE_PACKAGE_MANAGER_SERVICE,
                    PROPERTY_INCFS_DEFAULT_TIMEOUTS, "");
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }
    private static String getKnownDigestersList() {
        return DeviceConfig.getString(DeviceConfig.NAMESPACE_PACKAGE_MANAGER_SERVICE,
        final long token = Binder.clearCallingIdentity();
        try {
            return DeviceConfig.getString(NAMESPACE_PACKAGE_MANAGER_SERVICE,
                    PROPERTY_KNOWN_DIGESTERS_LIST, "");
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }
    /**
+0 −4
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.server.power;
import android.annotation.DurationMillisLong;
import android.annotation.NonNull;
import android.content.Context;
import android.os.Binder;
import android.os.Environment;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
@@ -147,7 +146,6 @@ final class PreRebootLogger {
            return;
        }

        final long token = Binder.clearCallingIdentity();
        try {
            final File dumpFile = new File(dumpDir, serviceName);
            final ParcelFileDescriptor fd = ParcelFileDescriptor.open(dumpFile,
@@ -156,8 +154,6 @@ final class PreRebootLogger {
            binder.dump(fd.getFileDescriptor(), ArrayUtils.emptyArray(String.class));
        } catch (FileNotFoundException | RemoteException e) {
            Slog.e(TAG, String.format("Failed to dump %s service before reboot", serviceName), e);
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }
}