1 /* 2 * Copyright (C) 2018 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.google.android.textclassifier; 18 19 /** 20 * Represents a template for an Android RemoteAction. 21 * 22 * @hide 23 */ 24 public final class RemoteActionTemplate { 25 /** Title shown for the action (see: RemoteAction.getTitle). */ 26 public final String titleWithoutEntity; 27 28 /** Title with entity for the action. */ 29 public final String titleWithEntity; 30 31 /** Description shown for the action (see: RemoteAction.getContentDescription). */ 32 public final String description; 33 34 /** 35 * Description shown for the action (see: RemoteAction.getContentDescription) when app name is 36 * available. Caller is expected to replace the placeholder by the name of the app that is going 37 * to handle the action. 38 */ 39 public final String descriptionWithAppName; 40 41 /** The action to set on the Intent (see: Intent.setAction). */ 42 public final String action; 43 44 /** The data to set on the Intent (see: Intent.setData). */ 45 public final String data; 46 47 /** The type to set on the Intent (see: Intent.setType). */ 48 public final String type; 49 50 /** Flags for launching the Intent (see: Intent.setFlags). */ 51 public final Integer flags; 52 53 /** Categories to set on the Intent (see: Intent.addCategory). */ 54 public final String[] category; 55 56 /** Explicit application package to set on the Intent (see: Intent.setPackage). */ 57 public final String packageName; 58 59 /** The list of all the extras to add to the Intent. */ 60 public final NamedVariant[] extras; 61 62 /** Private request code to use for the Intent. */ 63 public final Integer requestCode; 64 RemoteActionTemplate( String titleWithoutEntity, String titleWithEntity, String description, String descriptionWithAppName, String action, String data, String type, Integer flags, String[] category, String packageName, NamedVariant[] extras, Integer requestCode)65 public RemoteActionTemplate( 66 String titleWithoutEntity, 67 String titleWithEntity, 68 String description, 69 String descriptionWithAppName, 70 String action, 71 String data, 72 String type, 73 Integer flags, 74 String[] category, 75 String packageName, 76 NamedVariant[] extras, 77 Integer requestCode) { 78 this.titleWithoutEntity = titleWithoutEntity; 79 this.titleWithEntity = titleWithEntity; 80 this.description = description; 81 this.descriptionWithAppName = descriptionWithAppName; 82 this.action = action; 83 this.data = data; 84 this.type = type; 85 this.flags = flags; 86 this.category = category; 87 this.packageName = packageName; 88 this.extras = extras; 89 this.requestCode = requestCode; 90 } 91 } 92