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

Commit 805fd7ee authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add API to get path to OBBs.

Also hide the bitmap thumbnail stuff, we can't support it in its
current form.

And fix some bugs with propagating paths to native code.  Yikes!

Change-Id: I13ab37ddbdba5c073489cba5eab035117d3c1574
parent cf18c478
Loading
Loading
Loading
Loading
+210 −21
Original line number Diff line number Diff line
@@ -4250,6 +4250,17 @@
 visibility="public"
>
</field>
<field name="fastScrollTextColor"
 type="int"
 transient="false"
 volatile="false"
 value="16843611"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="fastScrollThumbDrawable"
 type="int"
 transient="false"
@@ -5812,6 +5823,17 @@
 visibility="public"
>
</field>
<field name="largeHeap"
 type="int"
 transient="false"
 volatile="false"
 value="16843612"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="largeScreens"
 type="int"
 transient="false"
@@ -11462,6 +11484,28 @@
 visibility="public"
>
</field>
<field name="notification_large_icon_height"
 type="int"
 transient="false"
 volatile="false"
 value="17104902"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="notification_large_icon_width"
 type="int"
 transient="false"
 volatile="false"
 value="17104901"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="thumbnail_height"
 type="int"
 transient="false"
@@ -25114,17 +25158,6 @@
 visibility="public"
>
</field>
<field name="TASKS_GET_THUMBNAILS"
 type="int"
 transient="false"
 volatile="false"
 value="4096"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="ActivityManager.MemoryInfo"
 extends="java.lang.Object"
@@ -25523,16 +25556,6 @@
 visibility="public"
>
</field>
<field name="thumbnail"
 type="android.graphics.Bitmap"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="ActivityManager.RunningAppProcessInfo"
 extends="java.lang.Object"
@@ -38947,6 +38970,17 @@
 visibility="public"
>
</method>
<method name="clearViews"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
</method>
<method name="createView"
 return="android.appwidget.AppWidgetHostView"
 abstract="false"
@@ -48119,6 +48153,17 @@
 visibility="public"
>
</method>
<method name="getObbDir"
 return="java.io.File"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getPackageCodePath"
 return="java.lang.String"
 abstract="true"
@@ -49727,6 +49772,17 @@
 visibility="public"
>
</method>
<method name="getObbDir"
 return="java.io.File"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getPackageCodePath"
 return="java.lang.String"
 abstract="false"
@@ -58210,6 +58266,17 @@
 visibility="public"
>
</field>
<field name="FLAG_LARGE_HEAP"
 type="int"
 transient="false"
 volatile="false"
 value="1048576"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FLAG_PERSISTENT"
 type="int"
 transient="false"
@@ -60220,6 +60287,19 @@
<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
</exception>
</method>
<method name="getPackageObbPaths"
 return="java.lang.String[]"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="packageName" type="java.lang.String">
</parameter>
</method>
<method name="getPackagesForUid"
 return="java.lang.String[]"
 abstract="true"
@@ -60706,6 +60786,21 @@
<parameter name="installerPackageName" type="java.lang.String">
</parameter>
</method>
<method name="setPackageObbPaths"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="packageName" type="java.lang.String">
</parameter>
<parameter name="paths" type="java.lang.String[]">
</parameter>
</method>
<field name="COMPONENT_ENABLED_STATE_DEFAULT"
 type="int"
 transient="false"
@@ -137446,6 +137541,34 @@
<parameter name="params" type="Params...">
</parameter>
</method>
<method name="execute"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="runnable" type="java.lang.Runnable">
</parameter>
</method>
<method name="executeOnExecutor"
 return="android.os.AsyncTask&lt;Params, Progress, Result&gt;"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="exec" type="java.util.concurrent.Executor">
</parameter>
<parameter name="params" type="Params...">
</parameter>
</method>
<method name="get"
 return="Result"
 abstract="false"
@@ -137578,6 +137701,16 @@
<parameter name="values" type="Progress...">
</parameter>
</method>
<field name="THREAD_POOL_EXECUTOR"
 type="java.util.concurrent.ThreadPoolExecutor"
 transient="false"
 volatile="false"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="AsyncTask.Status"
 extends="java.lang.Enum"
@@ -185171,6 +185304,19 @@
<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
</exception>
</method>
<method name="getPackageObbPaths"
 return="java.lang.String[]"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="packageName" type="java.lang.String">
</parameter>
</method>
<method name="getPackagesForUid"
 return="java.lang.String[]"
 abstract="false"
@@ -185670,6 +185816,21 @@
<parameter name="path" type="java.lang.String">
</parameter>
</method>
<method name="setPackageObbPaths"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="packageName" type="java.lang.String">
</parameter>
<parameter name="paths" type="java.lang.String[]">
</parameter>
</method>
</class>
<class name="MockResources"
 extends="android.content.res.Resources"
