blob: 05a6452d2e03b9c5e48a566357435ec6244090df [file] [log] [blame]
Sunny Goyal27835952017-01-13 12:15:53 -08001/*
2 * Copyright (C) 2017 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
17package com.android.launcher3;
18
Mike Schneidera79d4602023-03-03 15:58:06 +010019import static com.android.launcher3.util.FlagDebugUtils.appendFlag;
20import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange;
Tony Wickhamb4821882021-04-23 14:26:45 -070021import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
Sunny Goyal8c48d8b2019-01-25 15:10:18 -080022
Sunny Goyal7eff40f2018-04-11 15:30:46 -070023import static java.lang.annotation.RetentionPolicy.SOURCE;
24
Sunny Goyal27835952017-01-13 12:15:53 -080025import android.app.Activity;
26import android.content.Context;
27import android.content.ContextWrapper;
Sunny Goyal64a75aa2017-07-03 13:50:52 -070028import android.content.Intent;
Winson Chung1a77c3d2018-04-11 12:47:47 -070029import android.content.res.Configuration;
Yein Jo18446d02022-09-19 22:18:09 +000030import android.os.Bundle;
Mike Schneidera79d4602023-03-03 15:58:06 +010031import android.util.Log;
Jon Mirandacb582592023-04-19 15:40:04 -070032import android.view.View;
Yein Jo18446d02022-09-19 22:18:09 +000033import android.window.OnBackInvokedDispatcher;
Sunny Goyal27835952017-01-13 12:15:53 -080034
Winson Chungef528762019-09-06 12:05:52 -070035import androidx.annotation.IntDef;
36
Sunny Goyalfde55052018-02-01 14:46:13 -080037import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
Hyunyoung Songfc007472018-10-25 14:09:50 -070038import com.android.launcher3.logging.StatsLogManager;
Yein Jo18446d02022-09-19 22:18:09 +000039import com.android.launcher3.testing.TestLogging;
40import com.android.launcher3.testing.shared.TestProtocol;
Sunny Goyal8392c822017-06-20 10:03:56 -070041import com.android.launcher3.util.SystemUiController;
Sunny Goyal56863332019-05-22 14:13:53 -070042import com.android.launcher3.util.ViewCache;
Sunny Goyal54fa1102022-12-07 22:48:37 -080043import com.android.launcher3.views.ActivityContext;
Tony Wickhamb4821882021-04-23 14:26:45 -070044import com.android.launcher3.views.ScrimView;
Sunny Goyala535ae42017-02-27 10:07:13 -080045
Sunny Goyale43d00d2018-05-14 14:23:18 -070046import java.io.PrintWriter;
Sunny Goyal7eff40f2018-04-11 15:30:46 -070047import java.lang.annotation.Retention;
Sunny Goyalfde55052018-02-01 14:46:13 -080048import java.util.ArrayList;
Brian Isganitis099945b2022-01-31 18:15:00 -050049import java.util.List;
Mike Schneidera79d4602023-03-03 15:58:06 +010050import java.util.StringJoiner;
Sunny Goyalfde55052018-02-01 14:46:13 -080051
Samuel Fufaa579ddc2020-02-27 16:59:19 -080052/**
53 * Launcher BaseActivity
54 */
Sunny Goyal54fa1102022-12-07 22:48:37 -080055public abstract class BaseActivity extends Activity implements ActivityContext {
Sunny Goyal27835952017-01-13 12:15:53 -080056
Sunny Goyalfa395362019-12-11 10:00:47 -080057 private static final String TAG = "BaseActivity";
Mike Schneidera79d4602023-03-03 15:58:06 +010058 static final boolean DEBUG = false;
Sunny Goyalfa395362019-12-11 10:00:47 -080059
Sunny Goyal7eff40f2018-04-11 15:30:46 -070060 public static final int INVISIBLE_BY_STATE_HANDLER = 1 << 0;
61 public static final int INVISIBLE_BY_APP_TRANSITIONS = 1 << 1;
Sunny Goyal1c63c722018-06-05 16:00:34 -070062 public static final int INVISIBLE_BY_PENDING_FLAGS = 1 << 2;
63
64 // This is not treated as invisibility flag, but adds as a hint for an incomplete transition.
65 // When the wallpaper animation runs, it replaces this flag with a proper invisibility
66 // flag, INVISIBLE_BY_PENDING_FLAGS only for the duration of that animation.
67 public static final int PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION = 1 << 3;
68
69 private static final int INVISIBLE_FLAGS =
70 INVISIBLE_BY_STATE_HANDLER | INVISIBLE_BY_APP_TRANSITIONS | INVISIBLE_BY_PENDING_FLAGS;
71 public static final int STATE_HANDLER_INVISIBILITY_FLAGS =
72 INVISIBLE_BY_STATE_HANDLER | PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION;
Sunny Goyal7eff40f2018-04-11 15:30:46 -070073 public static final int INVISIBLE_ALL =
Sunny Goyal1c63c722018-06-05 16:00:34 -070074 INVISIBLE_FLAGS | PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION;
Sunny Goyal7eff40f2018-04-11 15:30:46 -070075
76 @Retention(SOURCE)
77 @IntDef(
78 flag = true,
Sunny Goyal1c63c722018-06-05 16:00:34 -070079 value = {INVISIBLE_BY_STATE_HANDLER, INVISIBLE_BY_APP_TRANSITIONS,
80 INVISIBLE_BY_PENDING_FLAGS, PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION})
Mike Schneidera79d4602023-03-03 15:58:06 +010081 public @interface InvisibilityFlags {
82 }
Sunny Goyal7eff40f2018-04-11 15:30:46 -070083
Sunny Goyalfde55052018-02-01 14:46:13 -080084 private final ArrayList<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>();
Winson Chung1a77c3d2018-04-11 12:47:47 -070085 private final ArrayList<MultiWindowModeChangedListener> mMultiWindowModeChangedListeners =
86 new ArrayList<>();
Sunny Goyalfde55052018-02-01 14:46:13 -080087
Sunny Goyal27835952017-01-13 12:15:53 -080088 protected DeviceProfile mDeviceProfile;
Sunny Goyal8392c822017-06-20 10:03:56 -070089 protected SystemUiController mSystemUiController;
Sunny Goyal977838b2022-06-27 13:15:41 -070090 private StatsLogManager mStatsLogManager;
Sunny Goyal27835952017-01-13 12:15:53 -080091
Sunny Goyal210e1742019-10-17 12:05:38 -070092
93 public static final int ACTIVITY_STATE_STARTED = 1 << 0;
94 public static final int ACTIVITY_STATE_RESUMED = 1 << 1;
95
Sunny Goyal3483c522018-04-12 11:23:33 -070096 /**
Sunny Goyal210e1742019-10-17 12:05:38 -070097 * State flags indicating that the activity has received one frame after resume, and was
98 * not immediately paused.
99 */
100 public static final int ACTIVITY_STATE_DEFERRED_RESUMED = 1 << 2;
101
102 public static final int ACTIVITY_STATE_WINDOW_FOCUSED = 1 << 3;
103
104 /**
105 * State flag indicating if the user is active or the activity when to background as a result
Sunny Goyal3483c522018-04-12 11:23:33 -0700106 * of user action.
Mike Schneidera79d4602023-03-03 15:58:06 +0100107 *
Sunny Goyal3483c522018-04-12 11:23:33 -0700108 * @see #isUserActive()
109 */
Sunny Goyal210e1742019-10-17 12:05:38 -0700110 public static final int ACTIVITY_STATE_USER_ACTIVE = 1 << 4;
111
112 /**
Winson Chung034ce6f2020-05-14 10:49:30 -0700113 * State flag indicating if the user will be active shortly.
114 */
115 public static final int ACTIVITY_STATE_USER_WILL_BE_ACTIVE = 1 << 5;
116
117 /**
Sunny Goyal210e1742019-10-17 12:05:38 -0700118 * State flag indicating that a state transition is in progress
119 */
Winson Chung034ce6f2020-05-14 10:49:30 -0700120 public static final int ACTIVITY_STATE_TRANSITION_ACTIVE = 1 << 6;
Sunny Goyal3483c522018-04-12 11:23:33 -0700121
122 @Retention(SOURCE)
123 @IntDef(
124 flag = true,
Sunny Goyal210e1742019-10-17 12:05:38 -0700125 value = {ACTIVITY_STATE_STARTED,
126 ACTIVITY_STATE_RESUMED,
127 ACTIVITY_STATE_DEFERRED_RESUMED,
128 ACTIVITY_STATE_WINDOW_FOCUSED,
129 ACTIVITY_STATE_USER_ACTIVE,
130 ACTIVITY_STATE_TRANSITION_ACTIVE})
Mike Schneidera79d4602023-03-03 15:58:06 +0100131 public @interface ActivityFlags {
132 }
133
134 /** Returns a human-readable string for the specified {@link ActivityFlags}. */
135 public static String getActivityStateString(@ActivityFlags int flags) {
136 StringJoiner result = new StringJoiner("|");
137 appendFlag(result, flags, ACTIVITY_STATE_STARTED, "state_started");
138 appendFlag(result, flags, ACTIVITY_STATE_RESUMED, "state_resumed");
139 appendFlag(result, flags, ACTIVITY_STATE_DEFERRED_RESUMED, "state_deferred_resumed");
140 appendFlag(result, flags, ACTIVITY_STATE_WINDOW_FOCUSED, "state_window_focused");
141 appendFlag(result, flags, ACTIVITY_STATE_USER_ACTIVE, "state_user_active");
142 appendFlag(result, flags, ACTIVITY_STATE_TRANSITION_ACTIVE, "state_transition_active");
143 return result.toString();
144 }
Sunny Goyal3483c522018-04-12 11:23:33 -0700145
146 @ActivityFlags
147 private int mActivityFlags;
Sunny Goyal7eff40f2018-04-11 15:30:46 -0700148
Winson Chung9800e732018-04-04 13:33:23 -0700149 // When the recents animation is running, the visibility of the Launcher is managed by the
150 // animation
Mike Schneidera79d4602023-03-03 15:58:06 +0100151 @InvisibilityFlags
152 private int mForceInvisible;
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800153
Sunny Goyal56863332019-05-22 14:13:53 -0700154 private final ViewCache mViewCache = new ViewCache();
155
Sunny Goyal59969372021-05-06 12:11:44 -0700156 @Override
Sunny Goyal56863332019-05-22 14:13:53 -0700157 public ViewCache getViewCache() {
158 return mViewCache;
159 }
160
Sunny Goyalfe8e4a92018-11-13 19:43:57 -0800161 @Override
Sunny Goyal27835952017-01-13 12:15:53 -0800162 public DeviceProfile getDeviceProfile() {
163 return mDeviceProfile;
164 }
165
Brian Isganitis099945b2022-01-31 18:15:00 -0500166 @Override
167 public List<OnDeviceProfileChangeListener> getOnDeviceProfileChangeListeners() {
168 return mDPChangeListeners;
169 }
170
thiruramc96873c2021-02-11 15:13:47 -0800171 /**
172 * Returns {@link StatsLogManager} for user event logging.
173 */
Sunny Goyal177785e2021-07-29 15:48:24 -0700174 @Override
thiruramc96873c2021-02-11 15:13:47 -0800175 public StatsLogManager getStatsLogManager() {
Hyunyoung Songfc007472018-10-25 14:09:50 -0700176 if (mStatsLogManager == null) {
Hyunyoung Song801f81f2020-06-19 02:58:53 -0700177 mStatsLogManager = StatsLogManager.newInstance(this);
Hyunyoung Songfc007472018-10-25 14:09:50 -0700178 }
179 return mStatsLogManager;
180 }
181
Sunny Goyal8392c822017-06-20 10:03:56 -0700182 public SystemUiController getSystemUiController() {
183 if (mSystemUiController == null) {
184 mSystemUiController = new SystemUiController(getWindow());
185 }
186 return mSystemUiController;
187 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700188
Tony Wickhamb4821882021-04-23 14:26:45 -0700189 public ScrimView getScrimView() {
190 return null;
191 }
192
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700193 @Override
194 public void onActivityResult(int requestCode, int resultCode, Intent data) {
195 super.onActivityResult(requestCode, resultCode, data);
196 }
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800197
198 @Override
Yein Jo18446d02022-09-19 22:18:09 +0000199 protected void onCreate(Bundle savedInstanceState) {
200 super.onCreate(savedInstanceState);
Fengjiang Lie884c2c2022-12-19 14:42:14 -0800201 registerBackDispatcher();
Yein Jo18446d02022-09-19 22:18:09 +0000202 }
203
204 @Override
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800205 protected void onStart() {
Sunny Goyal210e1742019-10-17 12:05:38 -0700206 addActivityFlags(ACTIVITY_STATE_STARTED);
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800207 super.onStart();
208 }
209
210 @Override
Tracy Zhoua706f002018-03-28 13:55:19 -0700211 protected void onResume() {
Mady Mellor9a90c2d2022-09-14 15:17:21 -0700212 setResumed();
Tracy Zhoua706f002018-03-28 13:55:19 -0700213 super.onResume();
214 }
215
216 @Override
217 protected void onUserLeaveHint() {
Sunny Goyal210e1742019-10-17 12:05:38 -0700218 removeActivityFlags(ACTIVITY_STATE_USER_ACTIVE);
Tracy Zhoua706f002018-03-28 13:55:19 -0700219 super.onUserLeaveHint();
220 }
221
222 @Override
Winson Chung1a77c3d2018-04-11 12:47:47 -0700223 public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) {
224 super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig);
225 for (int i = mMultiWindowModeChangedListeners.size() - 1; i >= 0; i--) {
226 mMultiWindowModeChangedListeners.get(i).onMultiWindowModeChanged(isInMultiWindowMode);
227 }
228 }
229
230 @Override
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800231 protected void onStop() {
Sunny Goyal210e1742019-10-17 12:05:38 -0700232 removeActivityFlags(ACTIVITY_STATE_STARTED | ACTIVITY_STATE_USER_ACTIVE);
Sunny Goyal7eff40f2018-04-11 15:30:46 -0700233 mForceInvisible = 0;
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800234 super.onStop();
Winson Chunga36c8002019-06-11 16:15:54 -0700235
236 // Reset the overridden sysui flags used for the task-swipe launch animation, this is a
237 // catch all for if we do not get resumed (and therefore not paused below)
Tony Wickhamb4821882021-04-23 14:26:45 -0700238 getSystemUiController().updateUiState(UI_STATE_FULLSCREEN_TASK, 0);
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800239 }
240
Sunny Goyal3483c522018-04-12 11:23:33 -0700241 @Override
242 protected void onPause() {
Mady Mellor9a90c2d2022-09-14 15:17:21 -0700243 setPaused();
Sunny Goyal3483c522018-04-12 11:23:33 -0700244 super.onPause();
Winson Chunga0f09f92018-05-11 21:55:21 +0000245
246 // Reset the overridden sysui flags used for the task-swipe launch animation, we do this
247 // here instead of at the end of the animation because the start of the new activity does
248 // not happen immediately, which would cause us to reset to launcher's sysui flags and then
249 // back to the new app (causing a flash)
Tony Wickhamb4821882021-04-23 14:26:45 -0700250 getSystemUiController().updateUiState(UI_STATE_FULLSCREEN_TASK, 0);
Sunny Goyal3483c522018-04-12 11:23:33 -0700251 }
252
Sunny Goyal210e1742019-10-17 12:05:38 -0700253 @Override
254 public void onWindowFocusChanged(boolean hasFocus) {
255 super.onWindowFocusChanged(hasFocus);
256 if (hasFocus) {
257 addActivityFlags(ACTIVITY_STATE_WINDOW_FOCUSED);
258 } else {
259 removeActivityFlags(ACTIVITY_STATE_WINDOW_FOCUSED);
260 }
261
262 }
263
Fengjiang Lie884c2c2022-12-19 14:42:14 -0800264 protected void registerBackDispatcher() {
265 if (Utilities.ATLEAST_T) {
266 getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
267 OnBackInvokedDispatcher.PRIORITY_DEFAULT,
268 () -> {
269 onBackPressed();
270 TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onBackInvoked");
271 });
272 }
273 }
274
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800275 public boolean isStarted() {
Sunny Goyal3483c522018-04-12 11:23:33 -0700276 return (mActivityFlags & ACTIVITY_STATE_STARTED) != 0;
277 }
278
279 /**
280 * isResumed in already defined as a hidden final method in Activity.java
281 */
282 public boolean hasBeenResumed() {
283 return (mActivityFlags & ACTIVITY_STATE_RESUMED) != 0;
Sunny Goyalcc96aa12018-01-11 09:56:07 -0800284 }
Sunny Goyalfde55052018-02-01 14:46:13 -0800285
Mady Mellor9a90c2d2022-09-14 15:17:21 -0700286 /**
287 * Sets the activity to appear as paused.
288 */
289 public void setPaused() {
290 removeActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_DEFERRED_RESUMED);
291 }
292
293 /**
294 * Sets the activity to appear as resumed.
295 */
296 public void setResumed() {
297 addActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_USER_ACTIVE);
298 removeActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE);
299 }
300
Tracy Zhoua706f002018-03-28 13:55:19 -0700301 public boolean isUserActive() {
Sunny Goyal3483c522018-04-12 11:23:33 -0700302 return (mActivityFlags & ACTIVITY_STATE_USER_ACTIVE) != 0;
Tracy Zhoua706f002018-03-28 13:55:19 -0700303 }
304
Sunny Goyal210e1742019-10-17 12:05:38 -0700305 public int getActivityFlags() {
306 return mActivityFlags;
307 }
308
Mike Schneidera79d4602023-03-03 15:58:06 +0100309 protected void addActivityFlags(int toAdd) {
310 final int oldFlags = mActivityFlags;
311 mActivityFlags |= toAdd;
312 if (DEBUG) {
313 Log.d(TAG, "Launcher flags updated: " + formatFlagChange(mActivityFlags, oldFlags,
314 BaseActivity::getActivityStateString));
315 }
316 onActivityFlagsChanged(toAdd);
Sunny Goyal210e1742019-10-17 12:05:38 -0700317 }
318
Mike Schneidera79d4602023-03-03 15:58:06 +0100319 protected void removeActivityFlags(int toRemove) {
320 final int oldFlags = mActivityFlags;
321 mActivityFlags &= ~toRemove;
322 if (DEBUG) {
323 Log.d(TAG, "Launcher flags updated: " + formatFlagChange(mActivityFlags, oldFlags,
324 BaseActivity::getActivityStateString));
325 }
326
327 onActivityFlagsChanged(toRemove);
Sunny Goyal210e1742019-10-17 12:05:38 -0700328 }
329
Mike Schneidera79d4602023-03-03 15:58:06 +0100330 protected void onActivityFlagsChanged(int changeBits) {
331 }
Sunny Goyal210e1742019-10-17 12:05:38 -0700332
Winson Chung1a77c3d2018-04-11 12:47:47 -0700333 public void addMultiWindowModeChangedListener(MultiWindowModeChangedListener listener) {
334 mMultiWindowModeChangedListeners.add(listener);
335 }
336
337 public void removeMultiWindowModeChangedListener(MultiWindowModeChangedListener listener) {
338 mMultiWindowModeChangedListeners.remove(listener);
339 }
340
Sunny Goyalf633ef52018-03-13 09:57:05 -0700341 /**
Winson Chung9800e732018-04-04 13:33:23 -0700342 * Used to set the override visibility state, used only to handle the transition home with the
343 * recents animation.
Mike Schneidera79d4602023-03-03 15:58:06 +0100344 *
Sunny Goyalb65d7662021-03-07 15:09:11 -0800345 * @see QuickstepTransitionManager#createWallpaperOpenRunner
Winson Chung9800e732018-04-04 13:33:23 -0700346 */
Sunny Goyal7eff40f2018-04-11 15:30:46 -0700347 public void addForceInvisibleFlag(@InvisibilityFlags int flag) {
348 mForceInvisible |= flag;
Winson Chung9800e732018-04-04 13:33:23 -0700349 }
350
Sunny Goyal7eff40f2018-04-11 15:30:46 -0700351 public void clearForceInvisibleFlag(@InvisibilityFlags int flag) {
352 mForceInvisible &= ~flag;
353 }
354
Winson Chung9800e732018-04-04 13:33:23 -0700355 /**
356 * @return Wether this activity should be considered invisible regardless of actual visibility.
357 */
358 public boolean isForceInvisible() {
Sunny Goyal1c63c722018-06-05 16:00:34 -0700359 return hasSomeInvisibleFlag(INVISIBLE_FLAGS);
360 }
361
362 public boolean hasSomeInvisibleFlag(int mask) {
363 return (mForceInvisible & mask) != 0;
Winson Chung9800e732018-04-04 13:33:23 -0700364 }
365
Jon Mirandacb582592023-04-19 15:40:04 -0700366 /**
367 * Attempts to clear accessibility focus on {@param view}.
368 */
369 public void tryClearAccessibilityFocus(View view) {
370 }
371
Winson Chung1a77c3d2018-04-11 12:47:47 -0700372 public interface MultiWindowModeChangedListener {
373 void onMultiWindowModeChanged(boolean isInMultiWindowMode);
374 }
Sunny Goyale43d00d2018-05-14 14:23:18 -0700375
Winson Chungef528762019-09-06 12:05:52 -0700376 protected void dumpMisc(String prefix, PrintWriter writer) {
377 writer.println(prefix + "deviceProfile isTransposed="
378 + getDeviceProfile().isVerticalBarLayout());
379 writer.println(prefix + "orientation=" + getResources().getConfiguration().orientation);
380 writer.println(prefix + "mSystemUiController: " + mSystemUiController);
Mike Schneidera79d4602023-03-03 15:58:06 +0100381 writer.println(prefix + "mActivityFlags: " + getActivityStateString(mActivityFlags));
Winson Chungef528762019-09-06 12:05:52 -0700382 writer.println(prefix + "mForceInvisible: " + mForceInvisible);
Sunny Goyale43d00d2018-05-14 14:23:18 -0700383 }
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700384
385 public static <T extends BaseActivity> T fromContext(Context context) {
386 if (context instanceof BaseActivity) {
387 return (T) context;
Tony Wickham1906cc32021-02-11 11:55:24 -0800388 } else if (context instanceof ContextWrapper) {
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700389 return fromContext(((ContextWrapper) context).getBaseContext());
390 } else {
391 throw new IllegalArgumentException("Cannot find BaseActivity in parent tree");
392 }
393 }
Sunny Goyal27835952017-01-13 12:15:53 -0800394}