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

Commit 590bb5c0 authored by Alex Stetson's avatar Alex Stetson
Browse files

Removing car code from phone SettingsIntelligence

AAOS specific code is to be split out into its own package to remove the
phone dependencies on car code.

Bug: 174688736
Test: manual (app still functions properly on sdk_gphone_x86)
Change-Id: I1a7969aef5819ff510e5db5c0716e3a18aa6dc88
parent d868265f
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
@@ -29,17 +29,14 @@ license {
    ],
}

android_app {
    name: "SettingsIntelligence",
    optimize: {
        proguard_flags_files: ["proguard.cfg"],
    },
android_library {
    name: "SettingsIntelligence-core",
    sdk_version: "system_current",
    product_specific: true,
    privileged: true,
    required: ["privapp_whitelist_com.android.settings.intelligence"],
    srcs: [
        "src/**/*.java",
        "proto/**/*.proto",
    ],

    libs: ["android.car-stubs"],
    static_libs: [
        "androidx.legacy_legacy-support-v4",
        "androidx.legacy_legacy-support-v13",
@@ -48,14 +45,22 @@ android_app {
        "androidx.preference_preference",
        "androidx.recyclerview_recyclerview",
        "androidx.legacy_legacy-preference-v14",
        "car-ui-lib",
    ],
    resource_dirs: ["res"],
    srcs: [
        "src/**/*.java",
        "proto/**/*.proto",
    ],
    proto: {
        type: "nano",
    },
}

android_app {
    name: "SettingsIntelligence",
    optimize: {
        proguard_flags_files: ["proguard.cfg"],
    },
    sdk_version: "system_current",
    product_specific: true,
    privileged: true,
    required: ["privapp_whitelist_com.android.settings.intelligence"],

    static_libs: ["SettingsIntelligence-core"],
    resource_dirs: [],
}
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

# Android auto
rlagos@google.com # OWNER for SUW related code
ericberglund@google.com # OWNER for Car Settings related code
alexstetson@google.com # OWNER for Car Settings related code

# TV Settings
leifhendrik@google.com
+0 −2
Original line number Diff line number Diff line
@@ -23,6 +23,4 @@
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowSoftInputMode">adjustPan</item>
    </style>

    <style name="Theme.CarSettings" parent="@style/Theme.CarUi.WithToolbar"/>
</resources>
 No newline at end of file

res/xml/car_search_fragment.xml

deleted100644 → 0
+0 −21
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.
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:title="@string/app_name_settings_intelligence"/>
+4 −18
Original line number Diff line number Diff line
@@ -17,36 +17,26 @@

package com.android.settings.intelligence.search;

import androidx.fragment.app.FragmentActivity;
import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;

import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.WindowManager;

import com.android.settings.intelligence.R;
import com.android.settings.intelligence.search.car.CarSearchFragment;

public class SearchActivity extends FragmentActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        if (isAutomotive()) {
            // Automotive relies on a different theme. Apply before calling super so that
            // fragments are restored properly on configuration changes.
            setTheme(R.style.Theme_CarSettings);
        }
        super.onCreate(savedInstanceState);
        setContentView(R.layout.search_main);

        FragmentManager fragmentManager = getSupportFragmentManager();
        Fragment fragment = fragmentManager.findFragmentById(R.id.main_content);
        if (fragment == null) {
            fragment = isAutomotive() ?
                    new CarSearchFragment() : new SearchFragment();
            fragmentManager.beginTransaction()
                    .add(R.id.main_content, fragment)
                    .add(R.id.main_content, new SearchFragment())
                    .commit();
        }
    }
@@ -56,8 +46,4 @@ public class SearchActivity extends FragmentActivity {
        finish();
        return true;
    }

    private boolean isAutomotive() {
        return getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
    }
}
Loading