@@ -238084,6 +238245,34 @@
>
</field>
</class>
<class name="WebViewFragment"
 extends="android.app.Fragment"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="WebViewFragment"
 type="android.webkit.WebViewFragment"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<method name="getWebView"
 return="android.webkit.WebView"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
</class>
</package>
<package name="android.widget"
>
+22 −21
Original line number Diff line number Diff line
@@ -25158,17 +25158,6 @@
 visibility="public"
>
</field>
<field name="TASKS_GET_THUMBNAILS"
 type="int"
 transient="false"
 volatile="false"
 value="4096"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="ActivityManager.MemoryInfo"
 extends="java.lang.Object"
@@ -25567,16 +25556,6 @@
 visibility="public"
>
</field>
<field name="thumbnail"
 type="android.graphics.Bitmap"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="ActivityManager.RunningAppProcessInfo"
 extends="java.lang.Object"
@@ -48174,6 +48153,17 @@
 visibility="public"
>
</method>
<method name="getObbDir"
 return="java.io.File"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getPackageCodePath"
 return="java.lang.String"
 abstract="true"
@@ -49782,6 +49772,17 @@
 visibility="public"
>
</method>
<method name="getObbDir"
 return="java.io.File"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getPackageCodePath"
 return="java.lang.String"
 abstract="false"
+6 −4
Original line number Diff line number Diff line
@@ -122,6 +122,8 @@ public class ActivityManager {
        /**
         * Thumbnail representation of the task's last state.  Must
         * use {@link ActivityManager#TASKS_GET_THUMBNAILS} to have this set.
         * @hide -- this is not scalable, need to have a separate API to get
         * the bitmap.
         */
        public Bitmap thumbnail;

@@ -203,6 +205,7 @@ public class ActivityManager {
    /**
     * Flag for use with {@link #getRecentTasks}: also return the thumbnail
     * bitmap (if available) for each recent task.
     * @hide
     */
    public static final int TASKS_GET_THUMBNAILS = 0x0001000;
    
@@ -214,8 +217,7 @@ public class ActivityManager {
     * actual number returned may be smaller, depending on how many tasks the
     * user has started and the maximum number the system can remember.
     * @param flags Information about what to return.  May be any combination
     * of {@link #RECENT_WITH_EXCLUDED}, {@link #RECENT_IGNORE_UNAVAILABLE},
     * and {@link #TASKS_GET_THUMBNAILS}.
     * of {@link #RECENT_WITH_EXCLUDED} and {@link #RECENT_IGNORE_UNAVAILABLE}.
     * 
     * @return Returns a list of RecentTaskInfo records describing each of
     * the recent tasks.
@@ -261,8 +263,8 @@ public class ActivityManager {
        public ComponentName topActivity;

        /**
         * Thumbnail representation of the task's current state.  Must
         * use {@link ActivityManager#TASKS_GET_THUMBNAILS} to have this set.
         * Thumbnail representation of the task's current state.  Currently
         * always null.
         */
        public Bitmap thumbnail;

+12 −0
Original line number Diff line number Diff line
@@ -153,6 +153,7 @@ class ContextImpl extends Context {
    private File mPreferencesDir;
    private File mFilesDir;
    private File mCacheDir;
    private File mObbDir;
    private File mExternalFilesDir;
    private File mExternalCacheDir;

@@ -646,6 +647,17 @@ class ContextImpl extends Context {
        }
    }

    @Override
    public File getObbDir() {
        synchronized (mSync) {
            if (mObbDir == null) {
                mObbDir = Environment.getExternalStorageAppObbDirectory(
                        getPackageName());
            }
            return mObbDir;
        }
    }

    @Override
    public File getCacheDir() {
        synchronized (mSync) {
+2 −2
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback2,
    private boolean mDestroyed;
    
    private native int loadNativeCode(String path, String funcname, MessageQueue queue,
            String internalDataPath, String externalDataPath, int sdkVersion,
            String internalDataPath, String obbPath, String externalDataPath, int sdkVersion,
            AssetManager assetMgr, byte[] savedState);
    private native void unloadNativeCode(int handle);
    
@@ -191,7 +191,7 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback2,
                ? savedInstanceState.getByteArray(KEY_NATIVE_SAVED_STATE) : null;

        mNativeHandle = loadNativeCode(path, funcname, Looper.myQueue(),
                 getFilesDir().toString(),
                 getFilesDir().toString(), getObbDir().toString(),
                 Environment.getExternalStorageAppFilesDirectory(ai.packageName).toString(),
                 Build.VERSION.SDK_INT, getAssets(), nativeSavedState);
        
Loading