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.server.wm; 18 19 import android.annotation.SystemApi; 20 import android.app.ActivityOptions; 21 import android.content.Intent; 22 23 24 /** 25 * A wrapper over {@link com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptResult}. 26 * 27 * @hide 28 */ 29 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) 30 public final class ActivityInterceptResultWrapper { 31 private final ActivityInterceptorCallback.ActivityInterceptResult mActivityInterceptorInfo; 32 ActivityInterceptResultWrapper( ActivityInterceptorCallback.ActivityInterceptResult interceptorInfo)33 private ActivityInterceptResultWrapper( 34 ActivityInterceptorCallback.ActivityInterceptResult interceptorInfo) { 35 mActivityInterceptorInfo = interceptorInfo; 36 } 37 38 /** 39 * Creates an instance of {@link ActivityInterceptResultWrapper}. 40 */ create(Intent intent, ActivityOptions activityOptions)41 public static ActivityInterceptResultWrapper create(Intent intent, 42 ActivityOptions activityOptions) { 43 return new ActivityInterceptResultWrapper( 44 new ActivityInterceptorCallback.ActivityInterceptResult(intent, activityOptions)); 45 } 46 47 /** 48 * @hide 49 */ getInterceptResult()50 public ActivityInterceptorCallback.ActivityInterceptResult getInterceptResult() { 51 return mActivityInterceptorInfo; 52 } 53 } 54