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

Commit 16782467 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android (Google) Code Review
Browse files

Merge "Tell each VM to flush their DNS cache."

parents 38b2a89d 03595d01
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -85,6 +85,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.lang.ref.WeakReference;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Iterator;
@@ -585,6 +586,11 @@ public final class ActivityThread {
            TimeZone.setDefault(null);
            TimeZone.setDefault(null);
        }
        }


        public void clearDnsCache() {
            // a non-standard API to get this to libcore
            InetAddress.clearDnsCache();
        }

        public void processInBackground() {
        public void processInBackground() {
            mH.removeMessages(H.GC_WHEN_IDLE);
            mH.removeMessages(H.GC_WHEN_IDLE);
            mH.sendMessage(mH.obtainMessage(H.GC_WHEN_IDLE));
            mH.sendMessage(mH.obtainMessage(H.GC_WHEN_IDLE));
+14 −1
Original line number Original line Diff line number Diff line
@@ -291,6 +291,12 @@ public abstract class ApplicationThreadNative extends Binder
            return true;
            return true;
        }
        }


        case CLEAR_DNS_CACHE_TRANSACTION: {
            data.enforceInterface(IApplicationThread.descriptor);
            clearDnsCache();
            return true;
        }

        case PROCESS_IN_BACKGROUND_TRANSACTION: {
        case PROCESS_IN_BACKGROUND_TRANSACTION: {
            data.enforceInterface(IApplicationThread.descriptor);
            data.enforceInterface(IApplicationThread.descriptor);
            processInBackground();
            processInBackground();
@@ -744,6 +750,14 @@ class ApplicationThreadProxy implements IApplicationThread {
        data.recycle();
        data.recycle();
    }
    }


    public void clearDnsCache() throws RemoteException {
        Parcel data = Parcel.obtain();
        data.writeInterfaceToken(IApplicationThread.descriptor);
        mRemote.transact(CLEAR_DNS_CACHE_TRANSACTION, data, null,
                IBinder.FLAG_ONEWAY);
        data.recycle();
    }

    public void processInBackground() throws RemoteException {
    public void processInBackground() throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel data = Parcel.obtain();
        data.writeInterfaceToken(IApplicationThread.descriptor);
        data.writeInterfaceToken(IApplicationThread.descriptor);
@@ -884,4 +898,3 @@ class ApplicationThreadProxy implements IApplicationThread {
        data.recycle();
        data.recycle();
    }
    }
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -87,6 +87,7 @@ public interface IApplicationThread extends IInterface {
    void requestThumbnail(IBinder token) throws RemoteException;
    void requestThumbnail(IBinder token) throws RemoteException;
    void scheduleConfigurationChanged(Configuration config) throws RemoteException;
    void scheduleConfigurationChanged(Configuration config) throws RemoteException;
    void updateTimeZone() throws RemoteException;
    void updateTimeZone() throws RemoteException;
    void clearDnsCache() throws RemoteException;
    void processInBackground() throws RemoteException;
    void processInBackground() throws RemoteException;
    void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
    void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
            throws RemoteException;
            throws RemoteException;
@@ -146,4 +147,5 @@ public interface IApplicationThread extends IInterface {
    int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34;
    int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34;
    int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35;
    int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35;
    int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36;
    int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36;
    int CLEAR_DNS_CACHE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37;
}
}
+7 −0
Original line number Original line Diff line number Diff line
@@ -1222,6 +1222,13 @@ public class Intent implements Parcelable, Cloneable {
     */
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_TIMEZONE_CHANGED = "android.intent.action.TIMEZONE_CHANGED";
    public static final String ACTION_TIMEZONE_CHANGED = "android.intent.action.TIMEZONE_CHANGED";
    /**
     * Clear DNS Cache Action: This is broadcast when networks have changed and old
     * DNS entries should be tossed.
     * @hide
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_CLEAR_DNS_CACHE = "android.intent.action.CLEAR_DNS_CACHE";
    /**
    /**
     * Alarm Changed Action: This is broadcast when the AlarmClock
     * Alarm Changed Action: This is broadcast when the AlarmClock
     * application's alarm is set or unset.  It is used by the
     * application's alarm is set or unset.  It is used by the
+1 −0
Original line number Original line Diff line number Diff line
@@ -91,6 +91,7 @@
    <protected-broadcast android:name="android.nfc.action.TAG_DISCOVERED" />
    <protected-broadcast android:name="android.nfc.action.TAG_DISCOVERED" />
    <protected-broadcast android:name="android.nfc.action.LLCP_LINK_STATE_CHANGED" />
    <protected-broadcast android:name="android.nfc.action.LLCP_LINK_STATE_CHANGED" />
    <protected-broadcast android:name="android.nfc.action.TRANSACTION_DETECTED" />
    <protected-broadcast android:name="android.nfc.action.TRANSACTION_DETECTED" />
    <protected-broadcast android:name="android.intent.action.CLEAR_DNS_CACHE" />


    <!-- ====================================== -->
    <!-- ====================================== -->
    <!-- Permissions for things that cost money -->
    <!-- Permissions for things that cost money -->
Loading