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

Commit e3f4a1d5 authored by Gustavo Pagani's avatar Gustavo Pagani
Browse files

Add WearApp with scaffolding for navigation.

Bug: 299580143
Test: N/A only project scaffolding was added

Change-Id: I56f453bb9def0aa4a5e9d3d5d6a74d88adbae9f5
parent 13852fd5
Loading
Loading
Loading
Loading
+0 −43
Original line number Diff line number Diff line
@@ -50,46 +50,3 @@ android_app {
        proguard_compatibility: false,
    },
}

android_app {
    name: "ClockworkCredentialManager",
    defaults: ["platform_app_defaults"],
    certificate: "platform",
    manifest: "wear/AndroidManifest.xml",
    srcs: ["wear/src/**/*.kt"],
    resource_dirs: ["wear/res"],

    dex_preopt: {
        profile_guided: true,
        profile: "wear/profile.txt.prof",
    },

    static_libs: [
        "PlatformComposeCore",
        "androidx.activity_activity-compose",
        "androidx.appcompat_appcompat",
        "androidx.compose.foundation_foundation",
        "androidx.compose.foundation_foundation-layout",
        "androidx.compose.material_material-icons-core",
        "androidx.compose.material_material-icons-extended",
        "androidx.compose.ui_ui",
        "androidx.core_core-ktx",
        "androidx.credentials_credentials",
        "androidx.lifecycle_lifecycle-extensions",
        "androidx.lifecycle_lifecycle-livedata",
        "androidx.lifecycle_lifecycle-runtime-ktx",
        "androidx.lifecycle_lifecycle-viewmodel-compose",
        "androidx.wear.compose_compose-foundation",
        "androidx.wear.compose_compose-material",
        "kotlinx-coroutines-core",
    ],

    platform_apis: true,
    privileged: true,

    kotlincflags: ["-Xjvm-default=all"],

    optimize: {
        proguard_compatibility: false,
    },
}
+53 −0
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_base_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_base_license"],
}

android_app {
    name: "ClockworkCredentialManager",
    defaults: ["platform_app_defaults"],
    certificate: "platform",
    manifest: "AndroidManifest.xml",
    srcs: ["src/**/*.kt"],
    resource_dirs: ["res"],

    dex_preopt: {
        profile_guided: true,
        profile: "profile.txt.prof",
    },

    static_libs: [
        "Horologist",
        "PlatformComposeCore",
        "androidx.activity_activity-compose",
        "androidx.appcompat_appcompat",
        "androidx.compose.foundation_foundation",
        "androidx.compose.foundation_foundation-layout",
        "androidx.compose.material_material-icons-core",
        "androidx.compose.material_material-icons-extended",
        "androidx.compose.runtime_runtime",
        "androidx.compose.ui_ui",
        "androidx.core_core-ktx",
        "androidx.lifecycle_lifecycle-extensions",
        "androidx.lifecycle_lifecycle-livedata",
        "androidx.lifecycle_lifecycle-runtime-ktx",
        "androidx.lifecycle_lifecycle-viewmodel-compose",
        "androidx.wear.compose_compose-foundation",
        "androidx.wear.compose_compose-material",
        "androidx.wear.compose_compose-navigation",
        "kotlinx-coroutines-core",
    ],

    platform_apis: true,
    privileged: true,

    kotlincflags: ["-Xjvm-default=all"],

    optimize: {
        proguard_compatibility: false,
    },
}
+6 −6
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
 * Copyright (c) 2017 Google Inc.
 * Copyright (c) 2023 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.credentialmanager">

    <uses-feature android:name="android.hardware.type.watch" />

    <uses-permission android:name="android.permission.LAUNCH_CREDENTIAL_SELECTOR"/>
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
    <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"/>
@@ -28,17 +30,15 @@
      android:dataExtractionRules="@xml/data_extraction_rules"
      android:fullBackupContent="@xml/backup_rules"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/Theme.CredentialSelector">
      android:supportsRtl="true">

        <activity
            android:name=".CredentialSelectorActivity"
            android:name=".ui.CredentialSelectorActivity"
            android:exported="true"
            android:permission="android.permission.LAUNCH_CREDENTIAL_SELECTOR"
            android:launchMode="singleTop"
            android:label="@string/app_name"
            android:excludeFromRecents="true"
            android:theme="@style/Theme.CredentialSelector">
            android:excludeFromRecents="true">
        </activity>
  </application>

+14 −4
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 * Copyright (C) 2023 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.
@@ -14,19 +14,29 @@
 * limitations under the License.
 */

package com.android.credentialmanager.ui

import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.navigation.NavHostController
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.Text
import androidx.wear.compose.navigation.rememberSwipeDismissableNavController

class CredentialSelectorActivity : ComponentActivity() {

    lateinit var navController: NavHostController

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setTheme(android.R.style.Theme_DeviceDefault)

        setContent {
            navController = rememberSwipeDismissableNavController()

            MaterialTheme {
                Text("Credential Manager entry point")
                WearApp(navController = navController)
            }
        }
    }
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.0N
 *
 * 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.credentialmanager.ui

sealed class Screen(
    val route: String,
) {
    object Main : Screen("main")
}
Loading