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

Commit 35349352 authored by Zoltan Szatmary-Ban's avatar Zoltan Szatmary-Ban
Browse files

Leave SettingsProvider running if cloning of a setting fails

Cloning of settings to managed profiles could fail due to security restrictions. This caused
Settings app crash. Instead the exception is now caught inside SettingsProvider, logged,
and we leave the app running.

Bug:17450158
Change-Id: I7525d634e57701db304117f4b2035faf53977836
parent c727fb1f
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -789,8 +789,15 @@ public class SettingsProvider extends ContentProvider {
                            Slog.v(TAG, "putting to additional user "
                                    + mManagedProfiles.get(i).id);
                        }
                        try {
                            insertForUser(Settings.Secure.CONTENT_URI, values,
                                    mManagedProfiles.get(i).id);
                        } catch (SecurityException e) {
                            // Temporary fix, see b/17450158
                            Slog.w(TAG, "Cannot clone request '" + request + "' with value '"
                                    + newValue + "' to managed profile (id "
                                    + mManagedProfiles.get(i).id + ")", e);
                        }
                    }
                } finally {
                    Binder.restoreCallingIdentity(token);