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

Commit aab8aebe authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Android (Google) Code Review
Browse files

Merge "Add multi-user support to Controls"

parents c055ea0d 7988bd46
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -646,6 +646,7 @@
                  android:label="Controls Providers"
                  android:theme="@style/Theme.SystemUI"
                  android:exported="true"
                  android:showForAllUsers="true"
                  android:excludeFromRecents="true"
                  android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
                  android:visibleToInstantApps="true">
@@ -655,6 +656,7 @@
                  android:parentActivityName=".controls.management.ControlsProviderSelectorActivity"
                  android:theme="@style/Theme.SystemUI"
                  android:excludeFromRecents="true"
                  android:showForAllUsers="true"
                  android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
                  android:visibleToInstantApps="true">
        </activity>
+5 −1
Original line number Diff line number Diff line
@@ -18,4 +18,8 @@ package com.android.systemui.controls

import android.service.controls.Control

data class ControlStatus(val control: Control, val favorite: Boolean, val removed: Boolean = false)
 No newline at end of file
data class ControlStatus(
    val control: Control,
    val favorite: Boolean,
    val removed: Boolean = false
)
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import com.android.settingslib.applications.DefaultAppInfo

class ControlsServiceInfo(
    context: Context,
    serviceInfo: ServiceInfo
    val serviceInfo: ServiceInfo
) : DefaultAppInfo(
    context,
    context.packageManager,
+25 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.controls

import android.os.UserHandle

interface UserAwareController {

    fun changeUser(newUser: UserHandle) {}
    val currentUserId: Int
}
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -19,8 +19,9 @@ package com.android.systemui.controls.controller
import android.content.ComponentName
import android.service.controls.Control
import android.service.controls.actions.ControlAction
import com.android.systemui.controls.UserAwareController

interface ControlsBindingController {
interface ControlsBindingController : UserAwareController {
    fun bindAndLoad(component: ComponentName, callback: (List<Control>) -> Unit)
    fun bindServices(components: List<ComponentName>)
    fun subscribe(controls: List<ControlInfo>)
Loading