Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6717ff0 authored by Louis Pullen-Freilich's avatar Louis Pullen-Freilich
Browse files

Remove usages of now removed getThemedContext()

This was removed in FragmentActivity and so is blocking updating
AndroidX prebuilts. This method always returned 'this' so it's safe to
just use the Activity directly.

Bug: b/117613134
Test: run m -j
Change-Id: Iab8f69a68ffbdb58c7bc1246f3b92ec6aba9c97a
parent 7083e997
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -135,7 +135,7 @@ public abstract class BaseActivity
        // ToDo Create tool to check resource version before applyStyle for the theme
        // ToDo Create tool to check resource version before applyStyle for the theme
        // If version code is not match, we should reset overlay package to default,
        // If version code is not match, we should reset overlay package to default,
        // in case Activity continueusly encounter resource not found exception
        // in case Activity continueusly encounter resource not found exception
        getThemedContext().getTheme().applyStyle(R.style.DocumentsDefaultTheme, false);
        getTheme().applyStyle(R.style.DocumentsDefaultTheme, false);


        super.onCreate(icicle);
        super.onCreate(icicle);


+1 −1
Original line number Original line Diff line number Diff line
@@ -79,7 +79,7 @@ public class AppsRowManager {
        final LinearLayout appsGroup = activity.findViewById(R.id.apps_group);
        final LinearLayout appsGroup = activity.findViewById(R.id.apps_group);
        appsGroup.removeAllViews();
        appsGroup.removeAllViews();


        final LayoutInflater inflater = LayoutInflater.from(activity.getThemedContext());
        final LayoutInflater inflater = activity.getLayoutInflater();
        for (AppsRowItemData data : mDataList) {
        for (AppsRowItemData data : mDataList) {
            View item = inflater.inflate(R.layout.apps_item, appsGroup, false);
            View item = inflater.inflate(R.layout.apps_item, appsGroup, false);
            bindView(item, data);
            bindView(item, data);
+1 −2
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@ package com.android.documentsui.inspector;


import static androidx.core.util.Preconditions.checkArgument;
import static androidx.core.util.Preconditions.checkArgument;


import android.app.Activity;
import android.content.Intent;
import android.content.Intent;
import android.content.res.Resources;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.TypedArray;
@@ -53,7 +52,7 @@ public class InspectorActivity extends AppCompatActivity {
        // ToDo Create tool to check resource version before applyStyle for the theme
        // ToDo Create tool to check resource version before applyStyle for the theme
        // If version code is not match, we should reset overlay package to default,
        // If version code is not match, we should reset overlay package to default,
        // in case Activity continueusly encounter resource not found exception
        // in case Activity continueusly encounter resource not found exception
        getThemedContext().getTheme().applyStyle(R.style.DocumentsDefaultTheme, false);
        getTheme().applyStyle(R.style.DocumentsDefaultTheme, false);


        setContentView(R.layout.inspector_activity);
        setContentView(R.layout.inspector_activity);


+3 −2
Original line number Original line Diff line number Diff line
@@ -65,12 +65,13 @@ public class AppsRowManagerTest {
        mAppsRowManager = new AppsRowManager(mActionHandler);
        mAppsRowManager = new AppsRowManager(mActionHandler);


        Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
        Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
        LayoutInflater layoutInflater = LayoutInflater.from(context);
        mState = new State();
        mState = new State();
        mActivity = mock(BaseActivity.class);
        mActivity = mock(BaseActivity.class);
        mAppsRow = LayoutInflater.from(context).inflate(R.layout.apps_row, null);
        mAppsRow = layoutInflater.inflate(R.layout.apps_row, null);
        mAppsGroup = mAppsRow.findViewById(R.id.apps_row);
        mAppsGroup = mAppsRow.findViewById(R.id.apps_row);


        when(mActivity.getThemedContext()).thenReturn(context);
        when(mActivity.getLayoutInflater()).thenReturn(layoutInflater);
        when(mActivity.getDisplayState()).thenReturn(mState);
        when(mActivity.getDisplayState()).thenReturn(mState);
        when(mActivity.findViewById(R.id.apps_row)).thenReturn(mAppsRow);
        when(mActivity.findViewById(R.id.apps_row)).thenReturn(mAppsRow);
        when(mActivity.findViewById(R.id.apps_group)).thenReturn(mAppsGroup);
        when(mActivity.findViewById(R.id.apps_group)).thenReturn(mAppsGroup);