Moving some methods from various activities to the base interface

This allows creating some custom views in the absence of
activity context

Bug: 118758696
Change-Id: I23999290e972a2a8cbd725a521a4e0c7c2e5023e
This commit is contained in:
Sunny Goyal
2018-11-13 19:43:57 -08:00
parent 3386fbf674
commit fe8e4a90be
6 changed files with 43 additions and 27 deletions

View File

@@ -36,6 +36,7 @@ import com.android.launcher3.logging.UserEventDispatcher.UserEventDelegate;
import com.android.launcher3.uioverrides.UiFactory;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.views.ActivityContext;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -44,7 +45,8 @@ import java.util.ArrayList;
import androidx.annotation.IntDef;
public abstract class BaseActivity extends Activity implements UserEventDelegate, LogStateProvider{
public abstract class BaseActivity extends Activity
implements UserEventDelegate, LogStateProvider, ActivityContext {
public static final int INVISIBLE_BY_STATE_HANDLER = 1 << 0;
public static final int INVISIBLE_BY_APP_TRANSITIONS = 1 << 1;
@@ -100,14 +102,11 @@ public abstract class BaseActivity extends Activity implements UserEventDelegate
// animation
@InvisibilityFlags private int mForceInvisible;
@Override
public DeviceProfile getDeviceProfile() {
return mDeviceProfile;
}
public AccessibilityDelegate getAccessibilityDelegate() {
return null;
}
public int getCurrentState() { return StatsLogUtils.LAUNCHER_STATE_BACKGROUND; }
public void modifyUserEvent(LauncherLogProto.LauncherEvent event) {}