Revert "[1/2] SystemUI: add option to hide gesture navigation and size config handle"

This reverts commit dbabbfefae3ae8d7b67167be0b0974ff8191df40.

Moved to Launcher3 taskbar
Change-Id: I203fc64712f83bebe8ad9a2dba4c891d72d6f841
Signed-off-by: micky387 <mickaelsaibi@free.fr>
diff --git a/packages/SystemUI/res/layout/home_handle_small.xml b/packages/SystemUI/res/layout/home_handle_small.xml
deleted file mode 100644
index d9fc55a..0000000
--- a/packages/SystemUI/res/layout/home_handle_small.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 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.
-  -->
-
-<com.android.systemui.navigationbar.gestural.NavigationHandle
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/home_handle"
-    android:layout_width="@dimen/navigation_home_handle_small_width"
-    android:layout_height="@dimen/navigation_home_handle_height"
-    android:layout_weight="0"
-    android:layout_gravity="bottom"
-    android:contentDescription="@string/accessibility_home"
-    android:paddingStart="@dimen/navigation_key_padding"
-    android:paddingEnd="@dimen/navigation_key_padding"
-    />
-
diff --git a/packages/SystemUI/res/values/custom_dimens.xml b/packages/SystemUI/res/values/custom_dimens.xml
index 63ea702..3eb1ec5 100644
--- a/packages/SystemUI/res/values/custom_dimens.xml
+++ b/packages/SystemUI/res/values/custom_dimens.xml
@@ -24,7 +24,7 @@
     <!-- Navigation bar dpad -->
     <dimen name="navigation_extra_key_width">36dp</dimen>
 
-    <dimen name="navigation_home_handle_small_width">40dp</dimen>
+    <dimen name="navigation_home_handle_small_width">48dp</dimen>
     <!-- 2 * navigation_handle_radius + 2 * navigation_handle_bottom-->
     <dimen name="navigation_home_handle_height">14dp</dimen>
 
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarInflaterView.java
index e8a228f..0cac696 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarInflaterView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarInflaterView.java
@@ -164,21 +164,13 @@
     }
 
     protected String getDefaultLayout() {
-        if (QuickStepContract.isGesturalMode(mNavBarMode)) {
-            String navbarLayout = getContext().getString(showDpadArrowKeys()
-                    ? R.string.config_navBarLayoutHandleArrows
-                    : R.string.config_navBarLayoutHandle);
-            if (hideGestureHandle()) {
-                return navbarLayout.replace(HOME_HANDLE, NAVSPACE);
-            } else {
-                return navbarLayout;
-            }
-        } else {
-            final int defaultResource = mOverviewProxyService.shouldShowSwipeUpUI()
-                            ? R.string.config_navBarLayoutQuickstep
-                            : R.string.config_navBarLayout;
-            return getContext().getString(defaultResource);
-        }
+        final int defaultResource = QuickStepContract.isGesturalMode(mNavBarMode)
+                        ? (showDpadArrowKeys() ? R.string.config_navBarLayoutHandleArrows
+                        : R.string.config_navBarLayoutHandle)
+                : mOverviewProxyService.shouldShowSwipeUpUI()
+                        ? R.string.config_navBarLayoutQuickstep
+                        : R.string.config_navBarLayout;
+        return getContext().getString(defaultResource);
     }
 
     private void onNavigationModeChanged(int mode) {
@@ -197,10 +189,6 @@
         super.onAttachedToWindow();
         Dependency.get(OmniSettingsService.class).addIntObserver(this,
             OmniSettings.OMNI_NAVIGATION_BAR_ARROW_KEYS);
-        Dependency.get(OmniSettingsService.class).addIntObserver(this,
-            OmniSettings.OMNI_GESTURE_HANDLE_HIDE);
-        Dependency.get(OmniSettingsService.class).addIntObserver(this, 
-            OmniSettings.OMNI_GESTURE_HANDLE_SMALL);
     }
 
     public void onLikelyDefaultLayoutChange() {
@@ -212,12 +200,6 @@
         }
     }
 
-    private void onForceDefaultLayoutChange() {
-        final String newValue = getDefaultLayout();
-        clearViews();
-        inflateLayout(newValue);
-    }
-
     public void setButtonDispatchers(SparseArray<ButtonDispatcher> buttonDispatchers) {
         mButtonDispatchers = buttonDispatchers;
         clearDispatcherViews();
@@ -436,7 +418,7 @@
         } else if (CONTEXTUAL.equals(button)) {
             v = inflater.inflate(R.layout.contextual, parent, false);
         } else if (HOME_HANDLE.equals(button)) {
-            v = inflater.inflate(isSmallGestureHandle() ? R.layout.home_handle_small : R.layout.home_handle, parent, false);
+            v = inflater.inflate(R.layout.home_handle, parent, false);
         } else if (IME_SWITCHER.equals(button)) {
             v = inflater.inflate(R.layout.ime_switcher, parent, false);
         } else if (button.startsWith(KEY)) {
@@ -538,19 +520,9 @@
                 OmniSettings.OMNI_NAVIGATION_BAR_ARROW_KEYS, 0, UserHandle.USER_CURRENT) != 0;
     }
 
-    private boolean hideGestureHandle() {
-        return Settings.System.getIntForUser(getContext().getContentResolver(),
-                OmniSettings.OMNI_GESTURE_HANDLE_HIDE, 0, UserHandle.USER_CURRENT) != 0;
-    }
-
-    private boolean isSmallGestureHandle() {
-        return Settings.System.getIntForUser(getContext().getContentResolver(),
-                OmniSettings.OMNI_GESTURE_HANDLE_SMALL, 0, UserHandle.USER_CURRENT) != 0;
-    }
-
     @Override
     public void onIntSettingChanged(String key, Integer newValue) {
-        onForceDefaultLayoutChange();
+        onLikelyDefaultLayoutChange();
     }
 
     public void dump(PrintWriter pw) {