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

Commit a9583ff9 authored by Felipe Leme's avatar Felipe Leme
Browse files

Minor improvements on DevicePolicyManagerService.

- Replaced Log.x usage by Slog.x.
- Fixed some Slog.x(TAG, e, ...) on DPMS to use the non-varargs
  version.
- Other cosmetic improvements like fixing userId / userHandle names.

Test: m
Bug: 156263735
Change-Id: I94fac2014c20f78d9232af193480fe1bca4f3caf
parent 9c907184
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -79,16 +79,16 @@ public class CertificateMonitor {
            X509Certificate cert = parseCert(certBuffer);
            X509Certificate cert = parseCert(certBuffer);
            pemCert = Credentials.convertToPem(cert);
            pemCert = Credentials.convertToPem(cert);
        } catch (CertificateException | IOException ce) {
        } catch (CertificateException | IOException ce) {
            Slog.e(LOG_TAG, ce, "Problem converting cert");
            Slog.e(LOG_TAG, "Problem converting cert", ce);
            return null;
            return null;
        }
        }


        try (KeyChainConnection keyChainConnection = mInjector.keyChainBindAsUser(userHandle)) {
        try (KeyChainConnection keyChainConnection = mInjector.keyChainBindAsUser(userHandle)) {
            return keyChainConnection.getService().installCaCertificate(pemCert);
            return keyChainConnection.getService().installCaCertificate(pemCert);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            Slog.e(LOG_TAG, e, "installCaCertsToKeyChain(): ");
            Slog.e(LOG_TAG, "installCaCertsToKeyChain(): ", e);
        } catch (InterruptedException e1) {
        } catch (InterruptedException e1) {
            Slog.w(LOG_TAG, e1, "installCaCertsToKeyChain(): ");
            Slog.w(LOG_TAG, "installCaCertsToKeyChain(): ", e1);
            Thread.currentThread().interrupt();
            Thread.currentThread().interrupt();
        }
        }
        return null;
        return null;
@@ -100,9 +100,9 @@ public class CertificateMonitor {
                keyChainConnection.getService().deleteCaCertificate(aliases[i]);
                keyChainConnection.getService().deleteCaCertificate(aliases[i]);
            }
            }
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            Slog.e(LOG_TAG, e, "from CaCertUninstaller: ");
            Slog.e(LOG_TAG, "from CaCertUninstaller: ", e);
        } catch (InterruptedException ie) {
        } catch (InterruptedException ie) {
            Slog.w(LOG_TAG, ie, "CaCertUninstaller: ");
            Slog.w(LOG_TAG, "CaCertUninstaller: ", ie);
            Thread.currentThread().interrupt();
            Thread.currentThread().interrupt();
        }
        }
    }
    }
+134 −160

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Original line Diff line number Diff line
@@ -207,7 +207,7 @@ public class RemoteBugreportManager {
            return true;
            return true;
        } catch (RemoteException re) {
        } catch (RemoteException re) {
            // should never happen
            // should never happen
            Slog.e(LOG_TAG, re, "Failed to make remote calls to start bugreportremote service");
            Slog.e(LOG_TAG, "Failed to make remote calls to start bugreportremote service", re);
            return false;
            return false;
        } finally {
        } finally {
            mInjector.binderRestoreCallingIdentity(callingIdentity);
            mInjector.binderRestoreCallingIdentity(callingIdentity);