Search in sources :

Example 46 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class SyncManager method sendSyncFinishedOrCanceledMessage.

private void sendSyncFinishedOrCanceledMessage(ActiveSyncContext syncContext, SyncResult syncResult) {
    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "sending MESSAGE_SYNC_FINISHED");
    Message msg = mSyncHandler.obtainMessage();
    msg.what = SyncHandler.MESSAGE_SYNC_FINISHED;
    msg.obj = new SyncHandlerMessagePayload(syncContext, syncResult);
    mSyncHandler.sendMessage(msg);
}
Also used : Message(android.os.Message)

Example 47 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class SyncManager method sendCancelSyncsMessage.

private void sendCancelSyncsMessage(final Account account, final int userId, final String authority) {
    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "sending MESSAGE_CANCEL");
    Message msg = mSyncHandler.obtainMessage();
    msg.what = SyncHandler.MESSAGE_CANCEL;
    msg.obj = Pair.create(account, authority);
    msg.arg1 = userId;
    mSyncHandler.sendMessage(msg);
}
Also used : Message(android.os.Message)

Example 48 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class PackageManagerService method updateExternalMediaStatus.

/*
     * Update media status on PackageManager.
     */
public void updateExternalMediaStatus(final boolean mediaStatus, final boolean reportStatus) {
    int callingUid = Binder.getCallingUid();
    if (callingUid != 0 && callingUid != Process.SYSTEM_UID) {
        throw new SecurityException("Media status can only be updated by the system");
    }
    // be a different lock in that case.
    synchronized (mPackages) {
        Log.i(TAG, "Updating external media status from " + (mMediaMounted ? "mounted" : "unmounted") + " to " + (mediaStatus ? "mounted" : "unmounted"));
        if (DEBUG_SD_INSTALL)
            Log.i(TAG, "updateExternalMediaStatus:: mediaStatus=" + mediaStatus + ", mMediaMounted=" + mMediaMounted);
        if (mediaStatus == mMediaMounted) {
            final Message msg = mHandler.obtainMessage(UPDATED_MEDIA_STATUS, reportStatus ? 1 : 0, -1);
            mHandler.sendMessage(msg);
            return;
        }
        mMediaMounted = mediaStatus;
    }
    // Queue up an async operation since the package installation may take a
    // little while.
    mHandler.post(new Runnable() {

        public void run() {
            updateExternalMediaStatusInner(mediaStatus, reportStatus, true);
        }
    });
}
Also used : Message(android.os.Message)

Example 49 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class PackageManagerService method installPackageWithVerificationAndEncryption.

public void installPackageWithVerificationAndEncryption(Uri packageURI, IPackageInstallObserver observer, int flags, String installerPackageName, VerificationParams verificationParams, ContainerEncryptionParams encryptionParams) {
    mContext.enforceCallingOrSelfPermission(android.Manifest.permission.INSTALL_PACKAGES, null);
    final int uid = Binder.getCallingUid();
    if (isUserRestricted(UserHandle.getUserId(uid), UserManager.DISALLOW_INSTALL_APPS)) {
        try {
            observer.packageInstalled("", PackageManager.INSTALL_FAILED_USER_RESTRICTED);
        } catch (RemoteException re) {
        }
        return;
    }
    UserHandle user;
    if ((flags & PackageManager.INSTALL_ALL_USERS) != 0) {
        user = UserHandle.ALL;
    } else {
        user = new UserHandle(UserHandle.getUserId(uid));
    }
    final int filteredFlags;
    if (uid == Process.SHELL_UID || uid == 0) {
        if (DEBUG_INSTALL) {
            Slog.v(TAG, "Install from ADB");
        }
        filteredFlags = flags | PackageManager.INSTALL_FROM_ADB;
    } else {
        filteredFlags = flags & ~PackageManager.INSTALL_FROM_ADB;
    }
    verificationParams.setInstallerUid(uid);
    final Message msg = mHandler.obtainMessage(INIT_COPY);
    msg.obj = new InstallParams(packageURI, observer, filteredFlags, installerPackageName, verificationParams, encryptionParams, user);
    mHandler.sendMessage(msg);
}
Also used : Message(android.os.Message) UserHandle(android.os.UserHandle) RemoteException(android.os.RemoteException)

Example 50 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class PackageManagerService method getPackageSizeInfo.

public void getPackageSizeInfo(final String packageName, int userHandle, final IPackageStatsObserver observer) {
    mContext.enforceCallingOrSelfPermission(android.Manifest.permission.GET_PACKAGE_SIZE, null);
    PackageStats stats = new PackageStats(packageName, userHandle);
    /*
         * Queue up an async operation since the package measurement may take a
         * little while.
         */
    Message msg = mHandler.obtainMessage(INIT_COPY);
    msg.obj = new MeasureParams(stats, observer);
    mHandler.sendMessage(msg);
}
Also used : Message(android.os.Message) PackageStats(android.content.pm.PackageStats)

Aggregations

Message (android.os.Message)3198 Handler (android.os.Handler)347 RemoteException (android.os.RemoteException)263 Bundle (android.os.Bundle)210 Test (org.junit.Test)144 Intent (android.content.Intent)130 IOException (java.io.IOException)124 Point (android.graphics.Point)86 HashMap (java.util.HashMap)77 SomeArgs (com.android.internal.os.SomeArgs)67 SmallTest (android.test.suitebuilder.annotation.SmallTest)64 Messenger (android.os.Messenger)63 ArrayList (java.util.ArrayList)59 View (android.view.View)52 File (java.io.File)50 MediumTest (android.test.suitebuilder.annotation.MediumTest)43 TextView (android.widget.TextView)41 IBinder (android.os.IBinder)38 Map (java.util.Map)37 PendingIntent (android.app.PendingIntent)33