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

Commit e5f8ce09 authored by Matt Pietal's avatar Matt Pietal
Browse files

Bouncer cleanup

Remove unnecessary layers like KeyguardViewRootController, that were
only added to facilitate dagger. Remove unused interface.

Bug: 195430376
Test: atest KeyguardBouncerTest
Change-Id: Ic5bc5b59bc9199a18dfb0a6e31f63eb11b4dacc8
parent d7539b06
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2014 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
  -->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent"
    android:clipChildren="false"
    android:clipToPadding="false">

    <include
        layout="@layout/keyguard_host_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</FrameLayout>
+4 −1
Original line number Diff line number Diff line
@@ -101,7 +101,10 @@
        <FrameLayout android:id="@+id/keyguard_bouncer_container"
                     android:layout_height="0dp"
                     android:layout_width="match_parent"
                     android:layout_weight="1" />
                     android:layout_weight="1"
                     android:background="@android:color/transparent"
                     android:clipChildren="false"
                     android:clipToPadding="false" />
    </LinearLayout>

    <com.android.systemui.biometrics.AuthRippleView
+0 −48
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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.keyguard;

import android.view.ViewGroup;

import com.android.keyguard.dagger.KeyguardBouncerScope;
import com.android.systemui.dagger.qualifiers.RootView;
import com.android.systemui.statusbar.phone.KeyguardBouncer;
import com.android.systemui.util.ViewController;

import javax.inject.Inject;
/** Controller for a {@link KeyguardBouncer}'s Root view. */
@KeyguardBouncerScope
public class KeyguardRootViewController extends ViewController<ViewGroup> {
    @Inject
    public KeyguardRootViewController(@RootView ViewGroup view) {
        super(view);
    }

    public ViewGroup getView() {
        return mView;
    }

    @Override
    protected void onViewAttached() {

    }

    @Override
    protected void onViewDetached() {

    }
}
+5 −5
Original line number Diff line number Diff line
@@ -16,10 +16,13 @@

package com.android.keyguard.dagger;

import android.view.ViewGroup;

import com.android.keyguard.KeyguardHostViewController;
import com.android.keyguard.KeyguardRootViewController;
import com.android.systemui.dagger.qualifiers.RootView;
import com.android.systemui.statusbar.phone.KeyguardBouncer;

import dagger.BindsInstance;
import dagger.Subcomponent;

/**
@@ -31,12 +34,9 @@ public interface KeyguardBouncerComponent {
    /** Simple factory for {@link KeyguardBouncerComponent}. */
    @Subcomponent.Factory
    interface Factory {
        KeyguardBouncerComponent create();
        KeyguardBouncerComponent create(@BindsInstance @RootView ViewGroup bouncerContainer);
    }

    /** Returns a {@link KeyguardRootViewController}. */
    KeyguardRootViewController getKeyguardRootViewController();

    /** Returns a {@link KeyguardHostViewController}. */
    KeyguardHostViewController getKeyguardHostViewController();
}
+6 −17
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.android.keyguard.KeyguardHostView;
import com.android.keyguard.KeyguardMessageArea;
import com.android.keyguard.KeyguardSecurityContainer;
import com.android.keyguard.KeyguardSecurityViewFlipper;
import com.android.systemui.R;
@@ -35,26 +34,16 @@ import dagger.Provides;
 */
@Module
public interface KeyguardBouncerModule {
    /** */
    @Provides
    @KeyguardBouncerScope
    @RootView
    static ViewGroup providesRootView(LayoutInflater layoutInflater) {
        return (ViewGroup) layoutInflater.inflate(R.layout.keyguard_bouncer, null);
    }

    /** */
    @Provides
    @KeyguardBouncerScope
    static KeyguardMessageArea providesKeyguardMessageArea(@RootView ViewGroup viewGroup) {
        return viewGroup.findViewById(R.id.keyguard_message_area);
    }

    /** */
    @Provides
    @KeyguardBouncerScope
    static KeyguardHostView providesKeyguardHostView(@RootView ViewGroup rootView) {
        return rootView.findViewById(R.id.keyguard_host_view);
    static KeyguardHostView providesKeyguardHostView(@RootView ViewGroup rootView,
            LayoutInflater layoutInflater) {
        KeyguardHostView hostView = (KeyguardHostView) layoutInflater.inflate(
                R.layout.keyguard_host_view, rootView, false);
        rootView.addView(hostView);
        return hostView;
    }

    /** */
Loading