• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
5  * except in compliance with the License. You may obtain a copy of the License at
6  *
7  *      http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the
10  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11  * KIND, either express or implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */
14 
15 package com.android.systemui.plugins;
16 
17 import android.app.PendingIntent;
18 import android.content.Intent;
19 
20 import com.android.systemui.plugins.annotations.ProvidesInterface;
21 
22 /**
23  * An interface to start activities. This is used as a callback from the views to
24  * {@link PhoneStatusBar} to allow custom handling for starting the activity, i.e. dismissing the
25  * Keyguard.
26  */
27 @ProvidesInterface(version = ActivityStarter.VERSION)
28 public interface ActivityStarter {
29     int VERSION = 1;
30 
startPendingIntentDismissingKeyguard(PendingIntent intent)31     void startPendingIntentDismissingKeyguard(PendingIntent intent);
startActivity(Intent intent, boolean dismissShade)32     void startActivity(Intent intent, boolean dismissShade);
startActivity(Intent intent, boolean onlyProvisioned, boolean dismissShade)33     void startActivity(Intent intent, boolean onlyProvisioned, boolean dismissShade);
startActivity(Intent intent, boolean dismissShade, Callback callback)34     void startActivity(Intent intent, boolean dismissShade, Callback callback);
postStartActivityDismissingKeyguard(Intent intent, int delay)35     void postStartActivityDismissingKeyguard(Intent intent, int delay);
postStartActivityDismissingKeyguard(PendingIntent intent)36     void postStartActivityDismissingKeyguard(PendingIntent intent);
postQSRunnableDismissingKeyguard(Runnable runnable)37     void postQSRunnableDismissingKeyguard(Runnable runnable);
38 
39     interface Callback {
onActivityStarted(int resultCode)40         void onActivityStarted(int resultCode);
41     }
42 }
43