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

Commit 67c422f9 authored by Sumedh Sen's avatar Sumedh Sen
Browse files

Move PackageInstaller app utility clases to separate directory

This utils are used by both Pia V1 and V2. Thus they are moved to a
central location.

Bug: 182205982
Test: Builds successfully
Change-Id: I30431e512209a9b81e80756b5d1bef6faca326ab
parent e2b283d9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
            android:forceQueryable="true"
            android:directBootAware="true">

        <receiver android:name=".TemporaryFileManager"
        <receiver android:name=".common.TemporaryFileManager"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
@@ -101,7 +101,7 @@
                android:theme="@style/Theme.AlertDialogActivity.NoAnimation"
                android:exported="false" />

        <receiver android:name=".InstallEventReceiver"
        <receiver android:name=".common.InstallEventReceiver"
                android:permission="android.permission.INSTALL_PACKAGES"
                android:exported="false">
            <intent-filter android:priority="1">
@@ -148,7 +148,7 @@
            android:exported="false">
        </activity>

        <receiver android:name=".UninstallEventReceiver"
        <receiver android:name=".common.UninstallEventReceiver"
            android:permission="android.permission.INSTALL_PACKAGES"
            android:exported="false">
            <intent-filter android:priority="1">
+3 −3
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *      https://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,
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.packageinstaller;
package com.android.packageinstaller.common;

import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;

+5 −5
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *      https://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,
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.packageinstaller;
package com.android.packageinstaller.common;

import android.content.BroadcastReceiver;
import android.content.Context;
@@ -59,7 +59,7 @@ public class InstallEventReceiver extends BroadcastReceiver {
     *
     * @return The id for this event
     */
    static int addObserver(@NonNull Context context, int id,
    public static int addObserver(@NonNull Context context, int id,
            @NonNull EventResultPersister.EventResultObserver observer)
            throws EventResultPersister.OutOfIdsException {
        return getReceiver(context).addObserver(id, observer);
@@ -71,7 +71,7 @@ public class InstallEventReceiver extends BroadcastReceiver {
     * @param context  A context of the current app
     * @param id The id the observer was added for
     */
    static void removeObserver(@NonNull Context context, int id) {
    public static void removeObserver(@NonNull Context context, int id) {
        getReceiver(context).removeObserver(id);
    }
}
+3 −3
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *      https://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,
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.packageinstaller;
package com.android.packageinstaller.common;

import android.content.BroadcastReceiver;
import android.content.Context;
+6 −5
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *      https://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,
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.packageinstaller;
package com.android.packageinstaller.common;

import android.content.BroadcastReceiver;
import android.content.Context;
@@ -71,7 +71,7 @@ public class UninstallEventReceiver extends BroadcastReceiver {
     * @param context  A context of the current app
     * @param id The id the observer was added for
     */
    static void removeObserver(@NonNull Context context, int id) {
    public static void removeObserver(@NonNull Context context, int id) {
        getReceiver(context).removeObserver(id);
    }

@@ -80,7 +80,8 @@ public class UninstallEventReceiver extends BroadcastReceiver {
     *
     * @return A new uninstall id
     */
    static int getNewId(@NonNull Context context) throws EventResultPersister.OutOfIdsException {
    public static int getNewId(@NonNull Context context)
        throws EventResultPersister.OutOfIdsException {
        return getReceiver(context).getNewId();
    }
}