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

Commit 1c6b5ff5 authored by Sumedh Sen's avatar Sumedh Sen
Browse files

Replace hidden APIs with their publicly avaiable variants

In order to make PackageInstaller an updatable app, we need to migrate
it away from any hidden APIs and have it depend only on publicly
available APIs or SystemApis.

Test: atest CtsPackageInstallTestCases
Bug: 239722738
Change-Id: Ia9a9ae03ff81fed441fba2d662b1a671cf7b369e
parent 1b00af3f
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -39,12 +39,13 @@ android_app {

    certificate: "platform",
    privileged: true,
    platform_apis: true,
    platform_apis: false,
    sdk_version: "system_current",
    rename_resources_package: false,

    static_libs: [
        "xz-java",
        "androidx.leanback_leanback",
        "androidx.annotation_annotation",
    ],
}

@@ -56,7 +57,8 @@ android_app {

    certificate: "platform",
    privileged: true,
    platform_apis: true,
    platform_apis: false,
    sdk_version: "system_current",
    rename_resources_package: false,
    overrides: ["PackageInstaller"],

@@ -75,13 +77,15 @@ android_app {

    certificate: "platform",
    privileged: true,
    platform_apis: true,
    platform_apis: false,
    sdk_version: "system_current",
    rename_resources_package: false,
    overrides: ["PackageInstaller"],

    static_libs: [
        "xz-java",
        "androidx.leanback_leanback",
        "androidx.annotation_annotation",
    ],
    aaptflags: ["--product tv"],
}
+2 −1
Original line number Diff line number Diff line
@@ -16,11 +16,12 @@

package com.android.packageinstaller;

import android.annotation.Nullable;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;

import java.io.File;

/**
+3 −2
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.packageinstaller;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInstaller;
@@ -27,6 +25,9 @@ import android.util.Log;
import android.util.SparseArray;
import android.util.Xml;

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

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;
+2 −1
Original line number Diff line number Diff line
@@ -16,11 +16,12 @@

package com.android.packageinstaller;

import android.annotation.NonNull;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import androidx.annotation.NonNull;

/**
 * Receives install events and perists them using a {@link EventResultPersister}.
 */
+3 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.packageinstaller;

import android.annotation.Nullable;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -32,7 +31,7 @@ import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.android.internal.app.AlertActivity;
import androidx.annotation.Nullable;

import java.io.File;

@@ -79,6 +78,8 @@ public class InstallFailed extends AlertActivity {
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setFinishOnTouchOutside(true);

        int statusCode = getIntent().getIntExtra(PackageInstaller.EXTRA_STATUS,
                PackageInstaller.STATUS_FAILURE);

Loading