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

Commit 523c3b5c authored by TYM Tsai's avatar TYM Tsai
Browse files

Fix setting reset with mult-user

There is a system API to reset settings to the default value, the
API is user sensitive. But the user id is not used in the setting
provider, it only reset setting for the system user. Uses the
owning user ID instead to fix.

Bug: 383309016
Bug: 383211851
FLAG: EXEMPT TEST
Test: 1. create a new user
      2. atest SettingsProviderTest
Change-Id: I69a437620132c6ebcd6f38f0965af08ca0a2073c
parent d708a2bb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1869,7 +1869,7 @@ public class SettingsProvider extends ContentProvider {
                }
                }
                case MUTATION_OPERATION_RESET -> {
                case MUTATION_OPERATION_RESET -> {
                    return mSettingsRegistry.resetSettingsLocked(SETTINGS_TYPE_SECURE,
                    return mSettingsRegistry.resetSettingsLocked(SETTINGS_TYPE_SECURE,
                            UserHandle.USER_SYSTEM, callingPackage, mode, tag);
                            owningUserId, callingPackage, mode, tag);
                }
                }
            }
            }
        }
        }