Pass correct user id for the extra

This was causing PrintManagerService to get a broadcast with an incorrect
userid and ended up crashing the SettingsProvider.

Bug: 10608503
Change-Id: I4693de181ddfa599d685ac9bd16ac15cea8b2e52
This commit is contained in:
Amith Yamasani
2013-09-03 17:44:49 -07:00
parent 6dde146df0
commit e63cc20570

View File

@@ -36,6 +36,7 @@ import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Process; import android.os.Process;
import android.os.UserHandle;
import android.preference.PreferenceActivity; import android.preference.PreferenceActivity;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
@@ -470,7 +471,7 @@ public class PowerUsageDetail extends Fragment implements Button.OnClickListener
Uri.fromParts("package", mPackages[0], null)); Uri.fromParts("package", mPackages[0], null));
intent.putExtra(Intent.EXTRA_PACKAGES, mPackages); intent.putExtra(Intent.EXTRA_PACKAGES, mPackages);
intent.putExtra(Intent.EXTRA_UID, mUid); intent.putExtra(Intent.EXTRA_UID, mUid);
intent.putExtra(Intent.EXTRA_USER_HANDLE, mUid); intent.putExtra(Intent.EXTRA_USER_HANDLE, UserHandle.getUserId(mUid));
getActivity().sendOrderedBroadcast(intent, null, mCheckKillProcessesReceiver, null, getActivity().sendOrderedBroadcast(intent, null, mCheckKillProcessesReceiver, null,
Activity.RESULT_CANCELED, null, null); Activity.RESULT_CANCELED, null, null);
} }