Loading cmds/screencap/screencap.cpp +33 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <linux/fb.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <sys/wait.h> #include <binder/ProcessState.h> Loading Loading @@ -99,11 +100,38 @@ static uint32_t dataSpaceToInt(ui::Dataspace d) } static status_t notifyMediaScanner(const char* fileName) { String8 cmd("am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file://"); cmd.append(fileName); cmd.append(" > /dev/null"); int result = system(cmd.string()); if (result < 0) { std::string filePath("file://"); filePath.append(fileName); char *cmd[] = { (char*) "am", (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"); return UNKNOWN_ERROR; } Loading core/java/android/accounts/AccountManager.java +0 −29 Original line number Diff line number Diff line Loading @@ -1942,35 +1942,6 @@ public class AccountManager { }.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 * sure they are the owner of the account. The user-entered password can Loading core/java/android/accounts/IAccountManager.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -80,14 +80,11 @@ interface IAccountManager { String authTokenType); /* Shared accounts */ Account[] getSharedAccountsAsUser(int userId); boolean removeSharedAccountAsUser(in Account account, int userId); void addSharedAccountsFromParentUser(int parentUserId, int userId, String opPackageName); /* Account renaming. */ void renameAccount(in IAccountManagerResponse response, in Account accountToRename, String newName); String getPreviousName(in Account account); boolean renameSharedAccountAsUser(in Account accountToRename, String newName, int userId); /* Add account in two steps. */ void startAddAccountSession(in IAccountManagerResponse response, String accountType, Loading core/java/android/app/ActivityManagerInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -344,4 +344,7 @@ public abstract class ActivityManagerInternal { * Unregisters the specified {@code 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); } core/java/android/app/DisabledWallpaperManager.java +1 −6 Original line number Diff line number Diff line Loading @@ -41,8 +41,7 @@ final class DisabledWallpaperManager extends WallpaperManager { // Don't need to worry about synchronization private static DisabledWallpaperManager sInstance; // TODO(b/138939803): STOPSHIP changed to false and/or remove it private static final boolean DEBUG = true; private static final boolean DEBUG = false; @NonNull static DisabledWallpaperManager getInstance() { Loading @@ -66,10 +65,6 @@ final class DisabledWallpaperManager extends WallpaperManager { 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() { if (DEBUG) Log.w(TAG, "unsupported method called; returning null", new Exception()); return null; Loading Loading
cmds/screencap/screencap.cpp +33 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <linux/fb.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <sys/wait.h> #include <binder/ProcessState.h> Loading Loading @@ -99,11 +100,38 @@ static uint32_t dataSpaceToInt(ui::Dataspace d) } static status_t notifyMediaScanner(const char* fileName) { String8 cmd("am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file://"); cmd.append(fileName); cmd.append(" > /dev/null"); int result = system(cmd.string()); if (result < 0) { std::string filePath("file://"); filePath.append(fileName); char *cmd[] = { (char*) "am", (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"); return UNKNOWN_ERROR; } Loading
core/java/android/accounts/AccountManager.java +0 −29 Original line number Diff line number Diff line Loading @@ -1942,35 +1942,6 @@ public class AccountManager { }.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 * sure they are the owner of the account. The user-entered password can Loading
core/java/android/accounts/IAccountManager.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -80,14 +80,11 @@ interface IAccountManager { String authTokenType); /* Shared accounts */ Account[] getSharedAccountsAsUser(int userId); boolean removeSharedAccountAsUser(in Account account, int userId); void addSharedAccountsFromParentUser(int parentUserId, int userId, String opPackageName); /* Account renaming. */ void renameAccount(in IAccountManagerResponse response, in Account accountToRename, String newName); String getPreviousName(in Account account); boolean renameSharedAccountAsUser(in Account accountToRename, String newName, int userId); /* Add account in two steps. */ void startAddAccountSession(in IAccountManagerResponse response, String accountType, Loading
core/java/android/app/ActivityManagerInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -344,4 +344,7 @@ public abstract class ActivityManagerInternal { * Unregisters the specified {@code 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); }
core/java/android/app/DisabledWallpaperManager.java +1 −6 Original line number Diff line number Diff line Loading @@ -41,8 +41,7 @@ final class DisabledWallpaperManager extends WallpaperManager { // Don't need to worry about synchronization private static DisabledWallpaperManager sInstance; // TODO(b/138939803): STOPSHIP changed to false and/or remove it private static final boolean DEBUG = true; private static final boolean DEBUG = false; @NonNull static DisabledWallpaperManager getInstance() { Loading @@ -66,10 +65,6 @@ final class DisabledWallpaperManager extends WallpaperManager { 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() { if (DEBUG) Log.w(TAG, "unsupported method called; returning null", new Exception()); return null; Loading