Skip to content

Commit

Permalink
Revert "framework: Privacy Guard"
Browse files Browse the repository at this point in the history
Change-Id: I82ab85092e54c577a0817f3bedc85063c9a3054a
  • Loading branch information
Danesh authored and maniac103 committed Sep 9, 2013
1 parent 8a72073 commit b8d1ef8
Show file tree
Hide file tree
Showing 29 changed files with 9 additions and 476 deletions.
22 changes: 0 additions & 22 deletions core/java/android/app/ActivityManagerNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -1888,15 +1888,6 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
return true;
}

case IS_PRIVACY_GUARD_ENABLED_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
int pid = data.readInt();
boolean res = isPrivacyGuardEnabledForProcess(pid);
reply.writeNoException();
reply.writeInt(res ? 1 : 0);
return true;
}

}

return super.onTransact(code, data, reply, flags);
Expand Down Expand Up @@ -4322,18 +4313,5 @@ public void hang(IBinder who, boolean allowRestart) throws RemoteException {
reply.recycle();
}

public boolean isPrivacyGuardEnabledForProcess(int pid) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeInt(pid);
mRemote.transact(IS_PRIVACY_GUARD_ENABLED_TRANSACTION, data, reply, 0);
reply.readException();
int res = reply.readInt();
data.recycle();
reply.recycle();
return res == 1;
}

private IBinder mRemote;
}
20 changes: 0 additions & 20 deletions core/java/android/app/ApplicationPackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Binder;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
Expand Down Expand Up @@ -1310,25 +1309,6 @@ public int getApplicationEnabledSetting(String packageName) {
return PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
}

@Override
public void setPrivacyGuardSetting(String packageName, boolean enabled) {
try {
mPM.setPrivacyGuardSetting(packageName, enabled, mContext.getUserId());
} catch (RemoteException e) {
// Should never happen!
}
}

@Override
public boolean getPrivacyGuardSetting(String packageName) {
try {
return mPM.getPrivacyGuardSetting(packageName, mContext.getUserId());
} catch (RemoteException e) {
// Should never happen!
}
return false;
}

/**
* @hide
*/
Expand Down
10 changes: 0 additions & 10 deletions core/java/android/app/ContextImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1592,16 +1592,6 @@ private WallpaperManager getWallpaperManager() {
return new DropBoxManager(service);
}

@Override
public boolean isPrivacyGuardEnabled() {
try {
return ActivityManagerNative.getDefault().isPrivacyGuardEnabledForProcess(Binder.getCallingPid());
} catch (RemoteException e) {
Log.e(TAG, e.getMessage(), e);
}
return false;
}

