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

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

Merge "TextClock registerContentObserver with UserHandle"

parents 290606d6 ea05bd56
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -610,8 +610,16 @@ public class TextClock extends TextView {
                resolver.registerContentObserver(uri, true,
                        mFormatChangeObserver, UserHandle.USER_ALL);
            } else {
                // UserHandle.myUserId() is needed. This class is supported by the
                // remote views mechanism and as a part of that the remote views
                // can be inflated by a context for another user without the app
                // having interact users permission - just for loading resources.
                // For example, when adding widgets from a managed profile to the
                // home screen. Therefore, we register the ContentObserver with the user
                // the app is running (e.g. the launcher) and not the user of the
                // context (e.g. the widget's profile).
                resolver.registerContentObserver(uri, true,
                        mFormatChangeObserver);
                        mFormatChangeObserver, UserHandle.myUserId());
            }
        }
    }