1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 
17 package com.android.libraries.tv.tvsystem.user;
18 
19 import android.accounts.AccountManagerCallback;
20 import android.accounts.AccountManagerFuture;
21 import android.annotation.NonNull;
22 import android.annotation.Nullable;
23 import android.app.Activity;
24 import android.graphics.Bitmap;
25 import android.os.Bundle;
26 import android.os.Handler;
27 import android.os.UserHandle;
28 import android.os.UserManager;
29 
30 import java.util.List;
31 
32 /**
33  * Provides access to hidden {@link android.os.UserManager} APIs.
34  * All methods here are user handle aware - they act on the user that owns the passed in Context.
35  */
36 public interface ITvUserManager {
37     @Nullable
createManagedProfile(@onNull String name, @Nullable String[] disallowedPackages)38     UserHandle createManagedProfile(@NonNull String name, @Nullable String[] disallowedPackages)
39             throws UserManager.UserOperationException;
40 
41     @NonNull
getUserProfiles(boolean enabledOnly)42     List<UserHandle> getUserProfiles(boolean enabledOnly);
43 
44     @NonNull
getUserName()45     String getUserName();
46 
setUserName(@ullable String name)47     void setUserName(@Nullable String name);
48 
49     @Nullable
getUserIcon()50     Bitmap getUserIcon();
51 
setUserIcon(@onNull Bitmap icon)52     void setUserIcon(@NonNull Bitmap icon);
53 
isManagedProfile()54     boolean isManagedProfile();
55 }
56