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

Commit 2caa215a authored by The Android Open Source Project's avatar The Android Open Source Project
Browse files

Merge commit 'remotes/goog/eclair' into eclair-release

parents e89fec34 8e55eacc
Loading
Loading
Loading
Loading
+181 −13
Original line number Diff line number Diff line
@@ -23166,6 +23166,21 @@
<parameter name="id" type="int">
</parameter>
</method>
<method name="cancel"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="tag" type="java.lang.String">
</parameter>
<parameter name="id" type="int">
</parameter>
</method>
<method name="cancelAll"
 return="void"
 abstract="false"
@@ -23192,6 +23207,23 @@
<parameter name="notification" type="android.app.Notification">
</parameter>
</method>
<method name="notify"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="tag" type="java.lang.String">
</parameter>
<parameter name="id" type="int">
</parameter>
<parameter name="notification" type="android.app.Notification">
</parameter>
</method>
</class>
<class name="PendingIntent"
 extends="java.lang.Object"
@@ -41594,6 +41626,19 @@
<parameter name="appInfo" type="android.content.pm.ApplicationInfo">
</parameter>
</method>
<method name="hasSystemFeature"
 return="boolean"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="name" type="java.lang.String">
</parameter>
</method>
<method name="isSafeMode"
 return="boolean"
 abstract="true"
@@ -122805,7 +122850,7 @@
 type="android.telephony.NeighboringCellInfo"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</constructor>
@@ -122813,7 +122858,7 @@
 type="android.telephony.NeighboringCellInfo"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="rssi" type="int">
@@ -122853,6 +122898,39 @@
 visibility="public"
>
</method>
<method name="getLac"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getNetworkType"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getPsc"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getRssi"
 return="int"
 abstract="false"
@@ -122871,7 +122949,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="cid" type="int">
@@ -122884,7 +122962,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="rssi" type="int">
@@ -125204,6 +125282,28 @@
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_1xRTT"
 type="int"
 transient="false"
 volatile="false"
 value="7"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_CDMA"
 type="int"
 transient="false"
 volatile="false"
 value="4"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_EDGE"
 type="int"
 transient="false"
@@ -125215,6 +125315,28 @@
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_EVDO_0"
 type="int"
 transient="false"
 volatile="false"
 value="5"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_EVDO_A"
 type="int"
 transient="false"
 volatile="false"
 value="6"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_GPRS"
 type="int"
 transient="false"
@@ -125226,6 +125348,39 @@
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_HSDPA"
 type="int"
 transient="false"
 volatile="false"
 value="8"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_HSPA"
 type="int"
 transient="false"
 volatile="false"
 value="10"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_HSUPA"
 type="int"
 transient="false"
 volatile="false"
 value="9"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="NETWORK_TYPE_UMTS"
 type="int"
 transient="false"
@@ -131235,6 +131390,19 @@
<parameter name="appInfo" type="android.content.pm.ApplicationInfo">
</parameter>
</method>
<method name="hasSystemFeature"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="name" type="java.lang.String">
</parameter>
</method>
<method name="isSafeMode"
 return="boolean"
 abstract="false"
@@ -196727,7 +196895,7 @@
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<constructor name="AllocationLimitError"
@@ -196933,7 +197101,7 @@
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<constructor name="PotentialDeadlockError"
@@ -196960,7 +197128,7 @@
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<constructor name="StaleDexCacheError"
@@ -196987,7 +197155,7 @@
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<constructor name="TemporaryDirectory"
@@ -197030,7 +197198,7 @@
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<constructor name="TouchDex"
@@ -197073,7 +197241,7 @@
 abstract="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<method name="dumpHprofData"
@@ -197577,7 +197745,7 @@
 abstract="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<method name="gcSoftReferences"
@@ -197678,7 +197846,7 @@
 abstract="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<constructor name="VMStack"
@@ -197745,7 +197913,7 @@
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<method name="fork"
+119 −127
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.commands.pm;

import android.content.ComponentName;
import android.content.pm.ApplicationInfo;
import android.content.pm.FeatureInfo;
import android.content.pm.IPackageDeleteObserver;
import android.content.pm.IPackageInstallObserver;
import android.content.pm.IPackageManager;
@@ -34,6 +35,8 @@ import android.os.RemoteException;
import android.os.ServiceManager;

