1 /* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.app; 18 import android.annotation.UnsupportedAppUsage; 19 import android.content.Intent; 20 import android.os.IBinder; 21 22 /** 23 * {@hide} 24 * @deprecated will be removed soon. See individual methods for alternatives. 25 */ 26 @Deprecated 27 public abstract class ActivityManagerNative { 28 /** 29 * Cast a Binder object into an activity manager interface, generating 30 * a proxy if needed. 31 * 32 * @deprecated use IActivityManager.Stub.asInterface instead. 33 */ 34 @UnsupportedAppUsage asInterface(IBinder obj)35 static public IActivityManager asInterface(IBinder obj) { 36 return IActivityManager.Stub.asInterface(obj); 37 } 38 39 /** 40 * Retrieve the system's default/global activity manager. 41 * 42 * @deprecated use ActivityManager.getService instead. 43 */ 44 @UnsupportedAppUsage getDefault()45 static public IActivityManager getDefault() { 46 return ActivityManager.getService(); 47 } 48 49 /** 50 * Convenience for checking whether the system is ready. For internal use only. 51 * 52 * @deprecated use ActivityManagerInternal.isSystemReady instead. 53 */ 54 @UnsupportedAppUsage isSystemReady()55 static public boolean isSystemReady() { 56 return ActivityManager.isSystemReady(); 57 } 58 59 /** 60 * @deprecated use ActivityManager.broadcastStickyIntent instead. 61 */ 62 @UnsupportedAppUsage broadcastStickyIntent(Intent intent, String permission, int userId)63 static public void broadcastStickyIntent(Intent intent, String permission, int userId) { 64 broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId); 65 } 66 67 /** 68 * Convenience for sending a sticky broadcast. For internal use only. 69 * If you don't care about permission, use null. 70 * 71 * @deprecated use ActivityManager.broadcastStickyIntent instead. 72 */ broadcastStickyIntent(Intent intent, String permission, int appOp, int userId)73 static public void broadcastStickyIntent(Intent intent, String permission, int appOp, 74 int userId) { 75 ActivityManager.broadcastStickyIntent(intent, appOp, userId); 76 } 77 78 /** 79 * @deprecated use ActivityManager.noteWakeupAlarm instead. 80 */ noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg, String tag)81 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg, 82 String tag) { 83 ActivityManager.noteWakeupAlarm(ps, null, sourceUid, sourcePkg, tag); 84 } 85 86 /** 87 * @deprecated use ActivityManager.noteAlarmStart instead. 88 */ noteAlarmStart(PendingIntent ps, int sourceUid, String tag)89 static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) { 90 ActivityManager.noteAlarmStart(ps, null, sourceUid, tag); 91 } 92 93 /** 94 * @deprecated use ActivityManager.noteAlarmFinish instead. 95 */ noteAlarmFinish(PendingIntent ps, int sourceUid, String tag)96 static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) { 97 ActivityManager.noteAlarmFinish(ps, null, sourceUid, tag); 98 } 99 } 100