@Override
public int checkPermission(String permission, int pid, int uid) {
if (permission == null) {
Expand Down
5 changes: 1 addition & 4 deletions core/java/android/app/IActivityManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ public int handleIncomingUser(int callingPid, int callingUid, int userId, boolea

public void setProcessForeground(IBinder token, int pid,
boolean isForeground) throws RemoteException;

public boolean isPrivacyGuardEnabledForProcess(int pid) throws RemoteException;


public int checkPermission(String permission, int pid, int uid)
throws RemoteException;

Expand Down Expand Up @@ -644,6 +642,5 @@ private WaitResult(Parcel source) {
int KILL_UID_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+164;
int SET_USER_IS_MONKEY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+165;
int HANG_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+166;
int IS_PRIVACY_GUARD_ENABLED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+167;
int GET_CALLING_PACKAGE_FOR_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+168;
}
10 changes: 0 additions & 10 deletions core/java/android/content/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -2311,16 +2311,6 @@ public abstract boolean startInstrumentation(ComponentName className,
*/
public static final String APP_OPS_SERVICE = "appops";

/**
* Determine whether the application or calling application has
* privacy guard. This is a privacy feature intended to permit the user
* to control access to personal data. Applications and content providers
* can check this value if they wish to honor privacy guard.
*
* @hide
*/
public abstract boolean isPrivacyGuardEnabled();

/**
* Determine whether the given permission is allowed for a particular
* process and user ID running in the system.
Expand Down
6 changes: 0 additions & 6 deletions core/java/android/content/ContextWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,6 @@ public Object getSystemService(String name) {
return mBase.getSystemService(name);
}

/** @hide */
@Override
public boolean isPrivacyGuardEnabled() {
return mBase.isPrivacyGuardEnabled();
}

@Override
public int checkPermission(String permission, int pid, int uid) {
return mBase.checkPermission(permission, pid, uid);
Expand Down
6 changes: 1 addition & 5 deletions core/java/android/content/pm/IPackageManager.aidl
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,7 @@ interface IPackageManager {

int getPreferredActivities(out List<IntentFilter> outFilters,
out List<ComponentName> outActivities, String packageName);

boolean getPrivacyGuardSetting(in String packageName, int userId);

void setPrivacyGuardSetting(in String packageName, boolean enabled, int userId);


/**
* As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
*/
Expand Down
16 changes: 0 additions & 16 deletions core/java/android/content/pm/PackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -3118,22 +3118,6 @@ public abstract void setApplicationEnabledSetting(String packageName,
*/
public abstract int getApplicationEnabledSetting(String packageName);

/**
* @param packageName
* @return
*
* @hide
*/
public abstract boolean getPrivacyGuardSetting(String packageName);

/**
* @param packageName
* @param enabled
*
* @hide
*/
public abstract void setPrivacyGuardSetting(String packageName, boolean enabled);

/**
* Return whether the device has been booted into safe mode.
*/
Expand Down
3 changes: 0 additions & 3 deletions core/java/android/content/pm/PackageUserState.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class PackageUserState {
public boolean notLaunched;
public boolean installed;
public int enabled;
public boolean privacyGuard;

public String lastDisableAppCaller;

Expand All @@ -39,15 +38,13 @@ public class PackageUserState {
public PackageUserState() {
installed = true;
enabled = COMPONENT_ENABLED_STATE_DEFAULT;
privacyGuard = false;
}

public PackageUserState(PackageUserState o) {
installed = o.installed;
stopped = o.stopped;
notLaunched = o.notLaunched;
enabled = o.enabled;
privacyGuard = o.privacyGuard;
lastDisableAppCaller = o.lastDisableAppCaller;
disabledComponents = o.disabledComponents != null
? new HashSet<String>(o.disabledComponents) : null;
Expand Down
74 changes: 0 additions & 74 deletions core/java/android/database/MemoryCursor.java

This file was deleted.

18 changes: 1 addition & 17 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.ActivityManagerNative;
import android.app.SearchManager;
import android.app.WallpaperManager;
import android.content.ComponentName;
Expand All @@ -38,7 +37,6 @@
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.BatteryManager;
import android.os.Binder;
import android.os.Bundle;
import android.os.DropBoxManager;
import android.os.IBinder;
Expand Down Expand Up @@ -5189,12 +5187,6 @@ public static boolean putFloatForUser(ContentResolver cr, String name, float val
*/
public static final String ADVANCED_REBOOT = "advanced_reboot";

/**
* Whether newly installed apps should run with privacy guard by default
* @hide
*/
public static final String PRIVACY_GUARD_DEFAULT = "privacy_guard_default";

/**
* This are the settings to be backed up.
*
Expand Down Expand Up @@ -5242,8 +5234,7 @@ public static boolean putFloatForUser(ContentResolver cr, String name, float val
DIALPAD_AUTOCOMPLETE,
LOCK_SCREEN_OWNER_INFO,
LOCK_SCREEN_OWNER_INFO_ENABLED,
ADVANCED_REBOOT,
PRIVACY_GUARD_DEFAULT
ADVANCED_REBOOT
};

/**
Expand All @@ -5265,13 +5256,6 @@ public static final boolean isLocationProviderEnabled(ContentResolver cr, String
* @hide
*/
public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
try {
if (ActivityManagerNative.getDefault().isPrivacyGuardEnabledForProcess(Binder.getCallingPid())) {
return false;
}
} catch (RemoteException e) {
// ignore
}
String allowedProviders = Settings.Secure.getStringForUser(cr,
LOCATION_PROVIDERS_ALLOWED, userId);
return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Expand Down
6 changes: 0 additions & 6 deletions core/res/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1925,12 +1925,6 @@
android:description="@string/permdesc_movePackage"
android:protectionLevel="signature|system" />

<!-- @hide Allows an application to change privacy guard state -->
<permission android:name="android.permission.CHANGE_PRIVACY_GUARD_STATE"
android:label="@string/permlab_changePrivacyGuardState"
android:description="@string/permdesc_changePrivacyGuardState"
android:protectionLevel="signature" />

<!-- Allows an application to change whether an application component (other than its own) is
enabled or not.
<p>Not for use by third-party applications. -->
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 0 additions & 6 deletions core/res/res/values/cm_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@
<string name="symbol_picker_lt">\u2264\u00ab\u2039</string>
<string name="symbol_picker_gt">\u2265\u00bb\u203a</string>

<!-- Privacy Guard -->
<string name="permlab_changePrivacyGuardState">enable or disable privacy guard</string>
<string name="permdesc_changePrivacyGuardState">Allows the app to change whether another app runs with Privacy Guard. When an app is running with Privacy Guard, it will not have access to personal data such as contacts, call logs, or messages.</string>
<string name="privacy_guard_notification">Privacy Guard active</string>
<string name="privacy_guard_notification_detail"><xliff:g id="app">%1$s</xliff:g> will not be able to access personal data</string>

<!-- The title of the profile picker dialog. -->
<string name="profile_picker_title">Profiles</string>

Expand Down
6 changes: 0 additions & 6 deletions core/res/res/values/symbols.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2037,15 +2037,9 @@
<!-- Electron Beam -->
<java-symbol type="bool" name="config_screenOffAnimation" />

<!-- Privacy Guard -->
<java-symbol type="string" name="privacy_guard_notification" />
<java-symbol type="string" name="privacy_guard_notification_detail" />
<java-symbol type="drawable" name="stat_notify_privacy_guard" />

<!-- Irda Service -->
<java-symbol type="bool" name="config_enableIrdaManagerService" />

<!-- Package Manager -->
<java-symbol type="array" name="config_disabledComponents" />

</resources>
3 changes: 2 additions & 1 deletion services/java/com/android/server/LocationManagerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ private void removeProviderLocked(LocationProviderInterface provider) {
mProvidersByName.remove(provider.getName());
}


/**
* Returns "true" if access to the specified location provider is allowed by the current
* user's settings. Access to all location providers is forbidden to non-location-provider
Expand Down Expand Up @@ -947,7 +948,7 @@ public List<String> getAllProviders() {
public List<String> getProviders(Criteria criteria, boolean enabledOnly) {
int allowedResolutionLevel = getCallerAllowedResolutionLevel();
ArrayList<String> out;
int uid = Binder.getCallingUid();;
int uid = Binder.getCallingUid();
long identity = Binder.clearCallingIdentity();
try {
synchronized (mLock) {
Expand Down
Loading

0 comments on commit b8d1ef8

Please sign in to comment.