From 2de92474a79a47502a6f2a5805a05e147848de7d Mon Sep 17 00:00:00 2001 From: Robert Horvath Date: Fri, 13 Mar 2020 11:41:50 +0100 Subject: Add user management APIs to TvSystem To be used for profile management applications. These APIs mostly just forward calls to hidden system APIs. The #createManagedProfile method additionally modifies the passed in list to make sure disallowed packages are not installed for the new profile, and required packages are. All APIs operate on the user that owns the passed in context. Bug: 149465312 Test: m Test: Call method from support library in sample app Change-Id: I0b96916071e1facdf4e01dc4936580e7daf44375 (cherry picked from commit 39f53e794161f311aeea5df13b0e9dfd0b20d0ea) --- api/current.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'api') diff --git a/api/current.txt b/api/current.txt index fa68a6a..bc42215 100644 --- a/api/current.txt +++ b/api/current.txt @@ -27,3 +27,28 @@ package com.android.libraries.tv.tvsystem.display { } +package com.android.libraries.tv.tvsystem.user { + + public interface ITvUserManager { + method @Nullable public android.os.UserHandle createManagedProfile(@NonNull String, @Nullable String[]) throws android.os.UserManager.UserOperationException; + method @Nullable public android.graphics.Bitmap getUserIcon(); + method @NonNull public String getUserName(); + method @NonNull public java.util.List getUserProfiles(boolean); + method public boolean isManagedProfile(); + method public void setUserIcon(@NonNull android.graphics.Bitmap); + method public void setUserName(@Nullable String); + } + + public final class TvUserManager implements com.android.libraries.tv.tvsystem.user.ITvUserManager { + ctor public TvUserManager(android.content.Context); + method public android.os.UserHandle createManagedProfile(@NonNull String, @Nullable String[]); + method @Nullable public android.graphics.Bitmap getUserIcon(); + method @NonNull public String getUserName(); + method @NonNull public java.util.List getUserProfiles(boolean); + method public boolean isManagedProfile(); + method public void setUserIcon(@NonNull android.graphics.Bitmap); + method public void setUserName(@Nullable String); + } + +} + -- cgit v1.2.3