1 /* 2 * Copyright (C) 2023 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.systemui.notetask 18 19 import android.os.Bundle 20 import androidx.activity.ComponentActivity 21 import com.android.systemui.keyguard.data.quickaffordance.KeyguardQuickAffordanceConfig 22 import javax.inject.Inject 23 24 /** 25 * An internal proxy activity that starts the notes role setting. 26 * 27 * This activity is introduced mainly for the error handling of the notes app lock screen shortcut 28 * picker, which only supports package + action but not extras. See 29 * [KeyguardQuickAffordanceConfig.PickerScreenState.Disabled.actionComponentName]. 30 */ 31 class LaunchNotesRoleSettingsTrampolineActivity 32 @Inject 33 constructor( 34 private val controller: NoteTaskController, 35 ) : ComponentActivity() { 36 onCreatenull37 override fun onCreate(savedInstanceState: Bundle?) { 38 super.onCreate(savedInstanceState) 39 40 val entryPoint = 41 if (intent?.action == ACTION_MANAGE_NOTES_ROLE_FROM_QUICK_AFFORDANCE) { 42 NoteTaskEntryPoint.QUICK_AFFORDANCE 43 } else { 44 null 45 } 46 controller.startNotesRoleSetting(this, entryPoint) 47 finish() 48 } 49 50 companion object { 51 const val ACTION_MANAGE_NOTES_ROLE_FROM_QUICK_AFFORDANCE = 52 "com.android.systemui.action.MANAGE_NOTES_ROLE_FROM_QUICK_AFFORDANCE" 53 } 54 } 55