Removing unnecessary ActivityContextDelegate

Bug: 393703968
Flag: EXEMPT refactor
Test: Presubmit
Change-Id: Ib95b26de000a2fe8204fdbc46c8a9da4f65c7eab
This commit is contained in:
Sunny Goyal
2025-02-26 10:51:42 -08:00
parent b00227ca3f
commit e9355c622d
3 changed files with 8 additions and 25 deletions
+2 -4
View File
@@ -481,10 +481,8 @@ public abstract class BaseActivity extends Activity implements ActivityContext,
public static <T extends BaseActivity> T fromContext(Context context) {
if (context instanceof BaseActivity) {
return (T) context;
} else if (context instanceof ActivityContextDelegate) {
return (T) ((ActivityContextDelegate) context).mDelegate;
} else if (context instanceof ContextWrapper) {
return fromContext(((ContextWrapper) context).getBaseContext());
} else if (context instanceof ContextWrapper cw) {
return fromContext(cw.getBaseContext());
} else {
throw new IllegalArgumentException("Cannot find BaseActivity in parent tree");
}