import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -135,6 +138,7 @@ public final class Pm {
     * pm list [package | packages]
     * pm list permission-groups
     * pm list permissions
     * pm list features
     * pm list instrumentation
     */
    private void runList() {
@@ -150,6 +154,8 @@ public final class Pm {
            runListPermissionGroups();
        } else if ("permissions".equals(type)) {
            runListPermissions();
        } else if ("features".equals(type)) {
            runListFeatures();
        } else if ("instrumentation".equals(type)) {
            runListInstrumentation();
        } else {
@@ -202,6 +208,44 @@ public final class Pm {
        }
    }

    /**
     * Lists all of the features supported by the current device.
     *
     * pm list features
     */
    private void runListFeatures() {
        try {
            List<FeatureInfo> list = new ArrayList<FeatureInfo>();
            FeatureInfo[] rawList = mPm.getSystemAvailableFeatures();
            for (int i=0; i<rawList.length; i++) {
                list.add(rawList[i]);
            }
                    

            // Sort by name
            Collections.sort(list, new Comparator<FeatureInfo>() {
                public int compare(FeatureInfo o1, FeatureInfo o2) {
                    if (o1.name == o2.name) return 0;
                    if (o1.name == null) return -1;
                    if (o2.name == null) return 1;
                    return o1.name.compareTo(o2.name);
                }
            });

            int count = (list != null) ? list.size() : 0;
            for (int p = 0; p < count; p++) {
                FeatureInfo fi = list.get(p);
                System.out.print("feature:");
                if (fi.name != null) System.out.println(fi.name);
                else System.out.println("reqGlEsVersion=0x"
                        + Integer.toHexString(fi.reqGlEsVersion));
            }
        } catch (RemoteException e) {
            System.err.println(e.toString());
            System.err.println(PM_NOT_RUNNING_ERR);
        }
    }

    /**
     * Lists all of the installed instrumentation, or all for a given package
     *
@@ -498,92 +542,37 @@ public final class Pm {
        }
    }

    /**
     * Converts a failure code into a string by using reflection to find a matching constant
     * in PackageManager.
     */
    private String installFailureToString(int result) {
        String s;
        switch (result) {
        case PackageManager.INSTALL_FAILED_ALREADY_EXISTS:
            s = "INSTALL_FAILED_ALREADY_EXISTS";
            break;
        case PackageManager.INSTALL_FAILED_INVALID_APK:
            s = "INSTALL_FAILED_INVALID_APK";
            break;
        case PackageManager.INSTALL_FAILED_INVALID_URI:
            s = "INSTALL_FAILED_INVALID_URI";
            break;
        case PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE:
            s = "INSTALL_FAILED_INSUFFICIENT_STORAGE";
            break;
        case PackageManager.INSTALL_FAILED_DUPLICATE_PACKAGE:
            s = "INSTALL_FAILED_DUPLICATE_PACKAGE";
            break;
        case PackageManager.INSTALL_FAILED_NO_SHARED_USER:
            s = "INSTALL_FAILED_NO_SHARED_USER";
            break;
        case PackageManager.INSTALL_FAILED_UPDATE_INCOMPATIBLE:
            s = "INSTALL_FAILED_UPDATE_INCOMPATIBLE";
            break;
        case PackageManager.INSTALL_FAILED_SHARED_USER_INCOMPATIBLE:
            s = "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE";
            break;
        case PackageManager.INSTALL_FAILED_MISSING_SHARED_LIBRARY:
            s = "INSTALL_FAILED_MISSING_SHARED_LIBRARY";
            break;
        case PackageManager.INSTALL_FAILED_DEXOPT:
            s = "INSTALL_FAILED_DEXOPT";
            break;
        case PackageManager.INSTALL_FAILED_OLDER_SDK:
            s = "INSTALL_FAILED_OLDER_SDK";
            break;
        case PackageManager.INSTALL_FAILED_CONFLICTING_PROVIDER:
            s = "INSTALL_FAILED_CONFLICTING_PROVIDER";
            break;
        case PackageManager.INSTALL_FAILED_NEWER_SDK:
            s = "INSTALL_FAILED_NEWER_SDK";
            break;
        case PackageManager.INSTALL_FAILED_TEST_ONLY:
            s = "INSTALL_FAILED_TEST_ONLY";
            break;
        case PackageManager.INSTALL_FAILED_CPU_ABI_INCOMPATIBLE:
            s = "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE";
            break;
        case PackageManager.INSTALL_FAILED_MISSING_FEATURE:
            s = "INSTALL_FAILED_MISSING_FEATURE";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_NOT_APK:
            s = "INSTALL_PARSE_FAILED_NOT_APK";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_BAD_MANIFEST:
            s = "INSTALL_PARSE_FAILED_BAD_MANIFEST";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION:
            s = "INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_NO_CERTIFICATES:
            s = "INSTALL_PARSE_FAILED_NO_CERTIFICATES";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES:
            s = "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING:
            s = "INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME:
            s = "INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID:
            s = "INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED:
            s = "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED";
            break;
        case PackageManager.INSTALL_PARSE_FAILED_MANIFEST_EMPTY:
            s = "INSTALL_PARSE_FAILED_MANIFEST_EMPTY";
            break;
        default:
            s = Integer.toString(result);
        break;
        Field[] fields = PackageManager.class.getFields();
        for (Field f: fields) {
            if (f.getType() == int.class) {
                int modifiers = f.getModifiers();
                // only look at public final static fields.
                if (((modifiers & Modifier.FINAL) != 0) &&
                        ((modifiers & Modifier.PUBLIC) != 0) &&
                        ((modifiers & Modifier.STATIC) != 0)) {
                    String fieldName = f.getName();
                    if (fieldName.startsWith("INSTALL_FAILED_") ||
                            fieldName.startsWith("INSTALL_PARSE_FAILED_")) {
                        // get the int value and compare it to result.
                        try {
                            if (result == f.getInt(null)) {
                                return fieldName;
                            }
                        } catch (IllegalAccessException e) {
                            // this shouldn't happen since we only look for public static fields.
                        }
                    }
                }
            }
        return s;
        }

        // couldn't find a matching constant? return the value
        return Integer.toString(result);
    }

    private void runInstall() {
@@ -831,6 +820,7 @@ public final class Pm {
        System.err.println("       pm list permission-groups");
        System.err.println("       pm list permissions [-g] [-f] [-d] [-u] [GROUP]");
        System.err.println("       pm list instrumentation [-f] [TARGET-PACKAGE]");
        System.err.println("       pm list features");
        System.err.println("       pm path PACKAGE");
        System.err.println("       pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] PATH");
        System.err.println("       pm uninstall [-k] PACKAGE");
@@ -855,6 +845,8 @@ public final class Pm {
        System.err.println("or only those that target a specified package.  Options:");
        System.err.println("  -f: see their associated file.");
        System.err.println("");
        System.err.println("The list features command prints all features of the system.");
        System.err.println("");
        System.err.println("The path command prints the path to the .apk of a package.");
        System.err.println("");
        System.err.println("The install command installs a package to the system.  Options:");
+2 −2
Original line number Diff line number Diff line
@@ -3020,9 +3020,9 @@ public class Activity extends ContextThemeWrapper
     * or {@link #finish} to specify an explicit transition animation to
     * perform next.
     * @param enterAnim A resource ID of the animation resource to use for
     * the incoming activity.
     * the incoming activity.  Use 0 for no animation.
     * @param exitAnim A resource ID of the animation resource to use for
     * the outgoing activity.
     * the outgoing activity.  Use 0 for no animation.
     */
    public void overridePendingTransition(int enterAnim, int exitAnim) {
        try {
+7 −5
Original line number Diff line number Diff line
@@ -2951,8 +2951,8 @@ public final class ActivityThread {

            // The window is now visible if it has been added, we are not
            // simply finishing, and we are not starting another activity.
            if (!r.activity.mFinished && r.activity.mDecor != null
                    && !r.hideForNow) {
            if (!r.activity.mFinished && !a.mStartedActivity
                    && r.activity.mDecor != null && !r.hideForNow) {
                if (r.newConfig != null) {
                    performConfigurationChanged(r.activity, r.newConfig);
                    r.newConfig = null;
@@ -2966,10 +2966,12 @@ public final class ActivityThread {
                    l.softInputMode = (l.softInputMode
                            & (~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION))
                            | forwardBit;
                    if (r.activity.mVisibleFromClient) {
                        ViewManager wm = a.getWindowManager();
                        View decor = r.window.getDecorView();
                        wm.updateViewLayout(decor, l);
                    }
                }
                r.activity.mVisibleFromServer = true;
                mNumVisibleActivities++;
                if (r.activity.mVisibleFromClient) {
+9 −0
Original line number Diff line number Diff line
@@ -1685,6 +1685,15 @@ class ApplicationContext extends Context {
            }
        }
        
        @Override
        public boolean hasSystemFeature(String name) {
            try {
                return mPM.hasSystemFeature(name);
            } catch (RemoteException e) {
                throw new RuntimeException("Package manager has died", e);
            }
        }
        
        @Override
        public int checkPermission(String permName, String pkgName) {
            try {
Loading