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

Commit b1369818 authored by Yuncheol Heo's avatar Yuncheol Heo
Browse files

Add ReadViewCameraViewController/Mediator.

- Launch config_rearViewCameraActivity in the overlay Window when
  gear is reversed.
- Add/Remove ActivityView dynamically to save the system resource
  while it is hidden.

Bug: 157481389
Test: atest com.android.systemui.car.rvc
Test: Check if RearViewCamera is launched when the gear is reversed and if it will be closed when the gear is changed to the other one.
Change-Id: I768fe9090eed9cb82c4108ab8f6335802d36fa64
parent bc89f3ea
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
    <uses-permission android:name="android.car.permission.CAR_POWER" />
    <!-- This permission is required to get the trusted device list of a user. -->
    <uses-permission android:name="android.car.permission.CAR_ENROLL_TRUST"/>
    <!-- This permission is required to monitor gear state. -->
    <uses-permission android:name="android.car.permission.CAR_POWERTRAIN" />
    <!-- This permission is required to get bluetooth broadcast. -->
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <!-- These permissions are required to implement icons based on role holders. -->
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ 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.
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rear_view_camera_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent"
    android:orientation="vertical">
    <Button
        android:id="@+id/close_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/rear_view_camera_button_background"
        android:text="@string/rear_view_camera_close_button_text"
        android:textAppearance="?android:attr/textAppearanceLarge"/>
</LinearLayout>
+7 −1
Original line number Diff line number Diff line
@@ -42,4 +42,10 @@
              android:layout_height="match_parent"
              android:layout="@layout/car_user_switching_dialog"/>

    <!-- Should be at bottom to get the highest Z-order. -->
    <ViewStub android:id="@+id/rear_view_camera_stub"
              android:layout_width="@dimen/rear_view_camera_width"
              android:layout_height="@dimen/rear_view_camera_height"
              android:layout_gravity="center"
              android:layout="@layout/rear_view_camera"/>
</FrameLayout>
+2 −0
Original line number Diff line number Diff line
@@ -66,4 +66,6 @@

    <color name="car_user_switching_dialog_background_color">@android:color/black</color>
    <color name="car_user_switching_dialog_loading_text_color">@*android:color/car_body1</color>

    <color name="rear_view_camera_button_background">@*android:color/car_card_dark</color>
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@
        <item>com.android.systemui.car.keyguard.CarKeyguardViewMediator</item>
        <item>com.android.systemui.car.userswitcher.FullscreenUserSwitcherViewMediator</item>
        <item>com.android.systemui.car.userswitcher.UserSwitchTransitionViewMediator</item>
        <item>com.android.systemui.car.rvc.RearViewCameraViewMediator</item>
    </string-array>

    <!--
@@ -150,4 +151,7 @@

    <!-- How many milliseconds to wait before force hiding the UserSwitchTransitionView -->
    <integer name="config_userSwitchTransitionViewShownTimeoutMs" translatable="false">5000</integer>

    <!-- The Activity name for the Rear View Camera, if empty, the feature will be disabled. -->
    <string name="config_rearViewCameraActivity" translatable="false"></string>
</resources>
Loading