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

Commit 90899e08 authored by Matt Fritze's avatar Matt Fritze Committed by Matthew Fritze
Browse files

First commit for settings panels

Establish the Activity which hosts Settings panels through the
PanelFragment. The Activity's purpose is to validate the intent
data coming in, including:
- Called with startActivityForResult (so we can log who is calling)
- Intent has the proper intent extra to link to a Panel

The fragment takes the Panelable data and builds a Settings Panel.
Each panel will have:
- Title
- List of Slices
- Link to underlying content

The Panelable interface is created to provide all of those datums, and
the new FetureProvider provides the Panelables by linking them with
keys. The keys will eventually become public APIs with CTS tests.For
now, we store them locally.

I included an exmaple panel, the InternetConnectivityPanel which
currently shows Wifi and Airplane mode.

Screenshot: https://screenshot.googleplex.com/c6sv7ZzQ5OJ
Bug: 117804089
Test: make -j40 RunSettingsRobotest
Test: Manual app
Change-Id: I1932f7179cc32088acd6413a736901ddf9651892
parent 59482597
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2959,6 +2959,17 @@
                       android:value="true" />
        </activity>

        <activity android:name=".panel.SettingsPanelActivity"
            android:label="@string/settings_panel_title"
            android:theme="@style/Theme.BottomDialog"
            android:excludeFromRecents="true"
            android:launchMode="singleTask">
                 <intent-filter>
                     <action android:name="android.settings.SETTINGSPANEL" />
                     <category android:name="android.intent.category.DEFAULT" />
                 </intent-filter>
        </activity>

        <provider android:name=".slices.SettingsSliceProvider"
                  android:authorities="com.android.settings.slices;android.settings.slices"
                  android:exported="true"
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->

<inset xmlns:android="http://schemas.android.com/apk/res/android" android:inset="4dp">
    <shape android:shape="rectangle">
        <corners android:radius="8dp" />
        <solid android:color="?android:attr/colorBackground" />
    </shape>
</inset>
 No newline at end of file
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2018 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/panel_parent_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="24dp"
        android:paddingRight="24dp"
        android:paddingBottom="8dp"
        android:layout_margin="4dp"
        android:orientation="vertical">
</LinearLayout>
 No newline at end of file
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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:id="@+id/main_content"
    android:layout_height="match_parent"
    android:layout_width="match_parent"/>
 No newline at end of file
+8 −2
Original line number Diff line number Diff line
@@ -10294,8 +10294,8 @@
    <!-- Available networks screen, summary when button disallowed due to permanent automatic mode [CHAR LIMIT=NONE] -->
    <string name="manual_mode_disallowed_summary">Unavailable when connected to <xliff:g id="carrier" example="verizon">%1$s</xliff:g></string>
    <!-- Used for EmergencyInfoSlice slice helper class -->
    <string name="emergency_info_contextual_card_summary" translatable="false">Medical info, emergency contacts</string>
    <!-- Used for EmergencyInfoSlice slice helper class [CHAR LIMIT=NONE]-->
    <string name="emergency_info_contextual_card_summary">Medical info, emergency contacts</string>
    <!-- See more items in contextual homepage [CHAR LIMIT=30]-->
    <string name="see_more">See more</string>
@@ -10317,6 +10317,12 @@
    <!-- Title for no connected devices in connected device slice. [CHAR LIMIT=NONE] -->
    <string name="no_connected_devices">No connected devices</string>
    <!-- Default title for the settings panel [CHAR LIMIT=NONE] -->
    <string name="settings_panel_title">Settings Panel</string>
    <!-- Title for the Internet Connectivity dialog (settings panel) with Internet related settings [CHAR LIMIT=50] -->
    <string name="internet_connectivity_panel_title">Internet Connectivity</string>
    <!-- UI debug setting: force desktop mode [CHAR LIMIT=50] -->
    <string name="force_desktop_mode">Force desktop mode</string>
    <!-- UI debug setting: force desktop mode summary [CHAR LIMIT=NONE] -->
Loading