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

Commit 6343e91b authored by Sumedh Sen's avatar Sumedh Sen
Browse files

Foundation of Piav2

This introduces the new landing activity for installs, its manifest
entry, new dependencies for the app

Bug: 182205982
Test: None. Flag to use new app is turned off by default

Change-Id: I230cb8ae7213211868b2c1b558ddf4e1406fd0a6
parent 249b3e26
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ android_app {
        "xz-java",
        "androidx.leanback_leanback",
        "androidx.annotation_annotation",
        "androidx.fragment_fragment",
        "androidx.lifecycle_lifecycle-livedata",
        "androidx.lifecycle_lifecycle-extensions",
    ],

    lint: {
@@ -69,6 +72,9 @@ android_app {
    static_libs: [
        "xz-java",
        "androidx.leanback_leanback",
        "androidx.fragment_fragment",
        "androidx.lifecycle_lifecycle-livedata",
        "androidx.lifecycle_lifecycle-extensions",
    ],
    aaptflags: ["--product tablet"],

@@ -94,6 +100,9 @@ android_app {
        "xz-java",
        "androidx.leanback_leanback",
        "androidx.annotation_annotation",
        "androidx.fragment_fragment",
        "androidx.lifecycle_lifecycle-livedata",
        "androidx.lifecycle_lifecycle-extensions",
    ],
    aaptflags: ["--product tv"],

+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,11 @@
            </intent-filter>
        </receiver>

        <activity android:name=".v2.ui.InstallLaunch"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/Theme.AlertDialogActivity"
            android:exported="true"/>

        <activity android:name=".InstallStart"
                android:theme="@style/Theme.AlertDialogActivity"
                android:exported="true"
+15 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.packageinstaller.v2.ui.InstallLaunch;
import java.util.Arrays;

/**
@@ -57,9 +57,23 @@ public class InstallStart extends Activity {

    private final boolean mLocalLOGV = false;

    // TODO (sumedhsen): Replace with an Android Feature Flag once implemented
    private static final boolean USE_PIA_V2 = false;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (USE_PIA_V2) {
            Intent piaV2 = new Intent(getIntent());
            piaV2.putExtra(InstallLaunch.EXTRA_CALLING_PKG_NAME, getCallingPackage());
            piaV2.putExtra(InstallLaunch.EXTRA_CALLING_PKG_UID, getLaunchedFromUid());
            piaV2.setClass(this, InstallLaunch.class);
            piaV2.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
            startActivity(piaV2);
            finish();
            return;
        }
        mPackageManager = getPackageManager();
        mUserManager = getSystemService(UserManager.class);

+35 −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.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.packageinstaller.v2.ui;

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

public class InstallLaunch extends FragmentActivity {

    public static final String EXTRA_CALLING_PKG_UID =
            InstallLaunch.class.getPackageName() + ".callingPkgUid";
    public static final String EXTRA_CALLING_PKG_NAME =
            InstallLaunch.class.getPackageName() + ".callingPkgName";
    private static final String TAG = InstallLaunch.class.getSimpleName();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
}