Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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; |
| 18 | |
dooyoung.hwang | b647984 | 2016-08-31 14:15:22 +0900 | [diff] [blame] | 19 | import android.app.ActivityThread; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 20 | import android.app.Application; |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 21 | import android.content.BroadcastReceiver; |
| 22 | import android.content.Context; |
| 23 | import android.content.Intent; |
| 24 | import android.content.IntentFilter; |
dooyoung.hwang | b647984 | 2016-08-31 14:15:22 +0900 | [diff] [blame] | 25 | import android.content.pm.ApplicationInfo; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 26 | import android.content.res.Configuration; |
Beverly | 97b8ce1 | 2019-02-01 16:55:48 -0500 | [diff] [blame] | 27 | import android.os.Handler; |
| 28 | import android.os.Looper; |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 29 | import android.os.Process; |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 30 | import android.os.SystemProperties; |
Fyodor Kupolov | f359135 | 2017-06-23 18:20:40 -0700 | [diff] [blame] | 31 | import android.os.Trace; |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 32 | import android.os.UserHandle; |
Jason Monk | 421a941 | 2017-02-06 09:15:21 -0800 | [diff] [blame] | 33 | import android.util.ArraySet; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 34 | import android.util.Log; |
Beverly | 70dcd00 | 2018-03-29 17:09:16 -0400 | [diff] [blame] | 35 | import android.util.TimingsTraceLog; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 36 | |
Jason Monk | 86bc331 | 2016-08-16 13:17:56 -0400 | [diff] [blame] | 37 | import com.android.systemui.plugins.OverlayPlugin; |
| 38 | import com.android.systemui.plugins.PluginListener; |
Tony Wickham | 023cb19 | 2018-09-13 15:23:04 -0700 | [diff] [blame] | 39 | import com.android.systemui.shared.plugins.PluginManager; |
Beverly | 1488f69 | 2019-06-07 09:32:46 -0400 | [diff] [blame] | 40 | import com.android.systemui.statusbar.phone.DozeParameters; |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 41 | import com.android.systemui.statusbar.phone.StatusBar; |
Lucas Dupin | 1a8588d | 2018-08-21 12:18:47 -0700 | [diff] [blame] | 42 | import com.android.systemui.statusbar.phone.StatusBarWindowController; |
Dan Sandler | 8e032e1 | 2017-01-25 13:41:38 -0500 | [diff] [blame] | 43 | import com.android.systemui.util.NotificationChannels; |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 44 | |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 45 | import java.util.HashMap; |
| 46 | import java.util.Map; |
| 47 | |
| 48 | /** |
| 49 | * Application class for SystemUI. |
| 50 | */ |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 51 | public class SystemUIApplication extends Application implements SysUiServiceProvider { |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 52 | |
Dan Sandler | dc2ddd7 | 2018-01-24 16:09:53 -0500 | [diff] [blame] | 53 | public static final String TAG = "SystemUIService"; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 54 | private static final boolean DEBUG = false; |
| 55 | |
| 56 | /** |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 57 | * Hold a reference on the stuff we start. |
| 58 | */ |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 59 | private SystemUI[] mServices; |
Jorim Jaggi | 3beffdf | 2014-04-03 17:37:37 +0200 | [diff] [blame] | 60 | private boolean mServicesStarted; |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 61 | private boolean mBootCompleted; |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 62 | private final Map<Class<?>, Object> mComponents = new HashMap<>(); |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 63 | private ContextAvailableCallback mContextAvailableCallback; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 64 | |
Adrian Roos | 070a0b6 | 2014-04-10 23:25:03 +0200 | [diff] [blame] | 65 | @Override |
| 66 | public void onCreate() { |
| 67 | super.onCreate(); |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 68 | // This line is used to setup Dagger's dependency injection and should be kept at the |
| 69 | // top of this method. |
| 70 | mContextAvailableCallback.onContextAvailable(this); |
| 71 | |
Adrian Roos | 070a0b6 | 2014-04-10 23:25:03 +0200 | [diff] [blame] | 72 | // Set the application theme that is inherited by all services. Note that setting the |
| 73 | // application theme in the manifest does only work for activities. Keep this in sync with |
| 74 | // the theme set there. |
Lucas Dupin | e17ce52 | 2017-07-17 15:45:06 -0700 | [diff] [blame] | 75 | setTheme(R.style.Theme_SystemUI); |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 76 | |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 77 | if (Process.myUserHandle().equals(UserHandle.SYSTEM)) { |
Beverly | 6ea063e | 2018-04-19 10:27:06 -0400 | [diff] [blame] | 78 | IntentFilter bootCompletedFilter = new IntentFilter(Intent.ACTION_BOOT_COMPLETED); |
| 79 | bootCompletedFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 80 | registerReceiver(new BroadcastReceiver() { |
| 81 | @Override |
| 82 | public void onReceive(Context context, Intent intent) { |
| 83 | if (mBootCompleted) return; |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 84 | |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 85 | if (DEBUG) Log.v(TAG, "BOOT_COMPLETED received"); |
| 86 | unregisterReceiver(this); |
| 87 | mBootCompleted = true; |
| 88 | if (mServicesStarted) { |
| 89 | final int N = mServices.length; |
| 90 | for (int i = 0; i < N; i++) { |
| 91 | mServices[i].onBootCompleted(); |
| 92 | } |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 93 | } |
Beverly | 70dcd00 | 2018-03-29 17:09:16 -0400 | [diff] [blame] | 94 | |
Beverly | 6ea063e | 2018-04-19 10:27:06 -0400 | [diff] [blame] | 95 | |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 96 | } |
Beverly | 6ea063e | 2018-04-19 10:27:06 -0400 | [diff] [blame] | 97 | }, bootCompletedFilter); |
| 98 | |
| 99 | IntentFilter localeChangedFilter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED); |
| 100 | registerReceiver(new BroadcastReceiver() { |
| 101 | @Override |
| 102 | public void onReceive(Context context, Intent intent) { |
| 103 | if (Intent.ACTION_LOCALE_CHANGED.equals(intent.getAction())) { |
| 104 | if (!mBootCompleted) return; |
| 105 | // Update names of SystemUi notification channels |
| 106 | NotificationChannels.createAll(context); |
| 107 | } |
| 108 | } |
| 109 | }, localeChangedFilter); |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 110 | } else { |
dooyoung.hwang | b647984 | 2016-08-31 14:15:22 +0900 | [diff] [blame] | 111 | // We don't need to startServices for sub-process that is doing some tasks. |
| 112 | // (screenshots, sweetsweetdesserts or tuner ..) |
| 113 | String processName = ActivityThread.currentProcessName(); |
| 114 | ApplicationInfo info = getApplicationInfo(); |
| 115 | if (processName != null && processName.startsWith(info.processName + ":")) { |
| 116 | return; |
| 117 | } |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 118 | // For a secondary user, boot-completed will never be called because it has already |
| 119 | // been broadcasted on startup for the primary SystemUI process. Instead, for |
| 120 | // components which require the SystemUI component to be initialized per-user, we |
| 121 | // start those components now for the current non-system user. |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 122 | startSecondaryUserServicesIfNeeded(); |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 123 | } |
Adrian Roos | 070a0b6 | 2014-04-10 23:25:03 +0200 | [diff] [blame] | 124 | } |
| 125 | |
Jorim Jaggi | 3beffdf | 2014-04-03 17:37:37 +0200 | [diff] [blame] | 126 | /** |
| 127 | * Makes sure that all the SystemUI services are running. If they are already running, this is a |
| 128 | * no-op. This is needed to conditinally start all the services, as we only need to have it in |
| 129 | * the main process. |
Jorim Jaggi | 3beffdf | 2014-04-03 17:37:37 +0200 | [diff] [blame] | 130 | * <p>This method must only be called from the main thread.</p> |
| 131 | */ |
Jason Monk | be3235a | 2017-04-05 09:29:53 -0400 | [diff] [blame] | 132 | |
Jorim Jaggi | 3beffdf | 2014-04-03 17:37:37 +0200 | [diff] [blame] | 133 | public void startServicesIfNeeded() { |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 134 | String[] names = getResources().getStringArray(R.array.config_systemUIServiceComponents); |
| 135 | startServicesIfNeeded(names); |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 136 | } |
| 137 | |
Winson | 3c2c34b | 2016-04-04 17:47:41 -0700 | [diff] [blame] | 138 | /** |
| 139 | * Ensures that all the Secondary user SystemUI services are running. If they are already |
| 140 | * running, this is a no-op. This is needed to conditinally start all the services, as we only |
| 141 | * need to have it in the main process. |
Winson | 3c2c34b | 2016-04-04 17:47:41 -0700 | [diff] [blame] | 142 | * <p>This method must only be called from the main thread.</p> |
| 143 | */ |
| 144 | void startSecondaryUserServicesIfNeeded() { |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 145 | String[] names = |
| 146 | getResources().getStringArray(R.array.config_systemUIServiceComponentsPerUser); |
| 147 | startServicesIfNeeded(names); |
Winson | 3c2c34b | 2016-04-04 17:47:41 -0700 | [diff] [blame] | 148 | } |
| 149 | |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 150 | private void startServicesIfNeeded(String[] services) { |
Jorim Jaggi | 3beffdf | 2014-04-03 17:37:37 +0200 | [diff] [blame] | 151 | if (mServicesStarted) { |
| 152 | return; |
| 153 | } |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 154 | mServices = new SystemUI[services.length]; |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 155 | |
| 156 | if (!mBootCompleted) { |
| 157 | // check to see if maybe it was already completed long before we began |
| 158 | // see ActivityManagerService.finishBooting() |
| 159 | if ("1".equals(SystemProperties.get("sys.boot_completed"))) { |
| 160 | mBootCompleted = true; |
| 161 | if (DEBUG) Log.v(TAG, "BOOT_COMPLETED was already sent"); |
| 162 | } |
| 163 | } |
| 164 | |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 165 | Log.v(TAG, "Starting SystemUI services for user " + |
| 166 | Process.myUserHandle().getIdentifier() + "."); |
Fyodor Kupolov | 6e3461b | 2017-08-10 17:00:43 -0700 | [diff] [blame] | 167 | TimingsTraceLog log = new TimingsTraceLog("SystemUIBootTiming", |
Fyodor Kupolov | f359135 | 2017-06-23 18:20:40 -0700 | [diff] [blame] | 168 | Trace.TRACE_TAG_APP); |
| 169 | log.traceBegin("StartServices"); |
Winson | fe67aba | 2015-09-22 14:04:46 -0700 | [diff] [blame] | 170 | final int N = services.length; |
Jason Monk | 421a941 | 2017-02-06 09:15:21 -0800 | [diff] [blame] | 171 | for (int i = 0; i < N; i++) { |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 172 | String clsName = services[i]; |
| 173 | if (DEBUG) Log.d(TAG, "loading: " + clsName); |
| 174 | log.traceBegin("StartServices" + clsName); |
Fyodor Kupolov | f359135 | 2017-06-23 18:20:40 -0700 | [diff] [blame] | 175 | long ti = System.currentTimeMillis(); |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 176 | Class cls; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 177 | try { |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 178 | cls = Class.forName(clsName); |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 179 | Object o = cls.newInstance(); |
| 180 | if (o instanceof SystemUI.Injector) { |
| 181 | o = ((SystemUI.Injector) o).apply(this); |
| 182 | } |
| 183 | mServices[i] = (SystemUI) o; |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 184 | } catch(ClassNotFoundException ex){ |
| 185 | throw new RuntimeException(ex); |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 186 | } catch (IllegalAccessException ex) { |
| 187 | throw new RuntimeException(ex); |
| 188 | } catch (InstantiationException ex) { |
| 189 | throw new RuntimeException(ex); |
| 190 | } |
Muyuan Li | 94ce94e | 2016-02-24 16:20:54 -0800 | [diff] [blame] | 191 | |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 192 | mServices[i].mContext = this; |
| 193 | mServices[i].mComponents = mComponents; |
| 194 | if (DEBUG) Log.d(TAG, "running: " + mServices[i]); |
| 195 | mServices[i].start(); |
Fyodor Kupolov | f359135 | 2017-06-23 18:20:40 -0700 | [diff] [blame] | 196 | log.traceEnd(); |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 197 | |
Fyodor Kupolov | f359135 | 2017-06-23 18:20:40 -0700 | [diff] [blame] | 198 | // Warn if initialization of component takes too long |
| 199 | ti = System.currentTimeMillis() - ti; |
| 200 | if (ti > 1000) { |
yoshiki iguchi | 61b3708 | 2017-11-29 16:46:32 +0900 | [diff] [blame] | 201 | Log.w(TAG, "Initialization of " + cls.getName() + " took " + ti + " ms"); |
Fyodor Kupolov | f359135 | 2017-06-23 18:20:40 -0700 | [diff] [blame] | 202 | } |
Dan Sandler | dc5f16b | 2014-04-22 11:51:42 -0400 | [diff] [blame] | 203 | if (mBootCompleted) { |
| 204 | mServices[i].onBootCompleted(); |
| 205 | } |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 206 | } |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 207 | Dependency.get(InitController.class).executePostInitTasks(); |
Fyodor Kupolov | f359135 | 2017-06-23 18:20:40 -0700 | [diff] [blame] | 208 | log.traceEnd(); |
Beverly | 97b8ce1 | 2019-02-01 16:55:48 -0500 | [diff] [blame] | 209 | final Handler mainHandler = new Handler(Looper.getMainLooper()); |
Jason Monk | 5bec68f | 2017-02-08 20:45:10 -0800 | [diff] [blame] | 210 | Dependency.get(PluginManager.class).addPluginListener( |
Jason Monk | 86bc331 | 2016-08-16 13:17:56 -0400 | [diff] [blame] | 211 | new PluginListener<OverlayPlugin>() { |
beverlyt | f9dfd23 | 2019-05-06 12:14:22 -0700 | [diff] [blame] | 212 | private ArraySet<OverlayPlugin> mOverlays = new ArraySet<>(); |
Jason Monk | 421a941 | 2017-02-06 09:15:21 -0800 | [diff] [blame] | 213 | |
| 214 | @Override |
| 215 | public void onPluginConnected(OverlayPlugin plugin, Context pluginContext) { |
Beverly | 97b8ce1 | 2019-02-01 16:55:48 -0500 | [diff] [blame] | 216 | mainHandler.post(new Runnable() { |
| 217 | @Override |
| 218 | public void run() { |
| 219 | StatusBar statusBar = getComponent(StatusBar.class); |
| 220 | if (statusBar != null) { |
| 221 | plugin.setup(statusBar.getStatusBarWindow(), |
Beverly | 1488f69 | 2019-06-07 09:32:46 -0400 | [diff] [blame] | 222 | statusBar.getNavigationBarView(), new Callback(plugin), |
| 223 | DozeParameters.getInstance(getBaseContext())); |
Beverly | 97b8ce1 | 2019-02-01 16:55:48 -0500 | [diff] [blame] | 224 | } |
| 225 | } |
| 226 | }); |
Jason Monk | 421a941 | 2017-02-06 09:15:21 -0800 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | @Override |
| 230 | public void onPluginDisconnected(OverlayPlugin plugin) { |
Beverly | 97b8ce1 | 2019-02-01 16:55:48 -0500 | [diff] [blame] | 231 | mainHandler.post(new Runnable() { |
| 232 | @Override |
| 233 | public void run() { |
| 234 | mOverlays.remove(plugin); |
| 235 | Dependency.get(StatusBarWindowController.class).setForcePluginOpen( |
| 236 | mOverlays.size() != 0); |
| 237 | } |
| 238 | }); |
Jason Monk | 421a941 | 2017-02-06 09:15:21 -0800 | [diff] [blame] | 239 | } |
beverlyt | f9dfd23 | 2019-05-06 12:14:22 -0700 | [diff] [blame] | 240 | |
| 241 | class Callback implements OverlayPlugin.Callback { |
| 242 | private final OverlayPlugin mPlugin; |
| 243 | |
| 244 | Callback(OverlayPlugin plugin) { |
| 245 | mPlugin = plugin; |
| 246 | } |
| 247 | |
| 248 | @Override |
| 249 | public void onHoldStatusBarOpenChange() { |
| 250 | if (mPlugin.holdStatusBarOpen()) { |
| 251 | mOverlays.add(mPlugin); |
| 252 | } else { |
| 253 | mOverlays.remove(mPlugin); |
| 254 | } |
| 255 | mainHandler.post(new Runnable() { |
| 256 | @Override |
| 257 | public void run() { |
| 258 | Dependency.get(StatusBarWindowController.class) |
| 259 | .setStateListener(b -> mOverlays.forEach( |
| 260 | o -> o.setCollapseDesired(b))); |
| 261 | Dependency.get(StatusBarWindowController.class) |
| 262 | .setForcePluginOpen(mOverlays.size() != 0); |
| 263 | } |
| 264 | }); |
| 265 | } |
| 266 | } |
Jason Monk | 5bec68f | 2017-02-08 20:45:10 -0800 | [diff] [blame] | 267 | }, OverlayPlugin.class, true /* Allow multiple plugins */); |
Jason Monk | 86bc331 | 2016-08-16 13:17:56 -0400 | [diff] [blame] | 268 | |
Jorim Jaggi | 3beffdf | 2014-04-03 17:37:37 +0200 | [diff] [blame] | 269 | mServicesStarted = true; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | @Override |
| 273 | public void onConfigurationChanged(Configuration newConfig) { |
Jorim Jaggi | 3beffdf | 2014-04-03 17:37:37 +0200 | [diff] [blame] | 274 | if (mServicesStarted) { |
| 275 | int len = mServices.length; |
| 276 | for (int i = 0; i < len; i++) { |
Winson | 94a1485 | 2015-09-23 12:44:33 -0700 | [diff] [blame] | 277 | if (mServices[i] != null) { |
| 278 | mServices[i].onConfigurationChanged(newConfig); |
| 279 | } |
Jorim Jaggi | 3beffdf | 2014-04-03 17:37:37 +0200 | [diff] [blame] | 280 | } |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 281 | } |
| 282 | } |
| 283 | |
| 284 | @SuppressWarnings("unchecked") |
| 285 | public <T> T getComponent(Class<T> interfaceType) { |
| 286 | return (T) mComponents.get(interfaceType); |
| 287 | } |
| 288 | |
| 289 | public SystemUI[] getServices() { |
| 290 | return mServices; |
| 291 | } |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 292 | |
| 293 | void setContextAvailableCallback(ContextAvailableCallback callback) { |
| 294 | mContextAvailableCallback = callback; |
| 295 | } |
| 296 | |
| 297 | interface ContextAvailableCallback { |
| 298 | void onContextAvailable(Context context); |
| 299 | } |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 300 | } |