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

Commit d7785982 authored by Xin Li's avatar Xin Li Committed by Gerrit Code Review
Browse files

Merge "Merge QQ3A.200605.002 into master"

parents 5241a207 80fe5964
Loading
Loading
Loading
Loading
+33 −5
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/fb.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/mman.h>
#include <sys/wait.h>


#include <binder/ProcessState.h>
#include <binder/ProcessState.h>


@@ -99,11 +100,38 @@ static uint32_t dataSpaceToInt(ui::Dataspace d)
}
}


static status_t notifyMediaScanner(const char* fileName) {
static status_t notifyMediaScanner(const char* fileName) {
    String8 cmd("am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file://");
    std::string filePath("file://");
    cmd.append(fileName);
    filePath.append(fileName);
    cmd.append(" > /dev/null");
    char *cmd[] = {
    int result = system(cmd.string());
        (char*) "am",
    if (result < 0) {
        (char*) "broadcast",
        (char*) "am",
        (char*) "android.intent.action.MEDIA_SCANNER_SCAN_FILE",
        (char*) "-d",
        &filePath[0],
        nullptr
    };

    int status;
    int pid = fork();
    if (pid < 0){
       fprintf(stderr, "Unable to fork in order to send intent for media scanner.\n");
       return UNKNOWN_ERROR;
    }
    if (pid == 0){
        int fd = open("/dev/null", O_WRONLY);
        if (fd < 0){
            fprintf(stderr, "Unable to open /dev/null for media scanner stdout redirection.\n");
            exit(1);
        }
        dup2(fd, 1);
        int result = execvp(cmd[0], cmd);
        close(fd);
        exit(result);
    }
    wait(&status);

    if (status < 0) {
        fprintf(stderr, "Unable to broadcast intent for media scanner.\n");
        fprintf(stderr, "Unable to broadcast intent for media scanner.\n");
        return UNKNOWN_ERROR;
        return UNKNOWN_ERROR;
    }
    }
+0 −29
Original line number Original line Diff line number Diff line
@@ -1942,35 +1942,6 @@ public class AccountManager {
        }.start();
        }.start();
    }
    }


    /**
     * @hide
     * Removes the shared account.
     * @param account the account to remove
     * @param user the user to remove the account from
     * @return
     */
    public boolean removeSharedAccount(final Account account, UserHandle user) {
        try {
            boolean val = mService.removeSharedAccountAsUser(account, user.getIdentifier());
            return val;
        } catch (RemoteException re) {
            throw re.rethrowFromSystemServer();
        }
    }

    /**
     * @hide
     * @param user
     * @return
     */
    public Account[] getSharedAccounts(UserHandle user) {
        try {
            return mService.getSharedAccountsAsUser(user.getIdentifier());
        } catch (RemoteException re) {
            throw re.rethrowFromSystemServer();
        }
    }

    /**
    /**
     * Confirms that the user knows the password for an account to make extra
     * Confirms that the user knows the password for an account to make extra
     * sure they are the owner of the account.  The user-entered password can
     * sure they are the owner of the account.  The user-entered password can
+0 −3
Original line number Original line Diff line number Diff line
@@ -80,14 +80,11 @@ interface IAccountManager {
        String authTokenType);
        String authTokenType);


    /* Shared accounts */
    /* Shared accounts */
    Account[] getSharedAccountsAsUser(int userId);
    boolean removeSharedAccountAsUser(in Account account, int userId);
    void addSharedAccountsFromParentUser(int parentUserId, int userId, String opPackageName);
    void addSharedAccountsFromParentUser(int parentUserId, int userId, String opPackageName);


    /* Account renaming. */
    /* Account renaming. */
    void renameAccount(in IAccountManagerResponse response, in Account accountToRename, String newName);
    void renameAccount(in IAccountManagerResponse response, in Account accountToRename, String newName);
    String getPreviousName(in Account account);
    String getPreviousName(in Account account);
    boolean renameSharedAccountAsUser(in Account accountToRename, String newName, int userId);


    /* Add account in two steps. */
    /* Add account in two steps. */
    void startAddAccountSession(in IAccountManagerResponse response, String accountType,
    void startAddAccountSession(in IAccountManagerResponse response, String accountType,
+3 −0
Original line number Original line Diff line number Diff line
@@ -344,4 +344,7 @@ public abstract class ActivityManagerInternal {
     * Unregisters the specified {@code processObserver}.
     * Unregisters the specified {@code processObserver}.
     */
     */
    public abstract void unregisterProcessObserver(IProcessObserver processObserver);
    public abstract void unregisterProcessObserver(IProcessObserver processObserver);

    /** Returns true if the given UID is registered as an active instrumentation. */
    public abstract boolean isActiveInstrumentation(int uid);
}
}
+1 −6
Original line number Original line Diff line number Diff line
@@ -41,8 +41,7 @@ final class DisabledWallpaperManager extends WallpaperManager {
    // Don't need to worry about synchronization
    // Don't need to worry about synchronization
    private static DisabledWallpaperManager sInstance;
    private static DisabledWallpaperManager sInstance;


    // TODO(b/138939803): STOPSHIP changed to false and/or remove it
    private static final boolean DEBUG = false;
    private static final boolean DEBUG = true;


    @NonNull
    @NonNull
    static DisabledWallpaperManager getInstance() {
    static DisabledWallpaperManager getInstance() {
@@ -66,10 +65,6 @@ final class DisabledWallpaperManager extends WallpaperManager {
        return false;
        return false;
    }
    }


    // TODO(b/138939803): STOPSHIP methods below should not be necessary,
    // callers should check if isWallpaperSupported(), consider removing them to keep this class
    // simpler

    private static <T> T unsupported() {
    private static <T> T unsupported() {
        if (DEBUG) Log.w(TAG, "unsupported method called; returning null", new Exception());
        if (DEBUG) Log.w(TAG, "unsupported method called; returning null", new Exception());
        return null;
        return null;
Loading