diff --git a/res/values/strings.xml b/res/values/strings.xml
index a4ecd3a..925ca8f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -10125,6 +10125,8 @@
     <string name="gup_dashboard_title">Game Update Package Preferences</string>
     <!-- Summary for Game Update Package dashboard [CHAR LIMIT=50] -->
     <string name="gup_dashboard_summary">Modify Game Update Package settings</string>
+    <!-- Footer text for Game Update Package dashboard [CHAR LIMIT=NONE] -->
+    <string name="game_driver_footer_text">When Game Driver is turned on, you can pick to use the updated graphics driver for Apps installed on the device.</string>
     <!-- Title for Game Update Package all apps preference [CHAR LIMIT=50] -->
     <string name="gup_all_apps_switch_title">Enable for all apps</string>
     <!-- Title for Game Update Package preference [CHAR LIMIT=50] -->
diff --git a/res/xml/gup_settings.xml b/res/xml/gup_settings.xml
index 09bca71..8b09bd2 100644
--- a/res/xml/gup_settings.xml
+++ b/res/xml/gup_settings.xml
@@ -33,4 +33,11 @@
         settings:controller="com.android.settings.development.gup.GupPreferenceController">
     </PreferenceCategory>
 
+    <com.android.settingslib.widget.FooterPreference
+        android:key="footer_preference"
+        android:title="@string/game_driver_footer_text"
+        android:selectable="false"
+        settings:controller="com.android.settings.development.gup.GameDriverFooterPreferenceController">
+    </com.android.settingslib.widget.FooterPreference>
+
 </PreferenceScreen>
diff --git a/src/com/android/settings/development/gup/GameDriverFooterPreferenceController.java b/src/com/android/settings/development/gup/GameDriverFooterPreferenceController.java
new file mode 100644
index 0000000..0e1a351
--- /dev/null
+++ b/src/com/android/settings/development/gup/GameDriverFooterPreferenceController.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.development.gup;
+
+import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
+import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_OFF;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.os.Handler;
+import android.os.Looper;
+import android.provider.Settings;
+
+import androidx.annotation.VisibleForTesting;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settingslib.core.lifecycle.LifecycleObserver;
+import com.android.settingslib.core.lifecycle.events.OnStart;
+import com.android.settingslib.core.lifecycle.events.OnStop;
+import com.android.settingslib.widget.FooterPreference;
+
+/**
+ * Controller of footer preference for Game Driver.
+ */
+public class GameDriverFooterPreferenceController extends BasePreferenceController
+        implements GameDriverContentObserver.OnGameDriverContentChangedListener, LifecycleObserver,
+                   OnStart, OnStop {
+    private final ContentResolver mContentResolver;
+    @VisibleForTesting
+    GameDriverContentObserver mGameDriverContentObserver;
+
+    private FooterPreference mPreference;
+
+    public GameDriverFooterPreferenceController(Context context) {
+        super(context, FooterPreference.KEY_FOOTER);
+        mContentResolver = context.getContentResolver();
+        mGameDriverContentObserver =
+                new GameDriverContentObserver(new Handler(Looper.getMainLooper()), this);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return Settings.Global.getInt(
+                       mContentResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
+                        == GUP_OFF
+                ? AVAILABLE_UNSEARCHABLE
+                : CONDITIONALLY_UNAVAILABLE;
+    }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+        mPreference = screen.findPreference(getPreferenceKey());
+    }
+
+    @Override
+    public void onStart() {
+        mGameDriverContentObserver.register(mContentResolver);
+    }
+
+    @Override
+    public void onStop() {
+        mGameDriverContentObserver.unregister(mContentResolver);
+    }
+
+    @Override
+    public void updateState(Preference preference) {
+        preference.setVisible(isAvailable());
+    }
+
+    @Override
+    public void onGameDriverContentChanged() {
+        updateState(mPreference);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/development/gup/GameDriverFooterPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/gup/GameDriverFooterPreferenceControllerTest.java
new file mode 100644
index 0000000..fa4b124
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/development/gup/GameDriverFooterPreferenceControllerTest.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.development.gup;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE_UNSEARCHABLE;
+import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
+import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_ALL_APPS;
+import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
+import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_OFF;
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.PreferenceScreen;
+
+import com.android.settingslib.widget.FooterPreference;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class GameDriverFooterPreferenceControllerTest {
+    @Mock
+    private PreferenceScreen mScreen;
+    @Mock
+    private FooterPreference mPreference;
+    @Mock
+    private GameDriverContentObserver mGameDriverContentObserver;
+
+    private Context mContext;
+    private ContentResolver mResolver;
+    private GameDriverFooterPreferenceController mController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
+        mResolver = mContext.getContentResolver();
+        mController = spy(new GameDriverFooterPreferenceController(mContext));
+        when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
+    }
+
+    @Test
+    public void getAvailabilityStatus_gameDriverOff_availableUnsearchable() {
+        Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_OFF);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE_UNSEARCHABLE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_gameDriverDefault_conditionallyUnavailable() {
+        Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_gameDriverAllApps_conditionallyUnavailable() {
+        Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_ALL_APPS);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+    }
+
+    @Test
+    public void onStart_shouldRegister() {
+        mController.mGameDriverContentObserver = mGameDriverContentObserver;
+        mController.onStart();
+
+        verify(mGameDriverContentObserver).register(mResolver);
+    }
+
+    @Test
+    public void onStop_shouldUnregister() {
+        mController.mGameDriverContentObserver = mGameDriverContentObserver;
+        mController.onStop();
+
+        verify(mGameDriverContentObserver).unregister(mResolver);
+    }
+
+    @Test
+    public void updateState_available_visible() {
+        when(mController.getAvailabilityStatus()).thenReturn(AVAILABLE_UNSEARCHABLE);
+        mController.updateState(mPreference);
+
+        verify(mPreference).setVisible(true);
+    }
+
+    @Test
+    public void updateState_unavailable_invisible() {
+        when(mController.getAvailabilityStatus()).thenReturn(CONDITIONALLY_UNAVAILABLE);
+        mController.updateState(mPreference);
+
+        verify(mPreference).setVisible(false);
+    }
+}
