1 /* 2 * Copyright (C) 2022 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 package com.android.keyguard 17 18 import android.content.Context 19 import android.util.AttributeSet 20 import android.view.accessibility.AccessibilityNodeInfo 21 import android.widget.LinearLayout 22 import androidx.core.view.accessibility.AccessibilityNodeInfoCompat 23 import com.android.systemui.res.R 24 25 /** 26 * Custom View for the multi-user switcher pull-down menu anchor 27 */ 28 class KeyguardUserSwitcherAnchor @JvmOverloads constructor( 29 context: Context, 30 attrs: AttributeSet? = null 31 ) : LinearLayout(context, attrs) { 32 createAccessibilityNodeInfonull33 override fun createAccessibilityNodeInfo(): AccessibilityNodeInfo { 34 val info = super.createAccessibilityNodeInfo() 35 AccessibilityNodeInfoCompat.wrap(info).roleDescription = 36 context.getString(R.string.accessibility_multi_user_list_switcher) 37 return info 38 } 39 } 40