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

Commit a6816ee7 authored by Christopher Tate's avatar Christopher Tate Committed by Android (Google) Code Review
Browse files

Merge "Merge: Introduce UpdateLocks"

parents 67d2c09d 8662cab5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ LOCAL_SRC_FILES += \
	core/java/android/os/IPermissionController.aidl \
	core/java/android/os/IPowerManager.aidl \
	core/java/android/os/IRemoteCallback.aidl \
	core/java/android/os/IUpdateLock.aidl \
	core/java/android/os/IVibratorService.aidl \
	core/java/android/service/wallpaper/IWallpaperConnection.aidl \
	core/java/android/service/wallpaper/IWallpaperEngine.aidl \
+1 −0
Original line number Diff line number Diff line
@@ -15343,6 +15343,7 @@ package android.os {
    method public abstract void acquired();
    method public void cleanup(android.os.IBinder, boolean);
    method public void dump();
    method public void dump(java.io.PrintWriter);
    method public boolean isAcquired();
    method public void release(android.os.IBinder);
    method public abstract void released();
+11 −0
Original line number Diff line number Diff line
@@ -1644,6 +1644,17 @@ public abstract class Context {
     */
    public static final String THROTTLE_SERVICE = "throttle";

    /**
     * Use with {@link #getSystemService} to retrieve a {@link
     * android.os.IUpdateLock} for managing runtime sequences that
     * must not be interrupted by headless OTA application or similar.
     *
     * @hide
     * @see #getSystemService
     * @see android.os.UpdateLock
     */
    public static final String UPDATE_LOCK_SERVICE = "updatelock";

    /**
     * Use with {@link #getSystemService} to retrieve a {@link
     * android.net.NetworkManagementService} for handling management of
+27 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 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 android.os;

/**
 * Direct interface to the UpdateLockService's functionality
 *
 * {@hide}
 */
interface IUpdateLock {
    void acquireUpdateLock(IBinder token, String tag);
    void releaseUpdateLock(IBinder token);
}
+20 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.os;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.WeakHashMap;
import java.util.Set;
import android.util.Log;
@@ -115,15 +117,31 @@ public abstract class TokenWatcher

    public void dump()
    {
        ArrayList<String> a = dumpInternal();
        for (String s : a) {
            Log.i(mTag, s);
        }
    }

    public void dump(PrintWriter pw) {
        ArrayList<String> a = dumpInternal();
        for (String s : a) {
            pw.println(s);
        }
    }

    private ArrayList<String> dumpInternal() {
        ArrayList<String> a = new ArrayList<String>();
        synchronized (mTokens) {
            Set<IBinder> keys = mTokens.keySet();
            Log.i(mTag, "Token count: " + mTokens.size());
            a.add("Token count: " + mTokens.size());
            int i = 0;
            for (IBinder b: keys) {
                Log.i(mTag, "[" + i + "] " + mTokens.get(b).tag + " - " + b);
                a.add("[" + i + "] " + mTokens.get(b).tag + " - " + b);
                i++;
            }
        }
        return a;
    }

    private Runnable mNotificationTask = new Runnable() {
Loading