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

Commit c028be4f authored by Suchi Amalapurapu's avatar Suchi Amalapurapu
Browse files

AppsOnSd feature - Add default container

Add new remote interface to do temporary copies. The new
remote stub handling is done on mHandler thread and doesn't need locking
for now.
Add new InstallArgs class and subclasses to isolate cases for installation.
Move resource deletion for failed installs/upgrades to later on in installation
cycle.
Fix code path for forward locked apps when using scanPackageLI

TODO's
Fix installation paths to completely use InstallArgs based design later on.
Get rid of using flags in various install/uninstall code paths.
Ideally InstallArgs should be created using these flags and used in the
rest of the code.
Function renames.
Revisit mount api's.
parent aeb41267
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ LOCAL_SRC_FILES += \
	core/java/android/speech/tts/ITtsCallback.aidl \
	core/java/com/android/internal/app/IBatteryStats.aidl \
	core/java/com/android/internal/app/IUsageStats.aidl \
	core/java/com/android/internal/app/IMediaContainerService.aidl \
	core/java/com/android/internal/appwidget/IAppWidgetService.aidl \
	core/java/com/android/internal/appwidget/IAppWidgetHost.aidl \
	core/java/com/android/internal/backup/IBackupTransport.aidl \
+17 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ int create_pkg_path(char path[PKG_PATH_MAX],
    }

    x = pkgname;
    int alpha = -1;
    while (*x) {
        if (isalnum(*x) || (*x == '_')) {
                /* alphanumeric or underscore are fine */
@@ -42,6 +43,10 @@ int create_pkg_path(char path[PKG_PATH_MAX],
                LOGE("invalid package name '%s'\n", pkgname);
                return -1;
            }
        } else if (*x == '-') {
            /* Suffix -X is fine to let versioning of packages.
               But whatever follows should be alphanumeric.*/
            alpha = 1;
        }else {
                /* anything not A-Z, a-z, 0-9, _, or . is invalid */
            LOGE("invalid package name '%s'\n", pkgname);
@@ -49,6 +54,17 @@ int create_pkg_path(char path[PKG_PATH_MAX],
        }
        x++;
    }
    if (alpha == 1) {
        // Skip current character
        x++;
        while (*x) {
            if (!isalnum(*x)) {
                LOGE("invalid package name '%s' should include only numbers after -\n", pkgname);
                return -1;
            }
            x++;
        }
    }

    sprintf(path, "%s%s%s", prefix, pkgname, postfix);
    return 0;
+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 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.internal.app;

import android.net.Uri;
import android.os.ParcelFileDescriptor;

interface IMediaContainerService {
    String copyResourceToContainer(in Uri packageURI,
                String containerId,
                String key, String resFileName);
    boolean copyResource(in Uri packageURI,
                in ParcelFileDescriptor outStream);
}
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
@@ -1202,6 +1202,16 @@
        android:description="@string/permdesc_cache_filesystem"
        android:protectionLevel="signatureOrSystem" />

    <!-- Must be required by default container service so that only
         the system can bind to it and use it to copy
         protected data to secure containers or files
         accessible to the system.
         @hide -->
    <permission android:name="android.permission.COPY_PROTECTED_DATA"
        android:label="@string/permlab_copyProtectedData"
        android:description="@string/permlab_copyProtectedData"
        android:protectionLevel="signature" />

    <application android:process="system"
                 android:persistent="true"
                 android:hasCode="false"
+6 −0
Original line number Diff line number Diff line
@@ -2102,6 +2102,12 @@
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_pkgUsageStats">Allows the modification of collected component usage statistics. Not for use by normal applications.</string>

    <!-- permission attributes related to default container service -->
    <!-- Title of an application permission that lets an application use default container service. -->
    <string name="permlab_copyProtectedData">Allows to invoke default container service to copy content. Not for use by normal applications.</string>
    <!-- Description of an application permission,  used to invoke default container service to copy content. -->
    <string name="permdesc_copyProtectedData">Allows to invoke default container service to copy content. Not for use by normal applications.</string>

    <!-- Shown in the tutorial for tap twice for zoom control. -->
    <string name="tutorial_double_tap_to_zoom_message_short">Tap twice for zoom control</string>

Loading