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

Commit 385424f4 authored by Bryan's avatar Bryan
Browse files

Improve exception logging for system backup/restore

Make sure to log stack traces of unexpected exceptions
to allow us to better diagnose issues such as b/190023280

Change-Id: I29a32329f52b8346570148ed5abc34f3149aa0f9

Test: make
Bug: 190023280
Change-Id: Idd4e4968fe4c642b463149f98a7669a8733b37d7
parent 6f383b1b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public class AccountManagerBackupHelper extends BlobBackupHelper {
                }
            }
        } catch (Exception e) {
            Slog.e(TAG, "Unable to store payload " + key);
            Slog.e(TAG, "Unable to store payload " + key, e);
        }

        return new byte[0];
@@ -79,7 +79,7 @@ public class AccountManagerBackupHelper extends BlobBackupHelper {
                }
            }
        } catch (Exception e) {
            Slog.w(TAG, "Unable to restore key " + key);
            Slog.e(TAG, "Unable to restore key " + key, e);
        }
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ public class NotificationBackupHelper extends BlobBackupHelper {
                newPayload = nm.getBackupPayload(mUserId);
            } catch (Exception e) {
                // Treat as no data
                Slog.e(TAG, "Couldn't communicate with notification manager");
                Slog.e(TAG, "Couldn't communicate with notification manager", e);
                newPayload = null;
            }
        }
@@ -68,7 +68,7 @@ public class NotificationBackupHelper extends BlobBackupHelper {
                        ServiceManager.getService("notification"));
                nm.applyRestore(payload, mUserId);
            } catch (Exception e) {
                Slog.e(TAG, "Couldn't communicate with notification manager");
                Slog.e(TAG, "Couldn't communicate with notification manager", e);
            }
        }
    }
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class PermissionBackupHelper extends BlobBackupHelper {
                    Slog.w(TAG, "Unexpected backup key " + key);
            }
        } catch (Exception e) {
            Slog.e(TAG, "Unable to store payload " + key);
            Slog.e(TAG, "Unable to store payload " + key, e);
        }
        return null;
    }
@@ -79,7 +79,7 @@ public class PermissionBackupHelper extends BlobBackupHelper {
                    Slog.w(TAG, "Unexpected restore key " + key);
            }
        } catch (Exception e) {
            Slog.w(TAG, "Unable to restore key " + key);
            Slog.e(TAG, "Unable to restore key " + key, e);
        }
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ public class PreferredActivityBackupHelper extends BlobBackupHelper {
                    Slog.w(TAG, "Unexpected backup key " + key);
            }
        } catch (Exception e) {
            Slog.e(TAG, "Unable to store payload " + key);
            Slog.e(TAG, "Unable to store payload " + key, e);
        }
        return null;
    }
@@ -124,7 +124,7 @@ public class PreferredActivityBackupHelper extends BlobBackupHelper {
                    Slog.w(TAG, "Unexpected restore key " + key);
            }
        } catch (Exception e) {
            Slog.w(TAG, "Unable to restore key " + key);
            Slog.e(TAG, "Unable to restore key " + key, e);
        }
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public class SliceBackupHelper extends BlobBackupHelper {
                newPayload = sm.getBackupPayload(UserHandle.USER_SYSTEM);
            } catch (Exception e) {
                // Treat as no data
                Slog.e(TAG, "Couldn't communicate with slice manager");
                Slog.e(TAG, "Couldn't communicate with slice manager", e);
                newPayload = null;
            }
        }
@@ -66,7 +66,7 @@ public class SliceBackupHelper extends BlobBackupHelper {
                // TODO: http://b/22388012
                sm.applyRestore(payload, UserHandle.USER_SYSTEM);
            } catch (Exception e) {
                Slog.e(TAG, "Couldn't communicate with slice manager");
                Slog.e(TAG, "Couldn't communicate with slice manager", e);
            }
        }
    }