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

Commit 5a0252da authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge changes Ib8b18f1b,I0d799d82,Ia6222322

* changes:
  Always give ContentResolver a valid Context.
  Define failed connections column, and reset.
  Add method to get process group.
parents b12db26f 66a017b6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21512,6 +21512,7 @@ package android.test.mock {
  public class MockContentResolver extends android.content.ContentResolver {
    ctor public MockContentResolver();
    ctor public MockContentResolver(android.content.Context);
    method public void addProvider(java.lang.String, android.content.ContentProvider);
  }
+4 −3
Original line number Diff line number Diff line
@@ -187,7 +187,8 @@ public final class ActivityThread {
            = new ArrayList<Application>();
    // set of instantiated backup agents, keyed by package name
    final HashMap<String, BackupAgent> mBackupAgents = new HashMap<String, BackupAgent>();
    static final ThreadLocal<ActivityThread> sThreadLocal = new ThreadLocal<ActivityThread>();
    /** Reference to singleton {@link ActivityThread} */
    private static ActivityThread sCurrentActivityThread;
    Instrumentation mInstrumentation;
    String mInstrumentationAppDir = null;
    String mInstrumentationAppLibraryDir = null;
@@ -1564,7 +1565,7 @@ public final class ActivityThread {
    }

    public static ActivityThread currentActivityThread() {
        return sThreadLocal.get();
        return sCurrentActivityThread;
    }

    public static String currentPackageName() {
@@ -4894,7 +4895,7 @@ public final class ActivityThread {
    }

    private void attach(boolean system) {
        sThreadLocal.set(this);
        sCurrentActivityThread = this;
        mSystemThread = system;
        if (!system) {
            ViewRootImpl.addFirstDrawHandler(new Runnable() {
+1 −0
Original line number Diff line number Diff line
@@ -1085,6 +1085,7 @@ public class DownloadManager {
        values.put(Downloads.Impl.COLUMN_TOTAL_BYTES, -1);
        values.putNull(Downloads.Impl._DATA);
        values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_PENDING);
        values.put(Downloads.Impl.COLUMN_FAILED_CONNECTIONS, 0);
        mResolver.update(mBaseUri, values, getWhereClauseForIds(ids), getWhereArgsForIds(ids));
    }

+3 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import dalvik.system.CloseGuard;

import android.accounts.Account;
import android.app.ActivityManagerNative;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.AssetFileDescriptor;
@@ -206,8 +207,8 @@ public abstract class ContentResolver {
    private final Random mRandom = new Random();  // guarded by itself

    public ContentResolver(Context context) {
        mContext = context;
        mPackageName = context.getPackageName();
        mContext = context != null ? context : ActivityThread.currentApplication();
        mPackageName = mContext.getPackageName();
    }

    /** @hide */
+9 −1
Original line number Diff line number Diff line
@@ -807,6 +807,14 @@ public class Process {
    public static final native void setProcessGroup(int pid, int group)
            throws IllegalArgumentException, SecurityException;

    /**
     * Return the scheduling group of requested process.
     *
     * @hide
     */
    public static final native int getProcessGroup(int pid)
            throws IllegalArgumentException, SecurityException;

    /**
     * Set the priority of the calling thread, based on Linux priorities.  See
     * {@link #setThreadPriority(int, int)} for more information.
Loading